Add Sample data set to AAI for Sparky

Add Sample data set to AAI for Sparky

This tutorial will focus on adding sample nodes with links once AAI is setup. With this data set, the sparky UI can be showcased.The first section will focus on how to add a sample data set for visualizing the nodes on sparky and the second section will focus on how to add different node type, so that you can build up a data set that suits you.



Step-by-step guide

How to post in data into AAI is covered in Tutorial: Making and Testing a Schema Change in A&AI. This wiki will detail the data that can be inserted for a type of node.

Adding a sample vnf data set

All of the following requests are put requests and the only thing that is changing is the URI and the post data. 

Request type:

PUT

Authorization:

Type: Basic Auth

Credentials: AAI/AAI (Check the robot scripts to get the latest credentials)

Content Type

The content type is JSON

Headers: 

In postman when you add the credentials in Authorization tab and select the data type ad JSON in the body tab,  the required headers will be added in the request



Sample post:

The sequence in which they should be entered should not be altered.

URL

Data

URL

Data

https://10.247.109.144:8443/aai/v10/cloud-infrastructure/complexes/complex/AMIST-COMPLEX-1

{               "data-center-code":"AMICPL1",

                "complex-name": "AMIST-COMPLEX-1-name",

                "physical-location-id":"AMIST-COMPLEX-1",

                "physical-location-type":"Office",

                "street1":"505",

                "street2":"Terry Fox Drive",

                "city":"Kanata",

                "state":"Ontario",

                "postal-code":"A1A1A1",

                "region": "Eastern",

                "country":"Canada"

}

https://10.247.109.144:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/AMIST/AMCR1

{

  "cloud-owner": "AMIST",

  "cloud-region-id": "AMCR1",

  "cloud-region-version": "11.0",

  "complex-name": "AMIST-COMPLEX-1"

}

https://10.247.109.144:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/AMIST/AMCR1/tenants/tenant/AMIST-TENANT-1

{

  "tenant-id": "AMIST-TENANT-1",

  "tenant-name": "AMIST-TENANT-1-NAME-1"

}





https://10.247.109.144:8443/aai/v10/network/generic-vnfs/generic-vnf/amist456vnf

{

  "vnf-id": "amist456vnf",

  "vnf-name": "amist456vnf",

  "vnf-type": "asbg",

  "prov-status": "junk",

  "equipment-role": "ASBG",

  "orchestration-status": "Running",

  "heat-stack-id": "amist456vnf-12345-678-",

  "ipv4-oam-address": "5.6.7.8",

  "in-maint": false,

  "is-closed-loop-disabled": false

}

 https://10.247.109.144:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/AMIST/AMCR1/tenants/tenant/AMIST-TENANT-1/vservers/vserver/AMIST-VSERVER-1

{

  "vserver-id": "AMIST-VSERVER-1",

  "vserver-name": "AMIST-VSERVER-1-name",

  "vserver-name2": "AMIST-VSERVER-1-name-2",

  "prov-status": "Running",

  "vserver-selflink": "AMT7 VserverLink",

  "in-maint": true,

  "is-closed-loop-disabled": true,

  "relationship-list": {

    "relationship": [

      {

        "related-to": "generic-vnf",

        "related-link": "https://aai-ext1.test.att.com:8443/aai/v9/network/generic-vnfs/generic-vnf/amist456vnf",

        "relationship-data": [

          {

            "relationship-key": "generic-vnf.vnf-id",

            "relationship-value": "amist456vnf"

          }

        ],

        "related-to-property": [

          {

            "property-key": "generic-vnf.vnf-name",

            "property-value": "amist456vnf"

          }

        ]

      },

      {

        "related-to": "pserver",

        "related-link": "https://aai-ext1.test.att.com:8443/aai/v9/cloud-infrastructure/pservers/pserver/amist-pserver-host-1",

        "relationship-data": [

          {

            "relationship-key": "pserver.hostname",

            "relationship-value": "amist-pserver-host-1"

          }

        ],

        "related-to-property": [

          {

            "property-key": "pserver.pserver-name2",

            "property-value": "amist-pserver-host-1-name"

          }

        ]

      }

    ]

  }

}

 https://10.247.109.144:8443/aai/v10/network/vnfcs/vnfc/AMIST-VSERVER-1001vnfc

{

  "vnfc-name": "AMIST-VSERVER-1001vnfc",

  "vnfc-function-code": "VDBE",

  "vnfc-type": "System Controller",

  "prov-status": "Pre-Prov",

  "orchestration-status": "CONFIGURED",

  "in-maint": false,

  "is-closed-loop-disabled": false,

  "relationship-list": {

    "relationship": [

      {

        "related-to": "vserver",

        "related-link": "https://aai-ext1.test.att.com:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/AMIST/AMCR1/tenants/tenant/AMIST-TENANT-1/vservers/vserver/AMIST-VSERVER-1",

        "relationship-data": [

          {

            "relationship-key": "cloud-region.cloud-owner",

            "relationship-value": "AMIST"

          },

          {

            "relationship-key": "cloud-region.cloud-region-id",

            "relationship-value": "AMCR1"

          },

          {

            "relationship-key": "tenant.tenant-id",

            "relationship-value": "AMIST-TENANT-1"

          },

          {

            "relationship-key": "vserver.vserver-id",

            "relationship-value": "AMIST-VSERVER-1"

          }

        ],

        "related-to-property": [

          {

            "property-key": "vserver.vserver-name",

            "property-value": "AMIST-VSERVER-1-name"

          }

        ]

      }

    ]

  }

}

https://10.247.109.144:8443/aai/v10/network/vnfcs/vnfc/AMIST-VSERVER-1001vnfc

{

  "vnfc-name": "AMIST-VSERVER-1001vnfc",

  "vnfc-function-code": "VDBE",

  "vnfc-type": "System Controller",

  "prov-status": "Pre-Prov",

  "orchestration-status": "CONFIGURED",

  "in-maint": false,

  "is-closed-loop-disabled": false,

  "relationship-list": {

    "relationship": [

      {

        "related-to": "vserver",

        "related-link": "https://aai-ext1.test.att.com:8443/aai/v9/cloud-infrastructure/cloud-regions/cloud-region/AMIST/AMCR1/tenants/tenant/AMIST-TENANT-1/vservers/vserver/AMIST-VSERVER-1",

        "relationship-data": [

          {

            "relationship-key": "cloud-region.cloud-owner",

            "relationship-value": "AMIST"

          },

          {

            "relationship-key": "cloud-region.cloud-region-id",

            "relationship-value": "AMCR1"

          },

          {

            "relationship-key": "tenant.tenant-id",

            "relationship-value": "AMIST-TENANT-1"

          },

          {

            "relationship-key": "vserver.vserver-id",

            "relationship-value": "AMIST-VSERVER-1"

          }

        ],

        "related-to-property": [

          {

            "property-key": "vserver.vserver-name",

            "property-value": "AMIST-VSERVER-1-name"

          }

        ]

      }

    ]

  }

}

https://10.247.109.144:8443/aai/v10/network/newvces/newvce/amist123vbc

{

  "vnf-id2": "amist123vbc",

  "vnf-name": "amist123vbc-name",

  "vnf-name2": "amist123vbc-name2",

  "vnf-type": "esx-vce",

  "prov-status": "PRE-PROV",

  "ipv4-oam-address": "4.2.3.4",

  "equipment-role": "VCE",

  "heat-stack-id": "amist123vbc"

}

https://10.247.109.144:8443/aai/v10/network/vces/vce/amist-vce-1/port-groups/port-group/amist-vce-interface-2

{

  "interface-id": "amist-vce-interface-2",

  "neutron-network-id": "amist-net-2",

  "interface-role": "MGMT",

  "orchestration-status": "PROV",

  "heat-stack-id": "amist-vce-interface-2-heat"

}

https://10.247.109.144:8443/aai/v10/network/vces/vce/amist-vce-1/port-groups/port-group/amist-vce-interface-2

{

  "interface-id": "amist-vce-interface-2",

  "neutron-network-id": "amist-net-2",

  "interface-role": "MGMT",

  "orchestration-status": "PROV",

  "heat-stack-id": "amist-vce-interface-2-heat"

}

https://10.247.109.144:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/AMIST/AMCR1/availability-zones/availability-zone/AMIST-AZ-1

{

"cloud-owner":"AMIST",

"cloud-region-id":"AMCR1",

"availability-zone-name":"AMIST-AZ-1",

"hypervisor-type":"OpenStackAmd"

}

https://10.247.109.144:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/AMIST/AMCR1/availability-zones/availability-zone/AMIST-AZ-1

{

"cloud-owner":"AMIST",

"cloud-region-id":"AMCR1",

"availability-zone-name":"AMIST-AZ-1",

"hypervisor-type":"OpenStackAmd"

}

https://10.247.109.144:8443/aai/v10/business/customers/customer/AMIST-CUST-11

{

   "global-customer-id": "AMIST-CUST-11",

   "subscriber-name": "AAIIST-TESTER-11",

   "subscriber-type": "Customer",

   "service-subscriptions": {"service-subscription":    [

            {

         "service-type": "amist-voip"       

      }

   ]}

}

https://10.247.109.144:8443/aai/v10/business/customers/customer/AMIST-CUST-11

{

   "global-customer-id": "AMIST-CUST-11",

   "subscriber-name": "AAIIST-TESTER-11",

   "subscriber-type": "Customer",

   "service-subscriptions": {"service-subscription":    [

            {

         "service-type": "amist-voip"       

      }

   ]}

}

https://10.247.109.144:8443/aai/v10/business/customers/customer/AMIST-CUST-11/service-subscriptions/service-subscription/amist-firewall/service-instances/service-instance/AMIST-SRVINST-11

{

"global-customer-id": "AMIST-CUST-11",

    "subscriber-name": "AAIIST-TESTER-11",

    "subscriber-type": "Customer",

    "service-subscriptions": {

        "service-subscription": [

            {

                "service-type": "amist-firewall"

            },

            {

                "service-instances": {

                    "service-instance": [

                        {

                            "service-instance-id": "AMIST-SRVINST-11",

                            "service-instance-name": "AMIST-SRVINST-11-name",

                            "bandwidth-total": "1Mbps",

                            "operational-status": "Up"

                        }

                    ]

                }

            }

        ]

    }

}

https://10.247.109.144:8443/aai/v10/business/customers/customer/AMIST-CUST-11/service-subscriptions/service-subscription/amist-firewall/service-instances/service-instance/AMIST-SRVINST-11

{

"global-customer-id": "AMIST-CUST-11",

    "subscriber-name": "AAIIST-TESTER-11",

    "subscriber-type": "Customer",

    "service-subscriptions": {

        "service-subscription": [

            {

                "service-type": "amist-firewall"

            },

            {

                "service-instances": {

                    "service-instance": [

                        {

                            "service-instance-id": "AMIST-SRVINST-11",

                            "service-instance-name": "AMIST-SRVINST-11-name",

                            "bandwidth-total": "1Mbps",

                            "operational-status": "Up"

                        }

                    ]

                }

            }

        ]

    }

}

https://10.247.109.144:8443/aai/v10/network/generic-vnfs/generic-vnf/amist457vnf

{

  "vnf-id": "amist457vnf",

  "vnf-name": "amist457vnf",

  "vnf-type": "asbg",

  "prov-status": "junk",

  "equipment-role": "ASBG",

  "orchestration-status": "Running",

  "heat-stack-id": "amist457vnf-12345-678-",

  "ipv4-oam-address": "5.6.7.8",

  "in-maint": false,

  "is-closed-loop-disabled": false

}



Adding Different node types

1. Create Customer.



PUT Request:



URL: https://<host-ip>:8443



Resource: /aai/v8/business/customers/customer/AMTEL-HS-10007



GET: /aai/v8/business/customers/customer/AMTEL-HS-10007/service-subscriptions/service-subscription/voip



 



{



   "global-customer-id": "AMTEL-HS-10007",



   "subscriber-name": "AMTEL-HS-10007",



   "subscriber-type": "Customer",



   "service-subscriptions": {"service-subscription":    [



            {



         "service-type": "voip"       



      }



   ]}



}



 



2. Create Service Instance for the above Customer.



PUT Request:



URL: https://<host-ip>:8443



Resource: /aai/v8/business/customers/customer/AMTEL-HS-10007/service-subscriptions/service-subscription/voip/service-instances/service-instance/SI-AMT-007HS



 



{



"global-customer-id": "AMTEL-HS-10007",



    "subscriber-name": "AMTEL-HS-10007",



    "subscriber-type": "Customer",



    "service-subscriptions": {



        "service-subscription": [



            {



                "service-type": "voip"



            },



            {



                "service-instances": {



                    "service-instance": [



                        {



                            "service-instance-id": "SI-AMT-007HS",



                            "service-instance-name": "AMTEL-VOIP-HS0007",



                            "bandwidth-total": "1Mbps",



                            "operational-status": "Up"



                        }



                    ]



                }



            }



        ]



    }



}



 



 



NOTE! GET /aai/v8/business/customers/customer/AMTEL-HS-10007/service-subscriptions/service-subscription/voip/service-instances/service-instance/SI-AMT-007HS and look for the presence of SI name, BW-total and Op-Status. If not present, do a PUT for each individually …  "service-instance-name": "AMTEL-VOIP-HS0007",  "bandwidth-total": "1Mbps",  &  "operational-status": "Up"



 



4. Create Pserver



PUT Request:



URL: https://<host-ip>:8443



Resource: /aai/v8/cloud-infrastructure/pservers/pserver/amt-server-7MB



 



{



   "hostname": "amt-server-7MB",



   "number-of-cpus": "10",



   "disk-in-gigabytes": "144",



   "ram-in-megabytes": "6291456",



   "equip-type": "Rack Server",



   "equip-vendor": "Dell",



   "equip-model": "PowerEdge R930",



   "serial-number": "S4MPLED474HS",



   "pserver-id": "Pserver-AMT-007HS",



   "in-maint": false



}



 



5.0 Create cloud-region ONLY ONCE!!! Once created, you can add additional Customer graphs on the same cloud.