Add Cloud, business customer, zone, service and tenant in A&AI

---------------------------------
CHECK IF COMPLEX OBJECT EXISTS: 
---------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/complexes/complex/clli1?depth=3 | jq .

---------------------------------
INSERT COMPLEX OBJECT: 
---------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/complexes/complex/clli1 -X PUT -d /
'{
  "physical-location-id": "clli1",
  "data-center-code": "example-data-center-code-val-5556",
  "complex-name": "clli1",
  "identity-url": "example-identity-url-val-56898",
  "physical-location-type": "example-physical-location-type-val-7608",
  "street1": "example-street1-val-34205",
  "street2": "example-street2-val-99210",
  "city": "example-city-val-27150",
  "state": "example-state-val-59487",
  "postal-code": "68871",
  "country": "example-country-val-94173",
  "region": "example-region-val-13893",
  "latitude": "example-latitude-val-89101",
  "longitude": "32.89948",
  "elevation": "97.045443",
  "lata": "example-lata-val-46073"
}'
---------------------------------
CHECK IF COMPLEX OBJECT EXISTS: 
---------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/complexes/complex/clli1?depth=3 | jq .


----------------------------------------------------
CHECK IF CLOUD OWNER AND CLOUD REGION OBJECT EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud?depth=3 | jq .


----------------------------------------------------
INSERT CLOUD OWNER AND CLOUD REGION OBJECT: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud -X PUT -d \
'{
  "cloud-owner": "CloudOwner",
  "cloud-region-id": "ericssoncloud",
  "cloud-type": "OPENSTACK",
  "owner-defined-type": "OwnerType",
  "cloud-region-version": "v1",
  "cloud-zone": "CloudZone",
  "availability-zones": {
    "availability-zone": [
      {
        "availability-zone-name": "nova",
        "hypervisor-type": "kvm",
        "operational-status": "available"
      }
    ]
  }
}
' | jq .
----------------------------------------------------
CHECK IF CLOUD OWNER AND CLOUD REGION OBJECT EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud?depth=3 | jq .


----------------------------------------------------
CHECK IF BUSINESS CUSTOMER EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/business/customers/customer/EricssonDemoCustomer?depth=3 | jq .

----------------------------------------------------
INSERT BUSINESS CUSTOMER: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/business/customers/customer/EricssonDemoCustomer -X PUT -d \
'{
  "global-customer-id": "EricssonDemoCustomer",
  "subscriber-name": "EricssonDemoCustomer",
  "subscriber-type": "INFRA",
  "service-subscriptions": {
    "service-subscription": [
      {
        "service-type": "vLB",
        "relationship-list": {
          "relationship": [
            {
              "related-to": "tenant",
              "relationship-label": "org.onap.relationships.inventory.Uses",
              "related-link": "/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d",
              "relationship-data": [
                {
                  "relationship-key": "cloud-region.cloud-owner",
                  "relationship-value": "CloudOwner"
                },
                {
                  "relationship-key": "cloud-region.cloud-region-id",
                  "relationship-value": "ericssoncloud"
                },
                {
                  "relationship-key": "tenant.tenant-id",
                  "relationship-value": "693c7729b2364a26a3ca602e6f66187d"
                }
              ],
              "related-to-property": [
                {
                  "property-key": "tenant.tenant-name",
                  "property-value": "admin"
                }
              ]
            }
          ]
        }
      },
      {
        "service-type": "vCPE",
        "relationship-list": {
          "relationship": [
            {
              "related-to": "tenant",
              "relationship-label": "org.onap.relationships.inventory.Uses",
              "related-link": "/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d",
              "relationship-data": [
                {
                  "relationship-key": "cloud-region.cloud-owner",
                  "relationship-value": "CloudOwner"
                },
                {
                  "relationship-key": "cloud-region.cloud-region-id",
                  "relationship-value": "ericssoncloud"
                },
                {
                  "relationship-key": "tenant.tenant-id",
                  "relationship-value": "693c7729b2364a26a3ca602e6f66187d"
                }
              ],
              "related-to-property": [
                {
                  "property-key": "tenant.tenant-name",
                  "property-value": "admin"
                }
              ]
            }
          ]
        }
      }
    ]
  }
}
' | jq .

----------------------------------------------------
CHECK IF BUSINESS CUSTOMER EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/business/customers/customer/EricssonDemoCustomer?depth=3 | jq .


----------------------------------------------------
CHECK IF ZONE EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/network/zones/zone/nova?depth=3  | jq .


----------------------------------------------------
INSERT ZONE: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/network/zones/zone/nova -X PUT -d \
'{
"zone-id":"nova",
"zone-name":"nova",
"design-type":"integration",
"zone-context":"labs",
"status": "deployed"
}
' | jq .

----------------------------------------------------
CHECK IF ZONE EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/network/zones/zone/nova?depth=3  | jq .

----------------------------------------------------
CHECK IF SERVICE EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/service-design-and-creation/services/service/f13844f4-dbf8-4d0e-a979-45204f3ddb4e?depth=3


----------------------------------------------------
INSERT SERVICE: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/service-design-and-creation/services/service/f13844f4-dbf8-4d0e-a979-45204f3ddb4e -X PUT -d '{"service-id":"f13844f4-dbf8-4d0e-a979-45204f3ddb4e","service-description":"vCPE"}'

----------------------------------------------------
CHECK IF TENANT EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d?depth=3 | jq .

----------------------------------------------------
INSERT TENANT: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d -X PUT -d \
'{
  "tenant-id": "693c7729b2364a26a3ca602e6f66187d",
  "tenant-name": "admin"
}' | jq .

----------------------------------------------------
CHECK IF TENANT EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d?depth=3 | jq .


----------------------------------------------------
CHECK IF SERVICE SUBSCRIPTION EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/business/customers/customer/EricssonDemoCustomer/service-subscriptions/service-subscription/vCPE/relationship-list/relationship?depth=3 | jq .


----------------------------------------------------
INSERT SERVICE SUBSCRIPTION: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/business/customers/customer/EricssonDemoCustomer/service-subscriptions/service-subscription/vCPE/relationship-list/relationship -X PUT -d \
'{
        "related-to": "tenant",
        "relationship-label": "org.onap.relationships.inventory.Uses",
        "related-link": "/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/ericssoncloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d",
        "relationship-data": [
          {
            "relationship-key": "cloud-region.cloud-owner",
            "relationship-value": "CloudOwner"
          },
          {
            "relationship-key": "cloud-region.cloud-region-id",
            "relationship-value": "ericssoncloud"
          },
          {
            "relationship-key": "tenant.tenant-id",
            "relationship-value": "693c7729b2364a26a3ca602e6f66187d"
          }
        ],
        "related-to-property": [
          {
            "property-key": "tenant.tenant-name",
            "property-value": "admin"
          }
        ]
      }

' | jq .

----------------------------------------------------
CHECK IF SERVICE SUBSCRIPTION EXISTS: 
----------------------------------------------------
curl  -k --user VID:VID -H "Accept: application/json" -H "Content-Type: application/json" -H "X-TransactionId: AFR" -H "X-FromAppId: AFR" https://aai.onap:8443/aai/v14/business/customers/customer/EricssonDemoCustomer/service-subscriptions/service-subscription/vCPE/relationship-list/relationship?depth=3 | jq .


How to fix missing project and owning entity drop down values in VID "Create Service Instance -- a la carte" window

Add following entries in vid-mariadb-galera database


Steps:


  1. Login to vid-mariadb-galera database

    kubectl -n onap exec -it devonap-vid-vid-mariadb-galera-0 bash


  2. Run following command to find database password

    bash-4.2$ env | grep -i password
    
    MYSQL_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
    MYSQL_ROOT_PASSWORD=secretpassword


  3. Login to MariaDB and connect to vid_openecomp_epsdk database

    bash-4.2$ mysql -uroot -psecretpassword
    
    MariaDB [(none)]>  show databases;
    +---------------------+
    | Database            |
    +---------------------+
    | information_schema  |
    | mysql               |
    | performance_schema  |
    | vid_openecomp_epsdk |
    +---------------------+
    4 rows in set (0.02 sec)
    
    MariaDB [(none)]> connect vid_openecomp_epsdk
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Connection id:    83013
    Current database: vid_openecomp_epsdk
    
    MariaDB [vid_openecomp_epsdk]> 


  4. Insert following entries in vid_category_parameter_option table

    MariaDB [vid_openecomp_epsdk]> select * from vid_category_parameter;
    +-------------+------------------------------+--------------+---------------------------+---------------------+---------------------+
    | CATEGORY_ID | NAME                         | ID_SUPPORTED | FAMILY                    | CREATED_DATE        | MODIFIED_DATE       |
    +-------------+------------------------------+--------------+---------------------------+---------------------+---------------------+
    |           1 | platform                     |            0 | PARAMETER_STANDARDIZATION | 2017-09-12 17:01:13 | 2017-09-12 17:01:13 |
    |           2 | project                      |            0 | PARAMETER_STANDARDIZATION | 2017-09-12 18:23:54 | 2017-09-13 15:05:25 |
    |           3 | lineOfBusiness               |            0 | PARAMETER_STANDARDIZATION | 2017-09-12 18:24:14 | 2017-09-12 18:24:15 |
    |           4 | owningEntity                 |            1 | PARAMETER_STANDARDIZATION | 2017-09-12 18:24:26 | 2017-09-12 18:24:28 |
    |           5 | operational-environment-type |            0 | TENANT_ISOLATION          | 2017-11-12 18:24:26 | 2017-11-12 18:24:28 |
    |           6 | workload-context             |            0 | TENANT_ISOLATION          | 2017-11-12 18:24:26 | 2017-11-12 18:24:28 |
    +-------------+------------------------------+--------------+---------------------------+---------------------+---------------------+
    6 rows in set (0.01 sec)
    
    
    MariaDB [vid_openecomp_epsdk]> select * from vid_category_parameter_option;
    +--------------------+---------------------+-------+-------------+---------------------+---------------------+
    | CATEGORY_OPT_DB_ID | CATEGORY_OPT_APP_ID | NAME  | CATEGORY_ID | CREATED_DATE        | MODIFIED_DATE       |
    +--------------------+---------------------+-------+-------------+---------------------+---------------------+
    |                 25 | ECOMP               | ECOMP |           6 | 2018-12-06 14:55:12 | 2018-12-06 14:55:12 |
    |                 26 | DEV                 | DEV   |           6 | 2018-12-06 14:55:12 | 2018-12-06 14:55:12 |
    |                 27 | TEST                | TEST  |           6 | 2018-12-06 14:55:12 | 2018-12-06 14:55:12 |
    |                 28 | VNF                 | VNF   |           5 | 2018-12-06 14:55:12 | 2018-12-06 14:55:12 |
    +--------------------+---------------------+-------+-------------+---------------------+---------------------+
    
    
    MariaDB [vid_openecomp_epsdk]> SHOW COLUMNS FROM vid_category_parameter_option;
    +---------------------+-------------+------+-----+-------------------+----------------+
    | Field               | Type        | Null | Key | Default           | Extra          |
    +---------------------+-------------+------+-----+-------------------+----------------+
    | CATEGORY_OPT_DB_ID  | int(11)     | NO   | PRI | NULL              | auto_increment |
    | CATEGORY_OPT_APP_ID | varchar(50) | NO   |     | NULL              |                |
    | NAME                | varchar(50) | YES  |     | NULL              |                |
    | CATEGORY_ID         | int(11)     | NO   | MUL | 0                 |                |
    | CREATED_DATE        | timestamp   | NO   |     | CURRENT_TIMESTAMP |                |
    | MODIFIED_DATE       | timestamp   | NO   |     | CURRENT_TIMESTAMP |                |
    +---------------------+-------------+------+-----+-------------------+----------------+
    
    
    INSERT INTO vid_category_parameter_option (CATEGORY_OPT_APP_ID, NAME, CATEGORY_ID) VALUES ('oe_1', 'oe_2', 4);
    INSERT INTO vid_category_parameter_option (CATEGORY_OPT_APP_ID, NAME, CATEGORY_ID) VALUES ('PLATFORM_APP_ID_1', 'PLATFORM_NAME_1', 1);
    
    
    UPDATE northbound_request_ref_lookup set SERVICE_TYPE='*';