4 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
5 .. http://creativecommons.org/licenses/by/4.0
7 \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
13 This page will serve as a reference for how to use the A&AI bulk API's available in 1810+.
18 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. v14) dictates which release's REST API version the output will be based on.
20 Single transaction API
21 ======================
23 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.
31 POST /aai/v$/bulk/single-transaction
35 "operations": [ //array of operations for this transaction
37 "action": "", //aai action to be taken, i.e put, patch, delete
38 "uri": "", //aai uri to execute action against
39 "body": {} //json object which is the body of the equivalent REST request
50 "operation-responses": [ //result of each of the request operations
52 "action": "", //aai action that was taken
53 "uri": "", //aai uri that was executed against
54 "response-status-code": , //http status code
55 "response-body": null // response body of the of the equivalent REST request
60 Request-Response Examples
61 =========================
74 "fqdn": "pserver-key-fqdn",
75 "hostname": "pserver-1-key"
77 "uri": "/cloud-infrastructure/pservers/pserver/pserver-1-key"
82 "fqdn": "patched-fqdn"
84 "uri": "/cloud-infrastructure/pservers/pserver/pserver-1-key"
89 "fqdn": "pserver-key-fqdn",
90 "hostname": "pserver-2-key"
92 "uri": "/cloud-infrastructure/pservers/pserver/pserver-2-key"
102 "operation-responses": [
105 "response-body": null,
106 "response-status-code": 201,
107 "uri": "/cloud-infrastructure/pservers/pserver/pserver-1-key"
111 "response-body": null,
112 "response-status-code": 200,
113 "uri": "/cloud-infrastructure/pservers/pserver/pserver-1-key"
117 "response-body": null,
118 "response-status-code": 201,
119 "uri": "/cloud-infrastructure/pservers/pserver/pserver-2-key"
124 Example - 2 (Success)
125 =====================
136 "fqdn": "pserver-key-fqdn",
137 "hostname": "pserver-key"
139 "uri": "/cloud-infrastructure/pservers/pserver/pserver-key"
146 "data-center-code": "code",
147 "identity-url": "N/A",
148 "physical-location-id": "complex-key",
149 "physical-location-type": "type",
150 "postal-code": "12345",
155 "uri": "/cloud-infrastructure/complexes/complex/complex-key"
160 "related-link": "/aai/v13/cloud-infrastructure/pservers/pserver/pserver-key",
161 "related-to": "pserver"
163 "uri": "/cloud-infrastructure/complexes/complex/complex-key/relationship-list/relationship"
168 "uri": "/network/generic-vnfs/generic-vnf/gvnf-key?resource-version=0"
179 "operation-responses": [
182 "response-body": null,
183 "response-status-code": 201,
184 "uri": "/cloud-infrastructure/pservers/pserver/pserver-key"
188 "response-body": null,
189 "response-status-code": 201,
190 "uri": "/cloud-infrastructure/complexes/complex/complex-key"
194 "response-body": null,
195 "response-status-code": 200,
196 "uri": "/cloud-infrastructure/complexes/complex/complex-key/relationship-list/relationship"
200 "response-body": null,
201 "response-status-code": 204,
202 "uri": "/network/generic-vnfs/generic-vnf/gvnf-key?resource-version=0"
207 Example - 3 (Failure on mismatched resource version on delete)
208 ==============================================================
219 "fqdn": "pserver-key-fqdn",
220 "hostname": "pserver-key"
222 "uri": "/cloud-infrastructure/pservers/pserver/pserver-key"
229 "data-center-code": "code",
230 "identity-url": "N/A",
231 "physical-location-id": "complex-key",
232 "physical-location-type": "type",
233 "postal-code": "12345",
238 "uri": "/cloud-infrastructure/complexes/complex/complex-key"
243 "related-link": "/aai/v13/cloud-infrastructure/pservers/pserver/pserver-key",
244 "related-to": "pserver"
246 "uri": "/cloud-infrastructure/complexes/complex/complex-key/relationship-list/relationship"
251 "uri": "/network/generic-vnfs/generic-vnf/gvnf-key?resource-version=1"
263 "serviceException": {
264 "messageId": "SVC3000",
265 "text": "Invalid input performing %1 on %2 (msg=%3) (ec=%4)",
268 "/aai/v14/bulk-single-transaction-multi-operation",
269 "Invalid input performing %1 on %2:Operation 3 failed with status code (412) and msg ({\"requestError\":{\"serviceException\":{\"messageId\":\"SVC3000\",\"text\":\"Invalid input performing %1 on %2 (msg=%3) (ec=%4)\",\"variables\":[\"DELETE\",\"/network/generic-vnfs/generic-vnf/gvnf-key\",\"Precondition Failed:resource-version MISMATCH for delete of generic-vnf\",\"ERR.5.4.6131\"]}}})",