AAI Database is implemented using graph database. To interact with any node, user needs to know the path to the node. The definitions of all nodes are provided in aai_schema_v11.xsd document.
All paths supported by A&AI service are defined in the aai_swagger_v11.html document that can be found on A&AI REST API Documentation wiki page. The general rule of using CRUD API of AAIService is described in the Introduction to CCSDK-Adaptors/AAIService component wiki page.
All DG node transactions are focused on interacting with a node itself, meaning when user wants to perform a transaction for a specific type, it needs to use its type name as a resource, and in case of <save> or <update>, it needs to set the resource value using node's type. Let's take as an example a task to insert the following service-instance data to AAI:
{ "service-instance-id": "MY_DOMAIN", "service-instance-name": "MY_DOMAIN", "resource-version": "1508232694103" }, "metadata": { "metadatum": [ { "metaname": "domain-id", "metaval": "9eec1c7c-4e71", "resource-version": "1508230566629" }, { "metaname": "EmailID:user@gmail.com", "metaval": "3ef8cc1c-6ad6", "resource-version": "1508230567068" } ] } } |
AAIService API does not allow to insert the whole JSON graph to AAI, but it allows to operate on each node individually.
Therefore user needs to write 3 DG nodes to deal with each node individually:service-instance node first, then 2 metadata nodes, second.
/aai/v11/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}
the request key string will look like this, assuming that the target path is: /aai/v11/business/customers/customer/my-customer/service-subscriptions/service-subscription/SERVICE-TYPE-DOMAIN/service-instances/service-instance/MY_DOMAIN
key="customer.global-customer-id = 'my-customer' AND service-subscription.service-type = 'SERVICE-TYPE-DOMAIN' AND service-instance.service-instance-id = 'MY_DOMAIN'" |
The whole DG node will be defined as follows:
<save plugin="org.openecomp.sdnc.sli.aai.AAIService" resource="service-instance" key="customer.global-customer-id = 'my-customer' AND service-subscription.service-type = 'SERVICE-TYPE-DOMAIN' AND service-instance.service-instance-id = 'MY_DOMAIN'" force="true" local-only="false" pfx="tmp.AnAI-data.vnf" > <parameter name="service-instance-id" value="MY_DOMAIN" /> <parameter name="service-instance-name" value="MY_DOMAIN" /> </save> |
the request key will contain additional name-value pair identifying metadatum node, for example for the first node, it will look as follows:
key="customer.global-customer-id = 'my-customer' AND service-subscription.service-type = 'SERVICE-TYPE-DOMAIN' AND service-instance.service-instance-id = 'MY_DOMAIN' AND metadatum.metaname = 'domain-id'" |
The whole DG node will be defined as follows
<save plugin="org.openecomp.sdnc.sli.aai.AAIService" resource="metadatum" key="customer.global-customer-id = 'my-customer' AND service-subscription.service-type = 'SERVICE-TYPE-DOMAIN' AND service-instance.service-instance-id = 'MY_DOMAIN' AND metadatum.metaname = 'domain-id'" force="true" local-only="false" pfx="tmp.AnAI-data.vnf" > <parameter name="metaname" value="domain-id" /> <parameter name="metaval" value="9eec1c7c-4e71" /> </save> |
the request key for the second 'metadatum' node will look as follows:
key="customer.global-customer-id = 'my-customer' AND service-subscription.service-type = 'SERVICE-TYPE-DOMAIN' AND service-instance.service-instance-id = 'MY_DOMAIN' AND metadatum.metaname = 'EmailID:user@gmail.com'" |
The whole DG node will be defined as follows:
<save plugin="org.openecomp.sdnc.sli.aai.AAIService" resource="metadatum" key="customer.global-customer-id = 'my-customer' AND service-subscription.service-type = 'SERVICE-TYPE-DOMAIN' AND service-instance.service-instance-id = 'MY_DOMAIN' AND metadatum.metaname = 'EmailID:user@gmail.com'" force="true" local-only="false" pfx="tmp.AnAI-data.vnf" > <parameter name="metaname" value="EmailID:user@gmail.com" /> <parameter name="metaval" value="3ef8cc1c-6ad6" /> </save> |
You may also want to use visual panels to communicate related information, tips or things users need to be aware of. |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|