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 |
---|
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) RequestResponse |
---|
Example - 2 (Success) RequestResponse |
---|
Example - 3 (Failure on mismatched resource version on delete) RequestResponse |
---|
Multi transaction API
Pending implementation