Added v12 swagger with bulk add api's
[aai/aai-common.git] / aai-schema / src / main / resources / aai_swagger_yaml / aai_swagger_bulk_v12.yaml
1 swagger: "2.0"
2 info:
3   description: |
4     Copyright © 2017 AT&T Intellectual Property. All rights reserved.
5
6     Licensed under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License.
7
8     You may obtain a copy of the License at
9
10     (https://creativecommons.org/licenses/by/4.0/)
11
12     Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
13
14     ECOMP and OpenECOMP are trademarks and service marks of AT&T Intellectual Property.
15
16     This document is best viewed with Firefox or Chrome. Nodes can be found by appending /#/definitions/node-type-to-find to the path to this document. Edge definitions can be found with the node definitions.
17   version: "v12"
18   title: Active and Available Inventory Bulk REST APIs
19   license:
20     name: Apache 2.0
21     url: http://www.apache.org/licenses/LICENSE-2.0.html
22   contact:
23     name:
24     url:
25     email:
26 host:
27 basePath: /aai/v12
28 schemes:
29   - https
30 paths:
31   /bulkadd:
32     put:
33       tags:
34         - BulkAdd
35       summary: Bulk add interface for multiple PUT operations in a single call with potentially multiple transactions
36       operationId: bulkAdd
37       consumes:
38         - application/json
39         - application/xml
40       produces:
41         - application/json
42         - application/xml
43       responses:
44         "default":
45           description: Response codes found in [response codes](https://wiki.web.att.com/display/UAAI/Alarm+Log).
46         "all success":
47           description: Below is the response for three sucessful transactions, each operation performed gets a status code
48           schema:
49             example:
50               transaction:
51                 - put:
52                     - uri: /network/pnfs/pnf/CGCIL21CRS-wr148d
53                       body:
54                         '201': null
55                 - put:
56                     - uri: /network/pnfs/pnf/CHCGILCLW6013000707--wr148d
57                       body:
58                         '201': null
59                 - put:
60                     - uri: /network/pnfs/pnf/CGCIL21CRS-wr148d/p-interfaces/p-interface/0-04-0-0-wr148d
61                       body:
62                         '201': null
63                     - uri: /network/pnfs/pnf/CHCGILCLW6013000707--wr148d/p-interfaces/p-interface/9-2-7-1-wr148d
64                       body:
65                         '201': null
66                     - uri: /network/pnfs/pnf/CHCGILCLW6013000707--wr148d/p-interfaces/p-interface/02-03-01-wr148d
67                       body:
68                         '201': null
69                     - uri: /network/logical-links/logical-link/3001-S100EL-CHCGILCL08WCHCGILCLW60-wr148d
70                       body:
71                         '201': null
72         "failures":
73           description: Below is the response for a single put transaction with two operations that failed, each operation gets its own status code and error message
74           schema:
75             example:
76               transaction:
77                 - put:
78                     - uri: /network/pnfs/pnf/CGCIL21CRS
79                       body:
80                         '412': '{"requestError":{"serviceException":{"messageId":"SVC3000","text":"Invalid input performing %1 on %2 (msg=%3) (ec=%4)","variables":["PUT","/network/pnfs/pnf/CGCIL21CRS","Precondition Required:resource-version not passed for update of /network/pnfs/pnf/CGCIL21CRS","ERR.5.4.6130"]}}}'
81                     - uri: /network/pnfs/pnf/CHCGILCLW6013000707-
82                       body:
83                         '412': '{"requestError":{"serviceException":{"messageId":"SVC3000","text":"Invalid input performing %1 on %2 (msg=%3) (ec=%4)","variables":["PUT","/network/pnfs/pnf/CHCGILCLW6013000707-","Precondition Required:resource-version not passed for update of /network/pnfs/pnf/CHCGILCLW6013000707-","ERR.5.4.6130"]}}}'
84
85         "limit exceeded":
86           description: Below is the response for when too many operations were attempted according to our limit
87           schema:
88               example:
89                 requestError:
90                   serviceException:
91                     messageId: SVC3000
92                     text: Invalid input performing %1 on %2 (msg=%3) (ec=%4)
93                     variables:
94                       - PUT
95                       - v11/bulkadd
96                       - 'Payload Limit Reached, reduce payload:Payload limit of 30 reached, please reduce payload.'
97                       - ERR.5.4.6147
98       parameters:
99         - name: transactions
100           in: body
101           description: an array of multiple "put" operations that include the associated A&AI URI for the put operation and corresponding body payload. Multiple PUT operations can be done within a single transaction or can be split into multiple transactions. A transaction's changes will not be committed to the database unless all operations within a single transaction succeed. Each transaction must include a "put" array including at least one set of "uri" and "body" parameters. The "uri" parameter designates the endpoint of the A&AI (C)RUD operation that will add the node/relationship, the "body" designates the payload that URI accepts to do so.
102           required: true
103           schema:
104             type: array
105             items:
106             example:
107               transactions:
108                 - put:
109                   - uri: "/network/pnfs/pnf/CGCIL21CRS"
110                     body:
111                      pnf-name: "CGCIL21CRS"
112                      pnf-name2: "CHCGILCL08W13010309-"
113                      equip-model: "CISCO_CRS1_C"
114                      frame-id: "130103.09"
115                      equip-type: "router"
116                   - uri: "/network/pnfs/pnf/CHCGILCLW6013000707-"
117                     body:
118                         pnf-name: "CHCGILCLW6013000707-"
119                         equip-model: "NSN_HIT7300_ROADM_C"
120                         frame-id: "130007.07"
121                         equip-type: "roadm"
122                 - put:
123                   - uri: "/cloud-infrastructure/pservers/pserver/pserver-9876543210-111-wr148d"
124                     body:
125                       hostname: "pserver-9876543210-111-wr148d"
126                       fqdn: "pserver-9876543210-111-wr148d-fqdn"
127                   - uri: "/cloud-infrastructure/pservers/pserver/pserver-9876543210-112-wr148d"
128                     body:
129                      hostname: "pserver-9876543210-112-wr148d"
130                      fqdn: "pserver-9876543210-112-wr148d-fqdn"
131   /bulkprocess:
132     put:
133       tags:
134         - BulkProcess
135       summary: Bulk process interface for multiple PUT, PATCH, and DELETE operations in a single call with potentially multiple transactions ( you cannot delete a node put or patched in the same request )
136       operationId: bulkProcess
137       consumes:
138         - application/json
139         - application/xml
140       produces:
141         - application/json
142         - application/xml
143       responses:
144         "default":
145           description: Response codes found in [response codes](https://wiki.web.att.com/display/UAAI/Alarm+Log).
146         "all success":
147           description: Below is the response for three different transactions, a put transaction that had two operations within it, a patch transaction with two operations in it, and a delete transaction with two operations within it, all of these operation were successfully completed, each operation get a status code
148           schema:
149             example:
150               transaction:
151                 - put:
152                     - uri: /cloud-infrastructure/pservers/pserver/pserver5
153                       body:
154                         '201': null
155                     - uri: /cloud-infrastructure/pservers/pserver/pserver6
156                       body:
157                         '201': null
158                 - patch:
159                     - uri: /cloud-infrastructure/pservers/pserver/pserver6
160                       body:
161                         '200': null
162                     - uri: /cloud-infrastructure/pservers/pserver/pserver5
163                       body:
164                         '200': null
165                 - delete:
166                     - uri: /cloud-infrastructure/pservers/pserver/pserver3
167                       body:
168                         '204': null
169                     - uri: /cloud-infrastructure/pservers/pserver/pserver4
170                       body:
171                         '204': null
172         "failures":
173           description: Below is the response for a three different transactions, a put transaction that failed because the nodes were already there and no resource version was passed, patch succeeded for the two operations, delete failed as the nodes were already deleted so they couldn't be found. Each operation gets its own status code.
174           schema:
175             example:
176               transaction:
177                 - put:
178                     - uri: /cloud-infrastructure/pservers/pserver/pserver5
179                       body:
180                         '412': '{"requestError":{"serviceException":{"messageId":"SVC3000","text":"Invalid inputperforming %1 on %2 (msg=%3) (ec=%4)","variables":["PUT","/cloud-infrastructure/pserver/pserver/pserver5","Precondition Required:resource-version not passed for update of/cloud-infrastructure/pservers/pserver/pserver5","ERR.5.4.6130"]}}}'
181                     - uri: /cloud-infrastructure/pservers/pserver/pserver6
182                       body:
183                         '412': '{"requestError":{"serviceException":{"messageId":"SVC3000","text":"Invalid inputperforming %1 on %2 (msg=%3) (ec=%4)","variables":["PUT","/cloud-infrastructure/pserver/pserver/pserver6","Precondition Required:resource-version not passed for update of/cloud-infrastructure/pservers/pserver/pserver6","ERR.5.4.6130"]}}}'
184                 - patch:
185                     - uri: /cloud-infrastructure/pservers/pserver/pserver6
186                       body:
187                         '200': null
188                     - uri: /cloud-infrastructure/pservers/pserver/pserver5
189                       body:
190                         '200': null
191                 - delete:
192                     - uri: /cloud-infrastructure/pservers/pserver/pserver3
193                       body:
194                         '404': '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource notfound for %1 using id %2 (msg=%3) (ec=%4)","variables":["DELETE","/cloud-infrastructur/pservers/pserver/pserver3","Node Not Found:No Node of type pserver found at: /clou-infrastructure/pservers/pserver/pserver3","ERR.5.4.6114"]}}}'
195                     - uri: /cloud-infrastructure/pservers/pserver/pserver4
196                       body:
197                         '404': '{"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource notfound for %1 using id %2 (msg=%3) (ec=%4)","variables":["DELETE","/cloud-infrastructur/pservers/pserver/pserver4","Node Not Found:No Node of type pserver found at: /clou-infrastructure/pservers/pserver/pserver4","ERR.5.4.6114"]}}}'
198
199         "limit exceeded":
200           description: Below is the response for when too many operations were attempted according to our limit
201           schema:
202               example:
203                 requestError:
204                   serviceException:
205                     messageId: SVC3000
206                     text: Invalid input performing %1 on %2 (msg=%3) (ec=%4)
207                     variables:
208                       - PUT
209                       - v11/bulkprocess
210                       - 'Payload Limit Reached, reduce payload:Payload limit of 30 reached, please reduce payload.'
211                       - ERR.5.4.6147
212       parameters:
213         - name: transactions
214           in: body
215           description: an array of multiple "put", "delete", and "patch" operations that include the associated A&AI URI for the operations and corresponding body payload. Multiple operations can be done within a single transaction or can be split into multiple transactions. A transaction's changes will not be committed to the database unless all operations within a single transaction succeed. Each transaction must include a "put", "patch", or "delete" array including at least one set of "uri" and "body" parameters. The "uri" parameter designates the endpoint of the A&AI CRUD operation that will update/delete the node/relationship, the "body" designates the payload that URI accepts to do so.
216           required: true
217           schema:
218             type: array
219             items:
220             example:
221               transactions:
222                 - put:
223                     - uri: /cloud-infrastructure/pservers/pserver/pserver5
224                       body:
225                         hostname: pserver5
226                     - uri: /cloud-infrastructure/pservers/pserver/pserver6
227                       body:
228                         hostname: pserver6
229                         fqdn: pserver6
230                 - patch:
231                     - uri: /cloud-infrastructure/pservers/pserver/pserver6
232                       body:
233                         hostname: pserver6
234                         fqdn: pserver6-fqdn
235                     - uri: /cloud-infrastructure/pservers/pserver/pserver5
236                       body:
237                         hostname: pserver5
238                         fqdn: pserver5
239                 - delete:
240                     - uri: /cloud-infrastructure/pservers/pserver/pserver3?resource-version=1510168241235
241                       body: {}
242                     - uri: /cloud-infrastructure/pservers/pserver/pserver4?resource-version=1510168252491
243                       body: {}
244