c1fb6341b039850100225aedb07aa3562d2efb00
[aaf/sms.git] / sms-service / doc / api_swagger.yaml
1 swagger: "2.0"
2 info:
3   description: "This is a service that provides secret management facilities"
4   version: "1.0.0"
5   title: "Secret Management Service"
6   contact:
7     email: "kiran.k.kamineni@intel.com"
8   license:
9     name: "Apache 2.0"
10     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
11 host: "aaf.onap.org:8000"
12 basePath: "/v1/sms/"
13 tags:
14 - name: "domain"
15   description: "Operations related to Secret Domains"
16   externalDocs:
17     description: "Find out more"
18     url: "http://swagger.io"
19 - name: "secret"
20   description: "Operations related to Secrets"
21 schemes:
22 - "https"
23 paths:
24   /domain:
25     post:
26       tags:
27       - "domain"
28       summary: "Add a new domain"
29       description: ""
30       operationId: "addDomain"
31       consumes:
32       - "application/json"
33       produces:
34       - "application/json"
35       parameters:
36       - in: "body"
37         name: "body"
38         required: true
39         schema:
40           $ref: "#/definitions/Domain"
41       responses:
42         405:
43           description: "Invalid input"
44         200:
45           description: "Successful Creation"
46           schema:
47             $ref: "#/definitions/Domain"
48   /domain/{domain_name}:
49     get:
50       tags:
51       - "domain"
52       summary: "Gets domain by name"
53       description: "Multiple status values can be provided with comma separated strings"
54       operationId: "findPetsByStatus"
55       produces:
56       - "application/xml"
57       - "application/json"
58       parameters:
59       - name: "status"
60         in: "query"
61         description: "Status values that need to be considered for filter"
62         required: true
63         type: "array"
64         items:
65           type: "string"
66           enum:
67           - "available"
68           - "pending"
69           - "sold"
70           default: "available"
71         collectionFormat: "multi"
72       responses:
73         200:
74           description: "successful operation"
75           schema:
76             type: "array"
77             items:
78               $ref: "#/definitions/Pet"
79         400:
80           description: "Invalid status value"
81       security:
82       - petstore_auth:
83         - "write:pets"
84         - "read:pets"
85   /pet/findByTags:
86     get:
87       tags:
88       - "pet"
89       summary: "Finds Pets by tags"
90       description: "Muliple tags can be provided with comma separated strings. Use         tag1, tag2, tag3 for testing."
91       operationId: "findPetsByTags"
92       produces:
93       - "application/xml"
94       - "application/json"
95       parameters:
96       - name: "tags"
97         in: "query"
98         description: "Tags to filter by"
99         required: true
100         type: "array"
101         items:
102           type: "string"
103         collectionFormat: "multi"
104       responses:
105         200:
106           description: "successful operation"
107           schema:
108             type: "array"
109             items:
110               $ref: "#/definitions/Pet"
111         400:
112           description: "Invalid tag value"
113       security:
114       - petstore_auth:
115         - "write:pets"
116         - "read:pets"
117       deprecated: true
118   /{domainName}/{secretName}:
119     get:
120       tags:
121       - "secret"
122       summary: "Find Secret by Name"
123       description: "Returns a single secret"
124       operationId: "getSecretByName"
125       produces:
126       - "application/json"
127       parameters:
128       - name: "domainName"
129         in: "path"
130         description: "Name of the domain in which to look at"
131         required: true
132         type: "string"
133       - name: "secretName"
134         in: "path"
135         description: "Name of the secret which is needed"
136         required: true
137         type: "string"
138       responses:
139         200:
140           description: "successful operation"
141           schema:
142             $ref: "#/definitions/Secret"
143         404:
144           description: "Invalid Path or Path not found"
145       security:
146       - api_key: []
147     delete:
148       tags:
149       - "secret"
150       summary: "Deletes a Secret"
151       description: ""
152       operationId: "deleteSecret"
153       produces:
154       - "application/json"
155       parameters:
156       - name: "token"
157         in: "header"
158         required: true
159         type: "string"
160       - name: "secretName"
161         in: "path"
162         description: "Name of Secret to Delete"
163         required: true
164         type: "string"
165       - name: "domainName"
166         in: "path"
167         description: "Path to the SecretDomain which contains the Secret"
168         type: "string"
169       responses:
170         204:
171           description: "Successful Deletion"
172         404:
173           description: "Invalid Path or Path not found"
174   /pet/{petId}/uploadImage:
175     post:
176       tags:
177       - "pet"
178       summary: "uploads an image"
179       description: ""
180       operationId: "uploadFile"
181       consumes:
182       - "multipart/form-data"
183       produces:
184       - "application/json"
185       parameters:
186       - name: "petId"
187         in: "path"
188         description: "ID of pet to update"
189         required: true
190         type: "integer"
191         format: "int64"
192       - name: "additionalMetadata"
193         in: "formData"
194         description: "Additional data to pass to server"
195         required: false
196         type: "string"
197       - name: "file"
198         in: "formData"
199         description: "file to upload"
200         required: false
201         type: "file"
202       responses:
203         200:
204           description: "successful operation"
205           schema:
206             $ref: "#/definitions/ApiResponse"
207       security:
208       - petstore_auth:
209         - "write:pets"
210         - "read:pets"
211   /store/inventory:
212     get:
213       tags:
214       - "store"
215       summary: "Returns pet inventories by status"
216       description: "Returns a map of status codes to quantities"
217       operationId: "getInventory"
218       produces:
219       - "application/json"
220       parameters: []
221       responses:
222         200:
223           description: "successful operation"
224           schema:
225             type: "object"
226             additionalProperties:
227               type: "integer"
228               format: "int32"
229       security:
230       - api_key: []
231   /store/order:
232     post:
233       tags:
234       - "store"
235       summary: "Place an order for a pet"
236       description: ""
237       operationId: "placeOrder"
238       produces:
239       - "application/xml"
240       - "application/json"
241       parameters:
242       - in: "body"
243         name: "body"
244         description: "order placed for purchasing the pet"
245         required: true
246         schema:
247           $ref: "#/definitions/Order"
248       responses:
249         200:
250           description: "successful operation"
251           schema:
252             $ref: "#/definitions/Order"
253         400:
254           description: "Invalid Order"
255   /store/order/{orderId}:
256     get:
257       tags:
258       - "store"
259       summary: "Find purchase order by ID"
260       description: "For valid response try integer IDs with value >= 1 and <= 10.         Other values will generated exceptions"
261       operationId: "getOrderById"
262       produces:
263       - "application/xml"
264       - "application/json"
265       parameters:
266       - name: "orderId"
267         in: "path"
268         description: "ID of pet that needs to be fetched"
269         required: true
270         type: "integer"
271         maximum: 10.0
272         minimum: 1.0
273         format: "int64"
274       responses:
275         200:
276           description: "successful operation"
277           schema:
278             $ref: "#/definitions/Order"
279         400:
280           description: "Invalid ID supplied"
281         404:
282           description: "Order not found"
283     delete:
284       tags:
285       - "store"
286       summary: "Delete purchase order by ID"
287       description: "For valid response try integer IDs with positive integer value.         Negative or non-integer values will generate API errors"
288       operationId: "deleteOrder"
289       produces:
290       - "application/xml"
291       - "application/json"
292       parameters:
293       - name: "orderId"
294         in: "path"
295         description: "ID of the order that needs to be deleted"
296         required: true
297         type: "integer"
298         minimum: 1.0
299         format: "int64"
300       responses:
301         400:
302           description: "Invalid ID supplied"
303         404:
304           description: "Order not found"
305   /user:
306     post:
307       tags:
308       - "user"
309       summary: "Create user"
310       description: "This can only be done by the logged in user."
311       operationId: "createUser"
312       produces:
313       - "application/xml"
314       - "application/json"
315       parameters:
316       - in: "body"
317         name: "body"
318         description: "Created user object"
319         required: true
320         schema:
321           $ref: "#/definitions/User"
322       responses:
323         default:
324           description: "successful operation"
325   /user/createWithArray:
326     post:
327       tags:
328       - "user"
329       summary: "Creates list of users with given input array"
330       description: ""
331       operationId: "createUsersWithArrayInput"
332       produces:
333       - "application/xml"
334       - "application/json"
335       parameters:
336       - in: "body"
337         name: "body"
338         description: "List of user object"
339         required: true
340         schema:
341           type: "array"
342           items:
343             $ref: "#/definitions/User"
344       responses:
345         default:
346           description: "successful operation"
347   /user/createWithList:
348     post:
349       tags:
350       - "user"
351       summary: "Creates list of users with given input array"
352       description: ""
353       operationId: "createUsersWithListInput"
354       produces:
355       - "application/xml"
356       - "application/json"
357       parameters:
358       - in: "body"
359         name: "body"
360         description: "List of user object"
361         required: true
362         schema:
363           type: "array"
364           items:
365             $ref: "#/definitions/User"
366       responses:
367         default:
368           description: "successful operation"
369   /user/login:
370     get:
371       tags:
372       - "user"
373       summary: "Logs user into the system"
374       description: ""
375       operationId: "loginUser"
376       produces:
377       - "application/xml"
378       - "application/json"
379       parameters:
380       - name: "username"
381         in: "query"
382         description: "The user name for login"
383         required: true
384         type: "string"
385       - name: "password"
386         in: "query"
387         description: "The password for login in clear text"
388         required: true
389         type: "string"
390       responses:
391         200:
392           description: "successful operation"
393           schema:
394             type: "string"
395           headers:
396             X-Rate-Limit:
397               type: "integer"
398               format: "int32"
399               description: "calls per hour allowed by the user"
400             X-Expires-After:
401               type: "string"
402               format: "date-time"
403               description: "date in UTC when token expires"
404         400:
405           description: "Invalid username/password supplied"
406   /user/logout:
407     get:
408       tags:
409       - "user"
410       summary: "Logs out current logged in user session"
411       description: ""
412       operationId: "logoutUser"
413       produces:
414       - "application/xml"
415       - "application/json"
416       parameters: []
417       responses:
418         default:
419           description: "successful operation"
420   /user/{username}:
421     get:
422       tags:
423       - "user"
424       summary: "Get user by user name"
425       description: ""
426       operationId: "getUserByName"
427       produces:
428       - "application/xml"
429       - "application/json"
430       parameters:
431       - name: "username"
432         in: "path"
433         description: "The name that needs to be fetched. Use user1 for testing. "
434         required: true
435         type: "string"
436       responses:
437         200:
438           description: "successful operation"
439           schema:
440             $ref: "#/definitions/User"
441         400:
442           description: "Invalid username supplied"
443         404:
444           description: "User not found"
445     put:
446       tags:
447       - "user"
448       summary: "Updated user"
449       description: "This can only be done by the logged in user."
450       operationId: "updateUser"
451       produces:
452       - "application/xml"
453       - "application/json"
454       parameters:
455       - name: "username"
456         in: "path"
457         description: "name that need to be updated"
458         required: true
459         type: "string"
460       - in: "body"
461         name: "body"
462         description: "Updated user object"
463         required: true
464         schema:
465           $ref: "#/definitions/User"
466       responses:
467         400:
468           description: "Invalid user supplied"
469         404:
470           description: "User not found"
471     delete:
472       tags:
473       - "user"
474       summary: "Delete user"
475       description: "This can only be done by the logged in user."
476       operationId: "deleteUser"
477       produces:
478       - "application/xml"
479       - "application/json"
480       parameters:
481       - name: "username"
482         in: "path"
483         description: "The name that needs to be deleted"
484         required: true
485         type: "string"
486       responses:
487         400:
488           description: "Invalid username supplied"
489         404:
490           description: "User not found"
491 securityDefinitions:
492   petstore_auth:
493     type: "oauth2"
494     authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
495     flow: "implicit"
496     scopes:
497       write:pets: "modify pets in your account"
498       read:pets: "read your pets"
499   api_key:
500     type: "apiKey"
501     name: "api_key"
502     in: "header"
503 definitions:
504   Domain:
505     type: "object"
506     properties:
507       uuid:
508         type: "string"
509         description: "Optional value provided by user. If user does not provide, server will auto generate"
510       name:
511         type: "string"
512         description: "Name of the secret domain under which all secrets will be stored"
513   Secret:
514     type: "object"
515     properties:
516       name:
517         type: "string"
518         description: "Name of the secret"
519       value:
520         type: "array"
521         description: "Array of key value pairs that constitute the secret"
522         items:
523           type: "object"
524           properties:
525             key:
526               type: "string"
527             value:
528               type: "string"
529   Tag:
530     type: "object"
531     properties:
532       id:
533         type: "integer"
534         format: "int64"
535       name:
536         type: "string"
537     xml:
538       name: "Tag"
539   Pet:
540     type: "object"
541     required:
542     - "name"
543     - "photoUrls"
544     properties:
545       id:
546         type: "integer"
547         format: "int64"
548       category:
549         $ref: "#/definitions/Category"
550       name:
551         type: "string"
552         example: "doggie"
553       photoUrls:
554         type: "array"
555         xml:
556           name: "photoUrl"
557           wrapped: true
558         items:
559           type: "string"
560       tags:
561         type: "array"
562         xml:
563           name: "tag"
564           wrapped: true
565         items:
566           $ref: "#/definitions/Tag"
567       status:
568         type: "string"
569         description: "pet status in the store"
570         enum:
571         - "available"
572         - "pending"
573         - "sold"
574     xml:
575       name: "Pet"
576   ApiResponse:
577     type: "object"
578     properties:
579       code:
580         type: "integer"
581         format: "int32"
582       type:
583         type: "string"
584       message:
585         type: "string"
586 externalDocs:
587   description: "Find out more about Swagger"
588   url: "http://swagger.io"