1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
14 Overview of A&AI Actor
15 ######################
16 ONAP Policy Framework enables various actors, several of which require additional
17 data to be gathered from A&AI via a REST call. Previously, the request was built,
18 and the REST call made, by the application. However, A&AI queries have now been
19 implemented using the new Actor framework.
21 Each operation supported by the actor is associated with its own java class, which is
22 responsible for populating the request structure and invoking the REST service. The
23 class hierarchy is shown below.
25 .. image:: classHierarchy.png
27 Currently, the following operations are supported:
33 One thing that sets the A&AI Actor implementation apart from the other Actor
34 implementations is that it is typically used to gather data for input to the
35 other actors. Consequently, when an A&AI operation completes, it places its
36 response into the *properties* field of the *context*, which is passed via the
37 *ControlLoopOperationParams*. The names of the keys within the *properties*
38 field are typically of the form, "AAI.<operation>.<targetEntity>", where
39 "operation" is the name of the operation, and "targetEntity" is the *targetEntity*
40 passed via the *ControlLoopOperationParams*. For example, the response for
41 the Tenant query for a target entity named "ozVserver" would be stored as a
42 *properties* named "AAI.Tenant.ozVserver".
44 On the other hand, as there is only one "custom query" for a given ONSET, the
45 *Custom Query* operation deviates from this, in that it always stores its response
46 using the key, "AAI.AaiCqResponse".
52 Most of the the A&AI operations use "GET" requests and thus do not populate
53 a request structure. However, for those that do, the request structure is
54 described in the table below.
56 Note: the Custom Query Operation requires tenant data, thus it performs a *Tenant*
57 operation before sending its request. The tenant data is gathered for the vserver
58 whose name is found in the "vserver.vserver-name" field of the enrichment data provided
59 by DCAE with the ONSET event.
61 +----------------------------------+---------+----------------------------------------------------------------------+
62 | Field Name | Type | Description |
63 +----------------------------------+---------+----------------------------------------------------------------------+
64 +----------------------------------+---------+----------------------------------------------------------------------+
66 +----------------------------------+---------+----------------------------------------------------------------------+
67 | *start* | string | Extracted from the *result-data[0].resource-link* field of the |
68 | | | Tenant query response. |
69 +----------------------------------+---------+----------------------------------------------------------------------+
75 Suppose the *ControlLoopOperationParams* were populated as follows, with the tenant
76 query having already been performed:
82 "operation": "CustomQuery",
85 "vserver.vserver-name": "Ete_vFWCLvFWSNK_7ba1fbde_0"
88 "AAI.Tenant.Ete_vFWCLvFWSNK_7ba1fbde_0": {
91 "resource-type": "vserver",
92 "resource-link": "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/3f2aaef74ecb4b19b35e26d0849fe9a2/vservers/vserver/6c3b3714-e36c-45af-9f16-7d3a73d99497"
100 An example of a Custom Query request constructed by the actor using the above
101 parameters, sent to the A&AI REST server:
106 "start": "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/3f2aaef74ecb4b19b35e26d0849fe9a2/vservers/vserver/6c3b3714-e36c-45af-9f16-7d3a73d99497",
107 "query": "query/closed-loop"
111 An example response received from the A&AI REST service:
119 "vserver-id": "f953c499-4b1e-426b-8c6d-e9e9f1fc730f",
120 "vserver-name": "Ete_vFWCLvFWSNK_7ba1fbde_0",
121 "vserver-name2": "Ete_vFWCLvFWSNK_7ba1fbde_0",
122 "prov-status": "ACTIVE",
123 "vserver-selflink": "http://10.12.25.2:8774/v2.1/41d6d38489bd40b09ea8a6b6b852dcbd/servers/f953c499-4b1e-426b-8c6d-e9e9f1fc730f",
125 "is-closed-loop-disabled": false,
130 Configuration of the A&AI Actor
131 ###############################
133 The following table specifies the fields that should be provided to configure the A&AI
136 =============================== ==================== ==================================================================
137 Field name type Description
138 =============================== ==================== ==================================================================
139 clientName string Name of the HTTP client to use to send the request to the
141 timeoutSec integer (optional) Maximum time, in seconds, to wait for a response to be received
142 from the REST server. Defaults to 90s.
143 path string URI appended to the URL. This field only applies to individual
144 operations; it does not apply at the actor level. Note: the
145 *path* should not include a leading or trailing slash.
146 =============================== ==================== ==================================================================
148 The individual operations are configured using these same field names. However, all
149 of them, except the *path*, are optional, as they inherit their values from the
150 corresponding actor-level fields.