Move version.properties as its not configurable
[aaf/sms.git] / docs / 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:10443'
12 basePath: /v1/sms/
13 tags:
14   - name: system
15     description: Operations related to quorum client which are not useful to clients
16   - name: login
17     description: Operations related to username password based authentication
18   - name: domain
19     description: Operations related to Secret Domains
20   - name: secret
21     description: Operations related to Secrets
22 schemes:
23   - https
24 paths:
25   /login:
26     post:
27       tags:
28         - login
29       summary: Login with username and password
30       description: Operations related to logging in via username and Password
31       consumes:
32         - application/json
33       produces:
34         - application/json
35       parameters:
36         - name: body
37           in: body
38           required: true
39           schema:
40             $ref: '#/definitions/Credential'
41       responses:
42         '200':
43           description: Successful Login returns a token
44           schema:
45             type: object
46             properties:
47               token:
48                 type: string
49               ttl:
50                 type: integer
51                 description: ttl of returned token in seconds
52         '404':
53           description: Invalid Username or Password
54   /status:
55     get:
56       tags:
57         - system
58       description: Gets current backend status. This API is used only by quorum clients
59       summary: Get backend status
60       produces:
61         - application/json
62       responses:
63         '200':
64           description: Successful operation
65           schema:
66             type: object
67             properties:
68               sealstatus:
69                 type: string
70                 description: seal status of backend
71         '404':
72           description: Invalid Path or Path not found
73   /unseal:
74     post:
75       tags:
76         - system
77       description: Sends unseal shard to unseal if backend is sealed
78       summary: Unseal backend
79       consumes:
80         - application/json
81       produces:
82         - application/json
83       parameters:
84         - in: body
85           name: body
86           required: true
87           schema:
88             type: object
89             properties:
90               unsealshard:
91                 type: string
92                 description: >-
93                   Unseal shard that will be used along with other shards to
94                   unseal backend
95       responses:
96         '201':
97           description: Submitted unseal key
98         '404':
99           description: Invalid Path or Path not found
100   /domain:
101     post:
102       tags:
103         - domain
104       summary: Add a new domain
105       description: ''
106       consumes:
107         - application/json
108       produces:
109         - application/json
110       parameters:
111         - in: body
112           name: body
113           required: true
114           schema:
115             $ref: '#/definitions/Domain'
116       responses:
117         '201':
118           description: Successful Creation
119           schema:
120             $ref: '#/definitions/Domain'
121         '400':
122           description: Invalid input
123         '500':
124           description: Internal Server Error
125   '/domain/{domainName}':
126     delete:
127       tags:
128         - domain
129       description: Deletes a domain with provided name
130       summary: Deletes a domain by name
131       produces:
132         - application/json
133       parameters:
134         - name: domainName
135           in: path
136           description: Name of the domain
137           required: true
138           type: string
139       responses:
140         '204':
141           description: Successful Deletion
142         '404':
143           description: Invalid Path or Path not found
144   '/domain/{domainName}/secret':
145     post:
146       tags:
147         - secret
148       summary: Add a new secret
149       description: ''
150       consumes:
151         - application/json
152       produces:
153         - application/json
154       parameters:
155         - name: domainName
156           in: path
157           description: Name of the domain
158           required: true
159           type: string
160         - name: body
161           in: body
162           required: true
163           schema:
164             $ref: '#/definitions/Secret'
165       responses:
166         '201':
167           description: Successful Creation
168         '404':
169           description: Invalid Path or Path not found
170     get:
171       tags:
172         - secret
173       description: Gets all secret names in this domain
174       summary: List secret Names in this domain
175       produces:
176         - application/json
177       parameters:
178         - name: domainName
179           in: path
180           description: Name of the domain in which to look at
181           required: true
182           type: string
183       responses:
184         '200':
185           description: Successful operation
186           schema:
187             type: object
188             properties:
189               secretnames:
190                 type: array
191                 items:
192                   type: string
193                 description: Array of strings referencing the secret names
194             example:
195               secretnames: ["secretname1", "secretname2", "secretname3"]
196         '404':
197           description: Invalid Path or Path not found
198   '/domain/{domainName}/secret/{secretName}':
199     get:
200       tags:
201         - secret
202       summary: Find Secret by Name
203       description: Returns a single secret
204       produces:
205         - application/json
206       parameters:
207         - name: domainName
208           in: path
209           description: Name of the domain in which to look at
210           required: true
211           type: string
212         - name: secretName
213           in: path
214           description: Name of the secret which is needed
215           required: true
216           type: string
217       responses:
218         '200':
219           description: successful operation
220           schema:
221             $ref: '#/definitions/Secret'
222         '404':
223           description: Invalid Path or Path not found
224     delete:
225       tags:
226         - secret
227       summary: Deletes a Secret
228       description: ''
229       produces:
230         - application/json
231       parameters:
232         - name: secretName
233           in: path
234           description: Name of Secret to Delete
235           required: true
236           type: string
237         - name: domainName
238           in: path
239           required: true
240           description: Path to the SecretDomain which contains the Secret
241           type: string
242       responses:
243         '204':
244           description: Successful Deletion
245         '404':
246           description: Invalid Path or Path not found
247 securityDefinitions:
248   token:
249     type: apiKey
250     name: token
251     in: header
252 definitions:
253   Credential:
254     type: object
255     properties:
256       username:
257         type: string
258       password:
259         type: string
260   Domain:
261     type: object
262     properties:
263       uuid:
264         type: string
265         description: >-
266           Optional value provided by user. If user does not provide, server will
267           auto generate
268       name:
269         type: string
270         description: Name of the secret domain under which all secrets will be stored
271   Secret:
272     type: object
273     properties:
274       name:
275         type: string
276         description: Name of the secret
277       values:
278         description: Map of key value pairs that constitute the secret
279         type: object
280         additionalProperties:
281           type: object
282         example:
283           name: john
284           Age: 40
285           admin: true
286 externalDocs:
287   description: Find out more about Swagger
288   url: 'http://swagger.io'