<UNDER CONSTRUCTION>
Table of Contents
Table of Contents | ||
---|---|---|
|
Introduction
A&AI (Active and Available Inventory) is implemented using a graph database. A graph database is an online database management system with Create, Read, Update and Delete (CRUD) operations working on a graph data model.
...
Features of Release 10 can be found here: {needs link to A&AI document}
AAIService API
...
AAIService is an implementation of a REST API client for SDNC-ADAPTORS feature. It exposes its CRUD services through SvcLogicResource interface.
...
force and local-only apply to some of the nodes. Values of these parameters are ignored in AAIService.
Create:<save/>
Save should be used when the caller wants to create a new resource in A&AI.
Code Block |
---|
<save plugin="org.openecomponap.sdncccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $service-configuration-operation-input.ucpe-vms-service-information.vnf-list.vnf-information[0].vnf-id" force="true" local-only="false" pfx="tmp.AnAI-data.vnf" > <parameter name="link-name" value="ckt126" /> <parameter name="circuit-id" value="DHEC.155095.ACC" /> <parameter name="speed-value" value="1000" /> <parameter name="speed-units" value="Mbps" /> <parameter name="dual-mode" value="Active" /> </save> |
Delete
Delete should be used when the caller wants to remove a resource in A&AI.
Code Block |
---|
<delete plugin="org.openecomponap.sdncccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $mypath.myvalue" > </delete> |
Retrieve: <get-resource/>
Get-resource should be used when the caller wants to retrieve an existing resource from A&AI. The caller must pass the key of the resource. If the resource is a child the keys of the resource's parent must be passed as well.
Code Block |
---|
<get-resource plugin="org.openecomponap.sdncccsdk.sli.adaptors.aai.AAIService" resource="vserver" key="vserver.vserver-name = $vnf-id" local-only="false" pfx="vnfProfile" /> |
update
Update should be used when the caller wants to update an existing resource in A&AI.
Code Block |
---|
<update plugin="org.openecomponap.sdncccsdk.sli.adaptors.aai.AAIService" resource="logical-link" key="logical-link.link-name = $vserver-id" force="true" local-only="false" pfx="tmp.AnAI-data.vnf" > <parameter name="link-name" value="ckt126" /> <parameter name="circuit-id" value="DHEC.155095.ACC" /> <parameter name="speed-value" value="1000" /> <parameter name="speed-units" value="Mbps" /> <parameter name="dual-mode" value="Active" /> </update> |
Understanding AAI Documentation
...
Before you start defining path identifiers in the key, you need to download the document listing all paths in AAI. . If you don't have access to this community you may need to request it.
...
AAIService is tightly coupled to the A&AI schema. By viewing the AAI schema you get both insight into A&AI as well as AAIService.
Example of Using The HTML file
The v10v11_aai_index.html document lists paths supported by AAI REST API.
The path may contain multiple nodes. Each node is identified by the node type and its primary id.
...
Code Block |
---|
/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id} |
How to select right resource for AAIService
...
There are 3 types of resource names used by AAIService:
- name of the data type to be used by the request. Names of these types have to match the names of data types supported by AAI, as defined in AAI documentation, usually aai_schema_vX.xsd, where X represents the release number in AAI system. Examples are: generic-vnf, pserver, tenant, and so on.
- Extended name for processing of relationship-list. It consists of the data type from item 1 appended with ":relationship-list". This is used for adding/deleting relationship data to existing nodes.
- Special functions: Currently there are 2 special functions: named-query and nodes-query.
How to create the key string for AAIService
...
The key string contains the identifiers of the elements in the path.
...
Code Block |
---|
<save plugin="org.openecomponap.sdncccsdk.sli.adaptors.aai.AAIService" resource="vserver" key="cloud-region.cloud-owner = '$a' AND cloud-region.cloud-region-id = '$b' AND tenant.tenant-id = '$c' AND vserver.vserver-id = '$d'" force="true" local-only="false" pfx="tmp.AnAI-Assign-VNFs.AAI.VSERVER.RT"> |
Special key names
selflink
In some situations the developer may know the path to the resource, for example after calling nodes-query, the response contains the resource type and resource link.
To address such case, AAIService provides a special key name to be used to retrieve the data. The key name is 'selflink'. Developer can use returned resource-link to pass it to <get-resource> node.
...
Code Block | ||
---|---|---|
| ||
<get-resource plugin="org.openecomponap.sdncccsdk.sli.adaptors.aai.AAIService" resource="service-instance" key="selflink = https://aai.test.onap.org:8443/aai/v9/business/customers/customer/PerfTestCust00020021/service-subscriptions/service-subscription/Gamma-L2/service-instances/service-instance/d5dd0e08-98c2-40da-b262-4ae4f4cf8d3f" local-only="false" pfx="vnfProfile" /> |
depth
If you take for example the sub-paths starting with generic-vnf, user may not want to be retrieving full graphs that exists for an instance of generic-vnf, in which case retrieving the entire graph would be unnecessary but also may lead to straining the resources.
Code Block | ||
---|---|---|
| ||
/aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/vf-modules/vf-module/{vf-module-id} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/licenses/license/{group-uuid}/{resource-uuid} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/entitlements/entitlement/{group-uuid}/{resource-uuid} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name} /aai/v10v11/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name} |
...
Code Block | ||
---|---|---|
| ||
<get-resource plugin="org.openecomponap.sdncccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-is = $vnf-id AND depth = 'all'" local-only="false" pfx="vnfProfile" /> |
Difference between <save> and <update>
When writing data the developer should understand the difference between <save> and <update>.
...