4 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
5 .. http://creativecommons.org/licenses/by/4.0
7 \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
15 The AAI REST API provides access to the AAI active inventory graph. The
16 API is largely configured off of models and configuration files. Each
17 vertex in the graph has an API that can be called separately or, if part
18 of a tree structure, as a nested element with one or more generations
19 (parent, grandparent, etc.).
21 The edges of the graph are provisioned using a relationship list
22 construct. For PUT methods, a relationship contains the vertex type or
23 category (related-to) and a list of relationship data which captures the
24 key pieces of data required to uniquely identify the resource. On a GET
25 method, the above information and a URL are returned. The URL can be
26 used to GET all the details of that object. The URL returned is suitable
27 for retrying failed commands but should not be expected to be cacheable
28 for very long periods (e.g., the version of the URL may get deprecated
29 when the release changes).
31 Concurrency control for AAI is in place. The assumptions made for the
32 implementation are as follows:
34 - A client always gets a resource before updating through PUT or
37 - All resource updates and deletions are done via the AAI REST APIs
39 - This solution will apply to PUT and DELETE operations.
41 - The resource-version attribute is now in every container
43 - The update API is not subject to concurrency control because it is
44 only intended to be used by clients who are the definitive source of
45 truth for the attributes they are changing. An update through the
46 update API will however reset the resource-version so clients using
47 PUT and DELETE will not risk updating with stale data.
49 - The PATCH REST verb is not subject to concurrency control because it
50 is only intended to be used by clients who are the definitive source
51 of truth for the attributes they are changing. An update through the
52 update API will however reset the resource-version so clients using
53 PUT and DELETE will not risk updating with stale data.
55 How to Use this Document
56 ========================
58 When you click on the API documentation, you will see the Summary of
59 APIs broken down by namespace (e.g., cloud-infrastructure, business,
60 network, service-design-and-creation). You can search for **Tag:**
61 (matching the explicit case) to move from namespace to namespace through
64 Search for **Paths** to skip past the Summary section where there will
65 be more detail about each API. Query parameters are provided here, as
66 well as links to our error codes.
68 Search for **Schema definitions** to see the definitions of the
69 payloads. In your browser URL, you can type /#/definitions/node-name at
70 the end of the html address to skip directly to a payload definition.
72 Note that the schema definitions now contain information about the
73 delete scope of a node (also referenced in this document) and some
74 related node information (also reference in this document as Edges).
76 Once AAI has a model and configured it, the AAI development server can
77 be used to generate sample XML and JSON payloads, according to the
78 Accept header passed in the request. This is done by calling the
79 "plural" version of an API followed by the word example (e.g.,
80 /vserver/vservers/example). This returns a GET result array with one
81 entry. That single entry can be sent in a PUT request with actual data
82 (the resource-id does not need to be in the PUT payload as it is on the
88 Information that is largely guidance or aspirational will be show in
89 gray italicized text. This information should not be relied upon or
90 referenced at this point except with the understanding that it WILL
93 **Bold blue text** will be used to cover communication to our clients
94 that may not be enforced by AAI. The sources of truth (our clients)
95 populate AAI and are expected to send the correct information, having
96 applied business rules that live in the client systems.
98 Deprecation Warnings and History
99 ================================
105 - The actions/update API will be retired. Clients must switch to PATCH.
106 There is one grandfathered usage for vpe update flows which will be
109 - The edge tag query will be retired.
111 Notable attribute and/or valid value changes (generally also impacts
114 - The persona-model-id and persona-version will be replaced with
115 model-invariant-id (same value as persona-model-id) and
116 model-version-id (the UUID of the specific version of a model).
117 Persona-model-customization-id will be replaced by
118 model-customization-id.
120 - The operational-state attribute will be replaced by
121 operational-status and the only valid values will be in-service-path
122 and out-of-service-path
124 - The vpn-binding object will be split in two to reflect more than one
125 route-target per binding. The route-target will be a child of
126 vpn-binding and some attributes will move from vpn-binding to
129 - The following license related attributes will be removed from
130 generic-vnf: license-key, entitlement-assignment-group-uuid,
131 entitlement-resource-uuid, license-assignment-group-uuid, and
132 license-key-uuid due to the introduction of the entitlement and
137 - Normal impacts due to renaming or adding attributes, splitting
138 objects, etc. Please see swagger documentation for objects of
141 - In v11, clients that require lineage, children, or relationship
142 information need to subscribe to a different DMaaP topic than the
147 - The related-link will be a URI and thus not contain
148 https://{serverroot} (impacts events)
150 - Thhe related-link will be used on a PUT as the "first choice" to
151 identify the related resource. The relationship-data structure, which
152 contains the unordered set of keys, is still an acceptable way to
153 relate two objects but, *if both the relationship-data and the
154 related-link are passed, and they don't agree, the related-link will
155 be used without warning that the data is inconsistent*.
157 - The relationship-data will be ignored on PUT.
162 The API structure is composed of:
164 - The HTTP command, which indicates the operation to perform
166 - The HTTP URI, which defines what object this operation is related to
168 - The HTTP version, which MUST be 1.1
170 Available HTTP commands are:
172 - PUT: used to create or update an object
174 - DELETE: used to delete an object or a set of objects
176 - GET : used to query an object or set of objects
178 - PATCH : used to update specific fields owned by the client doing the
181 The HTTP URI is built according to this pattern:
183 https://{serverRoot}/{namespace}/{resource}
185 - (serverRoot} refers to the server base url: hostname+port+base
186 path+version. Port and base path are OPTIONAL but AAI will use port
187 8443 and base path aai. The Amsterdam release version will be v11.
189 - {namespace} refers to the API namespace. Supported namespaces are
190 cloud-infrastructure, business, service-design-and-creation, and
193 - {resource} refers to how the object is identified according to the
194 namespace specifications.
198 GET https://{hostname}:8443/aai
199 /v11/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}
201 The GET requests support a depth query parameter allowing a query to
202 stop after it has reached a certain point in the graph. This allows
203 clients to minimize the data that is returned to them. A depth=0 returns
204 the resource itself and none of its children.
209 Given AAI is largely a correlation engine among disparate inventory
210 types, AAI will accept values as they are sent, without validating the
211 format or value of the input. It is incumbent upon the source of truth
212 to provide valid information to AAI.
214 Clients should do a GET prior to a PUT and change only the data that
215 they mean to affect. The REST APIs expect the payload passed to replace
216 the resource in AAI. **This is vital in our concurrency scheme. The
217 client will be returned an opaque value per entity which needs to be
218 returned back in the PUT. AAI will reject the PUT or DELETE if the
219 opaque value doesn't match what AAI has stored for that entity.**
221 If a leaf has been added to a model in vN+1, and a GET/PUT of a vN
222 resource is done, AAI should not affect the new leaf (i.e., it should be
228 The PUT verb is used to both create and replace a resource. A given
229 resource may have child resources (e.g., customers have service
230 subscriptions; tenants have vservers and vservers have volumes).
232 The following convention will be followed:
234 If a resource is replaced and there are no tags for children, the
235 children that exist will be left alone.
237 If a resource is replaced and there are tags for children, the children
238 will be replaced by the list passed. If the list is empty, then children
241 Note that the relationship list is a type of child resource. The same
242 conventions are followed. It is especially critical to ensure that you
243 do not send an incomplete relationship list and therefore remove edges
244 in the graph. See section 5.10 for more information on relationship
250 To move towards industry standards and to make our APIs easier to use by
251 clients who own specific attributes and do not require AAI to enforce
252 concurrency control around them, the PATCH verb has been introduced.
254 - RFC Algorithm implemented JSON Merge PATCH
255 `tools.ietf.org/html/rfc7386 <https://tools.ietf.org/html/rfc7386>`__
257 - *HTTP Verb = PATCH*
259 - PATCH requires a Content-Type of "application/merge-patch+json" in
262 - PATCH does not support XML
264 - PATCH does not require a resource version to preform these
267 - Clients should only send what they wish to modify and whose value
272 PATCHÂ \ `https://<hostname>:8443/aai/v11/network/generic-vnfs/generic-vnf/cscf0001v <https://aai-int1.test.att.com:8443/aai/v7/network/generic-vnfs/generic-vnf/cscf0001v>`__
276 Â Â Â Â Â "vnf-id": "cscf0001v", This key needs to be here but you cannot
279 Â Â Â Â Â "regional-resource-zone": null,
281 Â Â Â Â Â "ipv4-oam-address": "1.2.3.4"Â Â Â
285 This payload would result in the generic-vnf with the vnf-id = cscf0001v
286 having ipv4-oam-address set to "1.2.3.4" and regional-resource-zone
287 having its value removed from the database.
289 Referential Integrity
290 ---------------------
292 AAI is primarily a view to the relationships between customers,
293 products, services, physical and virtual components, etc. It stores just
294 the details it needs to be efficient to its tasks and knows how to get
295 more details if needed.
297 As such, a transaction sent to AAI may be refused if would break
298 referential integrity. The referential integrity rules of AAI are still
299 evolving as we understand the services and customers that will use us.
301 AAI uses a graph database on a NoSQL data store. The following are true
304 - Some vertices are exposed to the outside world through APIs, others
305 are internal to how we store the data (i.e., it may look like one
306 resource to our customers but it is expressed as more than one vertex
309 - Vertices that are internal to AAI will be deleted when the parent
310 vertex is deleted, if deletion of the parent leaves the child vertex
313 - Vertices that are exposed need to be managed using specific rules for
316 - Vertices may have more than just parent/child relationships. One
317 example is a vserver, which will be owned by a tenant and used by a
323 The following options are available as actions to be take upon deletion
326 - ERROR\_IF\_ANY\_EDGES – If the resource being deleted has any edges
327 at all, an error should be returned
329 - ERROR\_IF\_ANY\_IN\_EDGES – if the resource being deleted has any
330 edges that point IN towards it, an error should be returned
332 - THIS\_NODE\_ONLY – delete the vertex being requested by first
333 deleting its edge to other vertices, but do not delete the other
334 vertices. Note, the delete will be rejected if the deletion target
335 has DEPENDENT children (e.g., tenants that have vservers)
337 - CASCADE\_TO\_CHILDREN – cascade the delete through vertices who have
338 a parentOf relationship to the vertex being deleted, as long as the
339 vertex is orphaned by the delete of its parent
341 - ERROR\_4\_IN\_EDGES\_OR\_CASCADE – error if there are any in edges
342 and, if not, cascade to children
347 All REST APIs must be called using https.
349 The current release is configured to support BasicAuth. 2-way SSL using
350 client certificates should be configured for production deployments or
356 The following will be used for logging and interface diagnostic
359 - X-FromAppId Unique Application ID assigned to the user of these APIs
361 - X-TransactionId Unique ID that identifies an API request
363 The X-FromAppId will be assigned to each application by the AAI team.
364 The X-TransactionId must be unique to each transaction within the
365 context of an X-FromAppId.
367 OpenECOMP components that call AAI use the Java UUID class to generate
368 unique ids for X-TransactionId.
370 The Accept header should be set to either application/json or
373 +-------------------------------+---------------+
374 | Client | X-FromAppId |
375 +===============================+===============+
377 +-------------------------------+---------------+
378 | Master Service Orchestrator | MSO |
379 +-------------------------------+---------------+
380 | SDN Controller | SDNC |
381 +-------------------------------+---------------+
382 | Application Controller | APPC |
383 +-------------------------------+---------------+
385 Response Codes and Error Handling
386 ---------------------------------
388 HTTP response codes and error codes are described in the API
391 URLs Sent To and Retrieved From AAI
392 -----------------------------------
394 AAI receives URLs from clients that point back to that client in order
395 to get more details about the data sent to AAI. AAI expects the URLs
396 sent by clients (e.g., self links) to be URL encoded (UTF-8) and AAI
397 will store them unchanged.
399 URLs that AAI constructs that point to AAI resources will be returned
400 URLEncoded (UTF-8) to clients. This affects URLs in relationship lists
403 AAI expects space to be %20, and not plus(+).
405 The Relationship-List
406 ---------------------
408 The REST interface does not lend itself to creating more than
409 parent-child relationships and the backend structure of AAI is a graph.
410 A goal of AAI is to do as little coding as possible to introduce a new
411 service into the service design and creation environment.
413 To that end, we've introduced a relationship-list structure. AAI will
414 ask its clients to provide certain data in the relationship-list
417 Each relationship has a related-to attribute and a list of key/value
418 pairs. The related-to attribute identifies the node type that the
419 resource being acted on is to be related to using the data in the
420 key/value pairs. AAI will encode a set of rules for each resource type
421 to verify that only valid edges are being made. AAI will keep the name
422 of the edge itself, the directionality and cardinality, and the edge
423 attributes within its own logic.
425 If an attempt is made to add a relationship to a node that doesn't exist
426 (e.g., from a vserver to a vnf, and the vnf doesn't exist), a unique
427 message Id (3003) will be returned with a specific error code
428 (ERR.5.4.6129). Arguments will tell the client which node type was
429 missing (e.g., generic-vnf) and the key data for that node type
430 (generic-vnf.vnf-id).
432 Single relationships can be PUT to the graph in the following way:
436 https://{serverRoot}/{namespace}/{resource}/relationship-list/relationship
442 https://{hostname}:8443/aai/v11/cloud-infrastructure/pservers/pserver/pserver-123456789-01/p-interfaces/p-interface/p-interface-name-123456789-01/l-interfaces/l-interface/l-interface-name-123456789-01/relationship-list/relationship
444 with a payload containing the relationship information in XML
448 <relationship xmlns="http://org.openecomp.aai.inventory/v11">
449 <related-to>logical-link</related-to>
451 <relationship-key>logical-link.link-name</relationship-key>
452 <relationship-value>logical-link-123456789-01</relationship-value>
461 "related-to": "logical-link",
462 "relationship-data": [
464 "relationship-key": "logical-link.link-name",
465 "relationship-value": " logical-link-123456789-01"
473 The following are the properties used for edge definitions. T is true, F
476 - From and To are the node types for the ends of the edges.
478 - EdgeLabel is the name of the label within the graph.
480 - Direction shows the direction of the edge.
482 - Multiplicity shows the multiplicity rule between two nodes. This
483 helps govern what AAI does when modifying relationships between edges
484 using the relationship REST APIs
486 - ParentOf indicates whether From is a parent of To.
488 - UsesResource specifies whether the From node uses resources of the To
489 node, to be able to view the data in the context of "what uses what".
491 - hasDelTarget specifies whether to try to delete the To node when the
492 From node is deleted.
494 - SVC-INFRA (deprecated)
496 The configuration for different edges supported by the AAI model are
497 defined in the DbEdgeRules.java class.
502 AAI supports query parameters on its indexed attributes.
504 As an example, if you wanted to GET a tenant by tenant-name, you would
507 /aai/vX/cloud-infrastructure/cloud-regions/cloud-region/cloud\_owner\_1/cloud-region\_1/tenants/tenant?tenant-name=value
509 The properties that are indexed are defined in the aai-schema.
517 The util domain is where AAI locates utility functions. There is
518 currently one utility function, echo, which serves as a ping test that
519 authenticated authorized clients can call to ensure there is
520 connectivity with AAI.
522 The URL for the echo utility is:
526 https://load-balanced-address:8443/aai/util/echo
528 If the response is unsuccessful, an error will be returned following the
531 The successful payload returns the X-FromAppId and X-TransactionId sent
534 Successful XML Response Payload
535 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
542 <messageId>INF0001</messageId>
543 <text>Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)</text>
545 <variable>XYZ</variable>
546 <variable>XYZ123</variable>
547 <variable>Successful health check:OK</variable>
548 <variable>0.0.0002</variable>
554 Successful JSON Response Payload
555 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
559 {"responseMessages": {"responseMessage": [{
560 "messageId": "INF0001",
561 "text": "Success X-FromAppId=%1 X-TransactionId=%2 (msg=%3) (rc=%4)",
562 "variables": {"variable": [
565 "Successful health check:OK",
570 Cloud Infrastructure Domain
571 ---------------------------
573 The Cloud Infrastructure domain (cloud-infrastructure) represents the
574 assets managed within a cloud infrastructure site. This includes the
575 physical servers, tenants, vservers and cloud-region.
580 The network namespace contains virtual and physical network resources as
581 well as connection resources such as physical links, logical links, etc.
586 The business namespace captures customers, service subscriptions, and
587 service instances. This domain is immature and will be evolving as
588 service design and creation starts to gel.
590 Service Design and Creation
591 ---------------------------
593 The service design and creation namespace captures data we invented
594 based on what we thought SDC would eventually provide.
596 To date, there are only five containers:
598 1. Service-capabilities capture the pairings of service to resources.
600 2. Service captures the service model instances and this will be
601 deprecated in the future as things mature
603 3. Models captures model definitions (subgraph definitions using the AAI
606 4. named-queries capture subgraph definitions that allow different data
607 to be retrieved for a given type of asset