AAI Bulk APIs (Current)

This page will serve as a reference for how to use the A&AI new bulk API's.

Bulk Overview

To execute any of the bulk api's, a client will perform a POST on the specific bulk api and include a payload indicating the nodes to be added/updated/deleted.The version (v$ ie. v15) dictates which release's REST API version the output will be based on.

Single transaction API

API takes in transaction object which consists of an array of operations, the operations are executed against A&AI in a single transaction. All operations must succeed for the actions to be committed. If any of the operations fail these changes will be rolled back.

URI

POST /aai/v$/bulk/single-transaction

POST /aai/v$/bulk/single-transaction

Payload

Skeleton
{ "operations": [ //array of operations for this transaction { "action": "", //aai action to be taken, i.e put, patch, delete "uri": "", //aai uri to execute action against "body": {} //json object which is the body of the equivalent REST request } ] }

Response

Skeleton
{ "operation-responses": [ //result of each of the request operations { "action": "", //aai action that was taken "uri": "", //aai uri that was executed against "response-status-code": , //http status code "response-body": null // response body of the of the equivalent REST request } ] }

Request-Response Examples

Example - 1 (Success)

Request
{ "operations": [{ "action": "put", "uri": "/cloud-infrastructure/pservers/pserver/pserver-1-key", "body": { "hostname": "pserver-1-key", "fqdn": "pserver-key-fqdn" } }, { "action": "patch", "uri": "/cloud-infrastructure/pservers/pserver/pserver-1-key", "body": { "fqdn": "patched-fqdn" } }, { "action": "put", "uri": "/cloud-infrastructure/pservers/pserver/pserver-2-key", "body": { "hostname": "pserver-2-key", "fqdn": "pserver-key-fqdn" } } ] }



Response



Example - 1 (Success)

Request



Response





Example - 2 (Success)

Request



Response



Example - 2 (Success)

Request



Response





Example - 3 (Failure on mismatched resource version on delete)

Request



Response



Example - 3 (Failure on mismatched resource version on delete)

Request



Response



Multi transaction API

Pending implementation