Generating AAI API Docs

A&AI REST API Documentation

Generate the swagger like v8 to v11 spec via (thanks LiZi)

cd aai/aai-common/aai-core/
mvn -PgenerateXsd -DskipTests
mvn -PgenerateXsd install -DskipTests
mvn -PgenerateYaml install -DskipTests
mvn -PgenerateHtml install -DskipTests
cat ../aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v8.html 
cat ../aai-schema/src/main/resources/aai_swagger_html/aai_swagger_v11.html


The Active and Available Inventory (AAI or A&AI) has its own REST API. 

The AAI REST API provides access to the AAI active inventory graph.  The API is largely configured from models and configuration files.  Each vertex in the graph has an API that can be called separately or, if part of a tree structure, as a nested element with one or more generations (parent, grandparent, and so on).

The edges of the graph are provisioned using a relationship list construct.  For PUT methods, a relationship contains the vertex type or category (related-to) and a list of relationship data which captures the key pieces of data required to uniquely identify the resource.  On a GET method, the above information and a URL are returned.  The URL can be used to GET all the details of that object.  The URL returned is suitable for retrying failed commands but should not be expected to be cacheable for very long periods (e.g., the version of the URL may get deprecated when the release changes).

API Definition

The API structure is composed of:

Available HTTP commands are:

The HTTP URI is built according to this pattern:

https://{serverRoot}/{namespace}/{resource}

Example

GET https://{host-url}:8443/aai /v8/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}

Postman example

Logs

aaiadmin@vm1-aai:/opt/app/aai/logs$ pwd

/opt/app/aai/logs

aaiadmin@vm1-aai:/opt/app/aai/logs$ cat ajsc-jetty/localhost_access.log

from VID portal

10.0.8.1 VID VID [05/Jul/2017:02:48:03 +0000] "GET /aai/v8/business/customers" 500 0 REST

10.0.8.1 VID VID [05/Jul/2017:02:48:16 +0000] "GET /aai/v8/service-design-and-creation/services" 500 0 REST

from a browser

32.60.102.40 AAI AAI [05/Jul/2017:14:46:48 +0000] "GET /aai/v8/service-design-and-creation/services" 400 0 REST




References

The full definition of the API can be found here: AAI REST API document. The API documentation generated from the schema (OXM file) can be found here: AAI REST API Specifications. The XSD generated from the schema can be found here: AAI schema.