Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

When testing VNF actions in A&AI it might be necessary to load the VNF data in A&AI required to test the VNF.  One method is to use the below put_closed_loop.sh to submit the data to A&AI.

The syntax for executing the put_closed_loop.sh command is:

$ ./put_closed_loop.sh aai-ip-hostname
put_closed_loop.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 -T model.json -X PUT $HEADERS https://$RESOURCE_HOSTNAME:8443/aai/v11/service-design-and-creation/models/model/vCPE_Intrastructure_Metro_vGMUX
eval curl -k -u AAI:AAI -T generic-vnf.json -X PUT $HEADERS https://$RESOURCE_HOSTNAME:8443/aai/v11/network/generic-vnfs/generic-vnf/vCPE_Infrastructure_vGMUX_demo_app
eval curl -k -u AAI:AAI -T cloud-region.json -X PUT $HEADERS https://$RESOURCE_HOSTNAME:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/pod25/RegionOne
eval curl -k -u AAI:AAI -T vserver-generic-vnf-relationship.json -X PUT $HEADERS https://$RESOURCE_HOSTNAME:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/pod25/RegionOne/tenants/tenant/466979b815b5415ba14ada713e6e1846/vservers/vserver/e8020a03-5cd9-4f8c-b2d8-9972a256cf6a/relationship-list/relationship
eval curl -k -u AAI:AAI -T VNFC-VNF-info.json -X PUT $HEADERS https://$RESOURCE_HOSTNAME:8443/aai/v11/network/vnfcs/vnfc/VNFC_vGMUX_demo_app
model.json
{
    "model-invariant-id": "vCPE_Intrastructure_Metro_vGMUX",
    "model-type": "sometype",
    "model-vers": {
        "model-ver": [
            {
                "model-version-id": "vCPE",
                "model-name": "vCPE",
                "model-version": "vCPE"
            }
        ]
    }
}
generic-vnf.json
{
   "vnf-id": "vCPE_Infrastructure_vGMUX_demo_app",
   "vnf-name": "vCPE_Infrastructure_vGMUX_demo_app",
   "vnf-type": "vCPE",
   "service-id": "vFirewall_demo_app",
   "orchestration-status": "running",
   "in-maint": false,
   "is-closed-loop-disabled": false,
   "model-invariant-id": "vCPE_Intrastructure_Metro_vGMUX",
   "model-version-id": "vCPE"
}
cloud-region.json
{
    "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",
    "sriov-automation": true,
    "esr-system-info-list": {
        "esr-system-info": [
            {
        "resource-version":"1509714052357",
                "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",
                "protocal": "example-protocal-val-52954",
                "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"
            }
        ]
    },
    "tenants": {
        "tenant": [
            {
                "tenant-id": "466979b815b5415ba14ada713e6e1846",
                "tenant-name": "Integration",
                "vservers": {
                    "vserver": [
                        {
                            "in-maint": false,
                            "is-closed-loop-disabled": false,
                            "prov-status": "Running",
                            "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"
                        }
                    ]
                }
            }
        ]
    }
}
vserver-generic-vnf-relationship.json
{
    "related-to": "generic-vnf",
    "related-link" : "/aai/v11/network/generic-vnfs/generic-vnf/vCPE_Infrastructure_vGMUX_demo_app"
}
 
VNC-VNF-info.json
{
    "vnfc-name": "VNFC_vGMUX_demo_app",
    "nfc-naming-code": "vGMUXCODE",
    "nfc-function": "vGMUX",
    "prov-status": "Running",
    "orchestration-status": "Running",
    "in-maint": false,
    "is-closed-loop-disabled": false,
    "relationship-list": 
    {
    "relationship": 
        [
            {
                "related-to": "vserver",
                "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/pod25/RegionOne/tenants/tenant/466979b815b5415ba14ada713e6e1846/vservers/vserver/e8020a03-5cd9-4f8c-b2d8-9972a256cf6a"
            },
            {
                "related-to": "generic-vnf",
                "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/vCPE_Infrastructure_vGMUX_demo_app"
            }
        ]
    }
}
  • No labels