Update version to 3.0.1 for release
[aaf/sms.git] / docs / api_swagger.json
1 {
2   "swagger": "2.0",
3   "info": {
4     "description": "This is a service that provides secret management facilities",
5     "version": "1.0.0",
6     "title": "Secret Management Service",
7     "contact": {
8       "email": "kiran.k.kamineni@intel.com"
9     },
10     "license": {
11       "name": "Apache 2.0",
12       "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
13     }
14   },
15   "host": "aaf.onap.org:10443",
16   "basePath": "/v1/sms/",
17   "tags": [
18     {
19       "name": "domain",
20       "description": "Operations related to Secret Domains"
21     },
22     {
23       "name": "secret",
24       "description": "Operations related to Secrets"
25     }
26   ],
27   "schemes": [
28     "https"
29   ],
30   "paths": {
31     "/domain": {
32       "post": {
33         "tags": [
34           "domain"
35         ],
36         "summary": "Add a new domain",
37         "description": "",
38         "consumes": [
39           "application/json"
40         ],
41         "produces": [
42           "application/json"
43         ],
44         "parameters": [
45           {
46             "in": "body",
47             "name": "body",
48             "required": true,
49             "schema": {
50               "$ref": "#/definitions/Domain"
51             }
52           }
53         ],
54         "responses": {
55           "201": {
56             "description": "Successful Creation",
57             "schema": {
58               "$ref": "#/definitions/Domain"
59             }
60           },
61           "400": {
62             "description": "Invalid input"
63           },
64           "500": {
65             "description": "Internal Server Error"
66           }
67         }
68       }
69     },
70     "/domain/{domainName}": {
71       "delete": {
72         "tags": [
73           "domain"
74         ],
75         "description": "Deletes a domain with provided name",
76         "summary": "Deletes a domain by name",
77         "produces": [
78           "application/json"
79         ],
80         "parameters": [
81           {
82             "name": "domainName",
83             "in": "path",
84             "description": "Name of the domain",
85             "required": true,
86             "type": "string"
87           }
88         ],
89         "responses": {
90           "204": {
91             "description": "Successful Deletion"
92           },
93           "404": {
94             "description": "Invalid Path or Path not found"
95           }
96         }
97       }
98     },
99     "/domain/{domainName}/secret": {
100       "post": {
101         "tags": [
102           "secret"
103         ],
104         "summary": "Add a new secret",
105         "description": "",
106         "consumes": [
107           "application/json"
108         ],
109         "produces": [
110           "application/json"
111         ],
112         "parameters": [
113           {
114             "name": "domainName",
115             "in": "path",
116             "description": "Name of the domain",
117             "required": true,
118             "type": "string"
119           },
120           {
121             "name": "body",
122             "in": "body",
123             "required": true,
124             "schema": {
125               "$ref": "#/definitions/Secret"
126             }
127           }
128         ],
129         "responses": {
130           "201": {
131             "description": "Successful Creation"
132           },
133           "404": {
134             "description": "Invalid Path or Path not found"
135           }
136         }
137       },
138       "get": {
139         "tags": [
140           "secret"
141         ],
142         "description": "Gets all secret names in this domain",
143         "summary": "List secret Names in this domain",
144         "produces": [
145           "application/json"
146         ],
147         "parameters": [
148           {
149             "name": "domainName",
150             "in": "path",
151             "description": "Name of the domain in which to look at",
152             "required": true,
153             "type": "string"
154           }
155         ],
156         "responses": {
157           "200": {
158             "description": "Successful operation",
159             "schema": {
160               "type": "object",
161               "properties": {
162                 "secretnames": {
163                   "type": "array",
164                   "items": {
165                     "type": "string"
166                   },
167                   "description": "Array of strings referencing the secret names"
168                 }
169               },
170               "example": {
171                 "secretnames": [
172                   "secretname1",
173                   "secretname2",
174                   "secretname3"
175                 ]
176               }
177             }
178           },
179           "404": {
180             "description": "Invalid Path or Path not found"
181           }
182         }
183       }
184     },
185     "/domain/{domainName}/secret/{secretName}": {
186       "get": {
187         "tags": [
188           "secret"
189         ],
190         "summary": "Find Secret by Name",
191         "description": "Returns a single secret",
192         "produces": [
193           "application/json"
194         ],
195         "parameters": [
196           {
197             "name": "domainName",
198             "in": "path",
199             "description": "Name of the domain in which to look at",
200             "required": true,
201             "type": "string"
202           },
203           {
204             "name": "secretName",
205             "in": "path",
206             "description": "Name of the secret which is needed",
207             "required": true,
208             "type": "string"
209           }
210         ],
211         "responses": {
212           "200": {
213             "description": "successful operation",
214             "schema": {
215               "$ref": "#/definitions/Secret"
216             }
217           },
218           "404": {
219             "description": "Invalid Path or Path not found"
220           }
221         }
222       },
223       "delete": {
224         "tags": [
225           "secret"
226         ],
227         "summary": "Deletes a Secret",
228         "description": "",
229         "produces": [
230           "application/json"
231         ],
232         "parameters": [
233           {
234             "name": "secretName",
235             "in": "path",
236             "description": "Name of Secret to Delete",
237             "required": true,
238             "type": "string"
239           },
240           {
241             "name": "domainName",
242             "in": "path",
243             "required": true,
244             "description": "Path to the SecretDomain which contains the Secret",
245             "type": "string"
246           }
247         ],
248         "responses": {
249           "204": {
250             "description": "Successful Deletion"
251           },
252           "404": {
253             "description": "Invalid Path or Path not found"
254           }
255         }
256       }
257     }
258   },
259   "securityDefinitions": {
260     "token": {
261       "type": "apiKey",
262       "name": "token",
263       "in": "header"
264     }
265   },
266   "definitions": {
267     "Credential": {
268       "type": "object",
269       "properties": {
270         "username": {
271           "type": "string"
272         },
273         "password": {
274           "type": "string"
275         }
276       }
277     },
278     "Domain": {
279       "type": "object",
280       "properties": {
281         "uuid": {
282           "type": "string",
283           "description": "Optional value provided by user. If user does not provide, server will auto generate"
284         },
285         "name": {
286           "type": "string",
287           "description": "Name of the secret domain under which all secrets will be stored"
288         }
289       }
290     },
291     "Secret": {
292       "type": "object",
293       "properties": {
294         "name": {
295           "type": "string",
296           "description": "Name of the secret"
297         },
298         "values": {
299           "description": "Map of key value pairs that constitute the secret",
300           "type": "object",
301           "additionalProperties": {
302             "type": "object"
303           },
304           "example": {
305             "name": "john",
306             "Age": 40,
307             "admin": true
308           }
309         }
310       }
311     }
312   },
313   "externalDocs": {
314     "description": "Find out more about Swagger",
315     "url": "http://swagger.io"
316   }
317 }