5e0b792fc6cbdf923bcefbc9e00fe06098686f23
[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: login
15     description: Operations related to username password based authentication
16   - name: domain
17     description: Operations related to Secret Domains
18   - name: secret
19     description: Operations related to Secrets
20 schemes:
21   - https
22 paths:
23   /login:
24     post:
25       tags:
26         - login
27       summary: "Login with username and password"
28       description: 'Operations related to logging in via username and Password'
29       operationId: loginUser
30       consumes:
31         - application/json
32       produces:
33         - application/json
34       parameters:
35         - name: body
36           in: body
37           required: true
38           schema:
39             $ref: '#/definitions/Credential'
40       responses:
41         '200':
42           description: "Successful Login"
43           schema:
44             type: "string"
45         '404':
46           description: "Invalid Username or Password"
47   /domain:
48     post:
49       tags:
50         - domain
51       summary: Add a new domain
52       description: ''
53       operationId: addDomain
54       consumes:
55         - application/json
56       produces:
57         - application/json
58       parameters:
59         - in: body
60           name: body
61           required: true
62           schema:
63             $ref: '#/definitions/Domain'
64       responses:
65         '200':
66           description: Successful Creation
67           schema:
68             $ref: '#/definitions/Domain'
69         '405':
70           description: Invalid input
71   '/domain/{domainName}':
72     get:
73       tags:
74         - domain
75       description: Gets domain information by name
76       operationId: getDomainByName
77       produces:
78         - application/json
79       parameters:
80         - name: domainName
81           in: path
82           description: Name of the domain
83           required: true
84           type: string
85       responses:
86         '200':
87           description: successful operation
88           schema:
89             $ref: '#/definitions/Domain'
90         '404':
91           description: Invalid Path or Path not found
92     delete:
93       tags:
94         - domain
95       description: Deletes a domain with provided name
96       operationId: deleteDomainByName
97       produces:
98         - application/json
99       parameters:
100         - name: domainName
101           in: path
102           description: Name of the domain
103           required: true
104           type: string
105       responses:
106         '204':
107           description: Successful Deletion
108         '404':
109           description: Invalid Path or Path not found
110   '/domain/{domainName}/secret':
111     post:
112       tags:
113         - secret
114       summary: Add a new secret
115       description: ''
116       operationId: addSecretInDomain
117       consumes:
118         - application/json
119       produces:
120         - application/json
121       parameters:
122         - name: domainName
123           in: path
124           description: Name of the domain
125           required: true
126           type: string
127         - name: body
128           in: body
129           required: true
130           schema:
131             $ref: '#/definitions/Secret'
132       responses:
133         '200':
134           description: Successful Creation
135           schema:
136             $ref: '#/definitions/Secret'
137         '404':
138           description: Invalid Path or Path not found
139     get:
140       tags:
141         - secret
142       description: Gets all secrets in this domain
143       operationId: getAllSecretsInDomain
144       produces:
145         - application/json
146       parameters:
147         - name: domainName
148           in: path
149           description: Name of the domain in which to look at
150           required: true
151           type: string
152       responses:
153         '200':
154           description: successful operation
155           schema:
156             type: "array"
157             items:
158               $ref: '#/definitions/Secret'
159         '404':
160           description: Invalid Path or Path not found
161   '/domain/{domainName}/secret/{secretName}':
162     get:
163       tags:
164         - secret
165       summary: Find Secret by Name
166       description: Returns a single secret
167       operationId: getSecretByName
168       produces:
169         - application/json
170       parameters:
171         - name: domainName
172           in: path
173           description: Name of the domain in which to look at
174           required: true
175           type: string
176         - name: secretName
177           in: path
178           description: Name of the secret which is needed
179           required: true
180           type: string
181       responses:
182         '200':
183           description: successful operation
184           schema:
185             $ref: '#/definitions/Secret'
186         '404':
187           description: Invalid Path or Path not found
188     delete:
189       tags:
190         - secret
191       summary: Deletes a Secret
192       description: ''
193       operationId: deleteSecret
194       produces:
195         - application/json
196       parameters:
197         - name: secretName
198           in: path
199           description: Name of Secret to Delete
200           required: true
201           type: string
202         - name: domainName
203           in: path
204           required: true
205           description: Path to the SecretDomain which contains the Secret
206           type: string
207       responses:
208         '204':
209           description: Successful Deletion
210         '404':
211           description: Invalid Path or Path not found
212 definitions:
213   Credential:
214     type: object
215     properties:
216       username:
217         type: "string"
218       password:
219         type: "string"
220   Domain:
221     type: object
222     properties:
223       uuid:
224         type: string
225         description: >-
226           Optional value provided by user. If user does not provide, server will
227           auto generate
228       name:
229         type: string
230         description: Name of the secret domain under which all secrets will be stored
231   Secret:
232     type: "object"
233     properties:
234       name:
235         type: "string"
236         description: Name of the secret
237       value:
238         type: "array"
239         description: Array of key value pairs that constitute the secret
240         items:
241           type: "object"
242           properties:
243             key:
244               type: "string"
245             value:
246               type: "string"
247 externalDocs:
248   description: Find out more about Swagger
249   url: 'http://swagger.io'