4 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
5 .. http://creativecommons.org/licenses/by/4.0
7 AAI Generic Query Implementation Notes
12 The Generic Query mechanism allows to search for certain nodes of
13 “include” node types at a specified “depth” from the from a particular
14 start node of type “start-node-type” identified by specifying its
17 The Generic Query is implemented using the GET method with the
18 following URL that takes 4 query params:
22 /aai/<version>/search/generic-query
24 Ex. /aai/v16/search/generic-query
26 Please look for other AAI documentation for what version to use in
27 which environment/release.
29 **key** - multiple values that together specify the params to select a
30 unique start node. For example for selecting a customer we would
35 key=customer.global-customer-id:ma9181-203-customerid&key=service-subscription.service-type:example-service-type
37 **start-node-type** - node type of the start node. For example
38 start-node-type=service-instance
40 **include** - multiple values of the node types that need to be
41 returned as part of the query-result. For example
45 include=vce&include=port-group
47 **depth** – look for include node types within a certain depth from
50 The queries return a search-results object back which includes a list
51 of result-data which contains the node-type and a link for each
52 resource that was found.
57 * At depth=0, only the start node is returned, include is not needed
59 * At any depth > 0 and <= 6, If start-node-type is in the include –
60 that should also be returned
62 * The depth has a max value of 6 – an error will be returned if a
63 value higher than 6 is used
65 * A special node type of “all” can be specified for include when all
66 nodes under the start node are to be searched for
68 * If a start-node cannot be found based on the key a HTTP response
69 code of 404 Node not found error is returned
71 * If no nodes can be found that meet the search criteria a HTTP
72 response code of 200 with an empty list is returned
74 * The search results can be asked to be returned in json or xml based
75 on the ACCEPT header. For 1504, the queries are expected to be used
76 by MSO and therefore will use an ACCEPT header of application/xml.
81 Search customer and service-subscription by service instance id
87 /aai/v16/search/generic-query?key=service-instance.service-instance-id:testserviceinstance&start-node-type=service-instance&include=customer&include=service-subscription&include=service-instance&depth=2
93 <search-results xmlns="http://com.att.aai.inventory/v16">
95 <resource-type>customer</resource-type>
96 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/globalexample/</resource-link>
99 <resource-type>service-subscription</resource-type>
100 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/globalexample/service-subscriptions/service-subscription/ptplgamma/</resource-link>
103 <resource-type>service-instance</resource-type>
104 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/globalexample/service-subscriptions/service-subscription/ptplgamma/service-instances/service-instance/arnoldave/</resource-link>
108 Search the VCE and its port groups and cvlan tags given the service instance id.
112 URL: /aai/v16/search/generic-query?key=service-instance.service-instance-id:arnoldave&start-node-type=service-instance&include=vce&include=port-group&include=cvlan-tag&depth=3
118 <search-results xmlns="http://org.onap.aai.inventory/v16">
120 <resource-type>cvlan-tag</resource-type>
121 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc2/cvlan-tags/cvlan-tag/333/</resource-link>
124 <resource-type>cvlan-tag</resource-type>
125 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc1/cvlan-tags/cvlan-tag/333/</resource-link>
128 <resource-type>cvlan-tag</resource-type>
129 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc1/cvlan-tags/cvlan-tag/111/</resource-link>
132 <resource-type>port-group</resource-type>
133 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc1/</resource-link>
136 <resource-type>vce</resource-type>
137 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/</resource-link>
140 <resource-type>cvlan-tag</resource-type>
141 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc2/cvlan-tags/cvlan-tag/222/</resource-link>
144 <resource-type>port-group</resource-type>
145 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc2/</resource-link>
149 Customer GET based on tenant id
155 /aai/v16/search/generic-query?key=tenant.tenant-id:examplepizzatenant&start-node-type=tenant&include=tenant&include=customer&include=service-subscription&depth=2
161 <search-results xmlns="http://org.onap.aai.inventory/v16">
163 <resource-type>customer</resource-type>
164 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/examplecustomer/</resource-link>
167 <resource-type>service-subscription</resource-type>
168 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/examplecustomer/service-subscriptions/service-subscription/ptplgamma/</resource-link>
171 <resource-type>tenant</resource-type>
172 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/tenants/tenant/exampletenant/</resource-link>
176 Search the tenant given a customer and service subscription.
182 /aai/v16/search/generic-query?key=customer.global-customer-id:example-customer&key=service-subscription.service-type:example-service-type&start-node-type=service-subscription&include=tenant&include=service-subscription&depth=1
188 <search-results xmlns="http://org.onap.aai.inventory/v16">
190 <resource-type>service-subscription</resource-type>
191 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/examplecustomer/service-subscriptions/service-subscription/ptplgamma/</resource-link>
194 <resource-type>tenant</resource-type>
195 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/tenants/tenant/examplepizzatenant/</resource-link>
199 For a service Instance - get its resource-link given the service-instance-id
205 /aai/v16/search/generic-query?key=service-instance.service-instance-id:exampleservice&start-node-type=service-instance&depth=0
211 <search-results xmlns="http://org.onap.aai.inventory/v6">
213 <resource-type>service-instance</resource-type>
214 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/examplecustomer/service-subscriptions/service-subscription/ptplgamma/service-instances/service-instance/arnoldave/</resource-link>
218 Get service-instance and service-subscription from vce
223 /aai/v16/search/generic-query?key=vce.vnf-id:examplevce&start-node-type=vce&include=service-instance&include=service-subscription&depth=2
229 <search-results xmlns="http://org.onap.aai.inventory/v16">
231 <resource-type>service-instance</resource-type>
232 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/examplecustomer/service-subscriptions/service-subscription/ptplgamma/service-instances/service-instance/arnoldave/</resource-link>
235 <resource-type>service-subscription</resource-type>
236 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/examplecustomer/service-subscriptions/service-subscription/ptplgamma/</resource-link>
240 Get all the nodes for a customer
246 /aai/v16/search/generic-query?key=customer.global-customer-id:examplecustomer&start-node-type=customer&include=all&depth=6
252 <search-results xmlns="http://org.onap.aai.inventory/v16">
254 <resource-type>service-capability</resource-type>
255 <resource-link>https://aai.onap:8443/aai/v16/service-design-and-creation/service-capabilities/service-capability/ptplgamma/ptplbrocade-vce/</resource-link>
258 <resource-type>vserver</resource-type>
259 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/tenants/tenant/examplepizzatenant/vservers/vserver/ccwvm1/</resource-link>
262 <resource-type>cvlan-tag</resource-type>
263 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc2/cvlan-tags/cvlan-tag/333/</resource-link>
266 <resource-type>oam-network</resource-type>
267 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/oam-networks/oam-network/examplentwk/</resource-link>
270 <resource-type>cvlan-tag</resource-type>
271 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc1/cvlan-tags/cvlan-tag/333/</resource-link>
274 <resource-type>dvs-switch</resource-type>
275 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/dvs-switches/dvs-switch/dvsswitch-id1/</resource-link>
278 <resource-type>cvlan-tag</resource-type>
279 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc1/cvlan-tags/cvlan-tag/111/</resource-link>
282 <resource-type>customer</resource-type>
283 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/globalexample/</resource-link>
286 <resource-type>service-subscription</resource-type>
287 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/globalexample/service-subscriptions/service-subscription/ptplgamma/</resource-link>
290 <resource-type>port-group</resource-type>
291 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc1/</resource-link>
294 <resource-type>tenant</resource-type>
295 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/tenants/tenant/examplepizzatenant/</resource-link>
298 <resource-type>service-instance</resource-type>
299 <resource-link>https://aai.onap:8443/aai/v16/business/customers/customer/globalexample/service-subscriptions/service-subscription/ptplgamma/service-instances/service-instance/arnoldave/</resource-link>
302 <resource-type>pserver</resource-type>
303 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/pservers/pserver/ptpnj101snd/</resource-link>
306 <resource-type>availability-zone</resource-type>
307 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/availability-zones/availability-zone/ptplaz1/</resource-link>
310 <resource-type>vce</resource-type>
311 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/</resource-link>
314 <resource-type>image</resource-type>
315 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/images/image/valueOfImageId/</resource-link>
318 <resource-type>cvlan-tag</resource-type>
319 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc2/cvlan-tags/cvlan-tag/222/</resource-link>
322 <resource-type>port-group</resource-type>
323 <resource-link>https://aai.onap:8443/aai/v16/network/vces/vce/examplevce/port-groups/port-group/exampleifc2/</resource-link>
326 <resource-type>ipaddress</resource-type>
327 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/tenants/tenant/examplepizzatenant/vservers/vserver/ccwvm1/ipaddresses/ipaddress/10.10.10.5/guid of port or interface/</resource-link>
330 <resource-type>flavor</resource-type>
331 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/flavors/flavor/valueOfFlavorId/</resource-link>
334 <resource-type>ipaddress</resource-type>
335 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/tenants/tenant/examplepizzatenant/vservers/vserver/ccwvm1/ipaddresses/ipaddress/10.10.10.4/guid of port or interface/</resource-link>
338 <resource-type>complex</resource-type>
339 <resource-link>https://aai.onap:8443/aai/v16/cloud-infrastructure/complexes/complex/PTPLNJ08742/</resource-link>