In support of the Identity-URL requirement A&AI created a named-query for APPC to pull VNF data in one query.  That query can be executed either via Postman or curl (curl is used in this example)

  • The verify.sh script is basically building and executing a curl command that hits the A&AI REST service. 
verify.sh
#!/bin/bash

HEADERS='-H "X-FromAppId: AAI-Temp-Tool" -H "X-TransactionId: AAI-Temp-Tool" -H "Real-Time: true" -H "Content-Type: application/json" -H "Accept: application/json"';

if [ $# -eq 0 ]; then
        echo "Invalid you need to provide the ip address or hostname of machine to run the requests";
        exit 1;
fi;

RESOURCE_HOSTNAME=$1;

eval curl -k -u AAI:AAI -X POST -T named-query.json $HEADERS https://$RESOURCE_HOSTNAME:8443/aai/search/named-query
  • The named-query.json is required input for the verify.sh script and an example can be viewed below (The named query ID should remain constant throughout A&AI instances)
named-query.json
{
    "query-parameters": {
            "named-query": {
            "named-query-uuid": "037eb932-edac-48f5-9782-c19c0aa5a031"
        }
    },
    "instance-filters":{
            "instance-filter":[ {
            "generic-vnf": {
                "vnf-id": "vCPE_Infrastructure_vGMUX_demo_app"
            }
        } ]
    }
}
  • The verify.sh script can be executed by typing the command below (aai1 represents the hostname or IP of the A&AI instance)
  • The response should include VNF info, VNFC info, ESR info, tenant info as well as vserver info
verify.sh execution
$ ./verify.sh aai1 |python -m json.tool (NOTE the "|python -m json.tool" creates a nicely formatted json response but is not required)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2848    0  2518  100   330   1053    138  0:00:02  0:00:02 --:--:--  1053
{
    "inventory-response-item": [
        {
            "extra-properties": {},
            "generic-vnf": {
                "in-maint": false,
                "is-closed-loop-disabled": false,
                "model-invariant-id": "vCPE_Intrastructure_Metro_vGMUX",
                "model-version-id": "vCPE",
                "orchestration-status": "Running",
                "resource-version": "1510104391195",
                "service-id": "vFirewall_demo_app",
                "vnf-id": "vCPE_Infrastructure_vGMUX_demo_app",
                "vnf-name": "vCPE_Infrastructure_vGMUX_demo_app",
                "vnf-type": "vCPE"
            },
            "inventory-response-items": {
                "inventory-response-item": [
                    {
                        "extra-properties": {},
                        "inventory-response-items": {
                            "inventory-response-item": [
                                {
                                    "extra-properties": {},
                                    "vnfc": {
                                        "in-maint": false,
                                        "is-closed-loop-disabled": false,
                                        "nfc-function": "vGMUX",
                                        "nfc-naming-code": "vGMUXCODE",
                                        "orchestration-status": "Running",
                                        "prov-status": "Running",
                                        "resource-version": "1509725780164",
                                        "vnfc-name": "VNFC_vGMUX_demo_app"
                                    }
                                },
                                {
                                    "extra-properties": {},
                                    "inventory-response-items": {
                                        "inventory-response-item": [
                                            {
                                                "cloud-region": {
                                                    "cloud-owner": "pod25",
                                                    "cloud-region-id": "RegionOne",
                                                    "cloud-region-version": "titanium_cloud",
                                                    "cloud-type": "openstack",
                                                    "cloud-zone": "cloud zone",
                                                    "complex-name": "complex name",
                                                    "identity-url": "http://10.0.14.1:9005/api/multicloud-titanium_cloud/v0/pod25_RegionOne/identity/v2.0",
                                                    "owner-defined-type": "owner-defined-type",
                                                    "resource-version": "1509725696928",
                                                    "sriov-automation": true
                                                },
                                                "extra-properties": {},
                                                "inventory-response-items": {
                                                    "inventory-response-item": [
                                                        {
                                                            "esr-system-info": {
                                                                "cloud-domain": "Default",
                                                                "default-tenant": "Integration",
                                                                "esr-system-info-id": "432ac032-e996-41f2-84ed-9c7a1766eb29",
                                                                "ip-address": "example-ip-address-val-44431",
                                                                "password": "onapdemo",
                                                                "port": "example-port-val-93234",
                                                                "resource-version": "1509725697438",
                                                                "service-url": "http://10.12.25.2:5000/v3",
                                                                "ssl-cacert": "example-ssl-cacert-val-75021",
                                                                "ssl-insecure": true,
                                                                "system-name": "example-system-name-val-29070",
                                                                "system-type": "VIM",
                                                                "type": "example-type-val-85254",
                                                                "user-name": "demo",
                                                                "vendor": "example-vendor-val-94515",
                                                                "version": "example-version-val-71880"
                                                            },
                                                            "extra-properties": {}
                                                        }
                                                    ]
                                                }
                                            }
                                        ]
                                    },
                                    "tenant": {
                                        "resource-version": "1509725696999",
                                        "tenant-id": "466979b815b5415ba14ada713e6e1846",
                                        "tenant-name": "Integration"
                                    }
                                }
                            ]
                        },
                        "vserver": {
                            "in-maint": false,
                            "is-closed-loop-disabled": false,
                            "prov-status": "Running",
                            "resource-version": "1509725717054",
                            "vserver-id": "e8020a03-5cd9-4f8c-b2d8-9972a256cf6a",
                            "vserver-name": "zdcpe1cpe01mux01",
                            "vserver-name2": "zdcpe1cpe01mux01",
                            "vserver-selflink": "http://10.0.14.1:80/api/multicloud-titanium_cloud/v0/pod25_RegionOne/compute/v2.1/466979b815b5415ba14ada713e6e1846/servers/e8020a03-5cd9-4f8c-b2d8-9972a256cf6a"
                        }
                    }
                ]
            },
            "model-name": "vCPE"
        }
    ]
}
  • No labels