4 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
5 .. http://creativecommons.org/licenses/by/4.0
10 A&AI Nodes Query Implementation Notes:
15 AAI continues to support this API, but clients may find that `Custom
16 Queries <customQueries.html>`_ meet the needs more most queries.
18 The Nodes Query mechanism is mostly being implemented in support of
19 searching the pservers which do not have the ipv4-oam-ipaddress
20 set. It will allow nodes to be searched based on certain properties of
21 the nodes. It will allow search based on properties being set, not set
22 or set to specific values.
24 The Nodes Query API is implemented using the GET method with the following URL:
28 /aai/<version>/search/nodes-query
30 ex. /aai/v16/search/nodes-query
32 New version numbers will be supported and older versions eventually
33 retired. Please look for other AAI documentation for what version to
34 use in which environment/release.
36 The URL expects the following URL parameters:
38 **search-node-type** - node type of the node to be searched.
40 **filter** – list of properties that specify the search
41 criterion. Format will be
45 filter=<property-name>:<EQUALS|DOES-NOT-EQUAL|EXISTS|DOES-NOT-EXIST>:<property-value>
49 filter=ipv4-oam-address:DOES-NOT-EXIST:
51 For EXISTS and DOES-NOT-EXIST the property value is not specified
52 (second colon is included). Multiple filter criteria may be specified.
54 The queries return a search-results object back which includes a list
55 of result-data which contains the node-type and a link for each
56 resource that was found.
62 * If the search-node-type is not supported by the application, a HTTP
63 response code of 400 and Parameter passed error is returned
65 * If no nodes can be found that meet the search criteria a HTTP
66 response code of 200 with an empty list is returned
68 * The search results can be asked to be returned in json or xml based
71 * If no filter params are specified, it would return all nodes of that node type.
76 * REST GET api and dbmap classes added to process the search payload via a GET
78 * New method searchForNodes() created in dbgen:DbSearch that does the
79 search based on the node type and the filter list and returns the
82 - The search does not require the properties used in the search to
85 - The filterParams will just be properties of the node itself. A
86 future version could have another parameter with some more
87 interesting search stuff – we’ll see what other queries are being
88 asked for and what makes sense to treat like this.
90 - As other requests come in, this query mechanism may be re-used if
91 the requirements are able to fit this.
96 * Search pserver nodes for which ipv4-oam-address DOES-NOT-EXIST
101 /aai/v4/search/nodes-query?search-node-type=pserver&filter=ipv4-oam-address:DOES-NOT-EXIST:
107 <search-results xmlns="http://org.onap.aai.inventory/v16">
109 <resource-type>pserver</resource-type>
110 <resource-link>https://aai.onap:8443/aai/v4/cloud-infrastructure/pservers/pserver/mygreatpserver</resource-link>
113 <resource-type>pserver</resource-type>
114 <resource-link>https://aai.onap:8443/aai/v4/cloud-infrastructure/pservers/pserver/myothergreatpserver/</resource-link>
117 <resource-type>pserver</resource-type>
118 <resource-link>https://aai.onap:8443/aai/v4/cloud-infrastructure/pservers/pserver/stillanothergreatpserver</resource-link>
121 <resource-type>pserver</resource-type>
122 <resource-link>https://aai.onap:8443/aai/v4/cloud-infrastructure/pservers/pserver/testbestestpserver</resource-link>