Moving java code to java folder
[aaf/sms.git] / docs / apiswagger.rst
1 SMS 1.0.0 API
2 ===============================
3
4 .. toctree::
5     :maxdepth: 3
6
7
8 Description
9 ~~~~~~~~~~~
10
11 This is a service that provides secret management facilities
12
13
14
15 Contact Information
16 ~~~~~~~~~~~~~~~~~~~
17
18
19
20 kiran.k.kamineni@intel.com
21
22
23
24
25
26 License
27 ~~~~~~~
28
29
30 `Apache 2.0 <http://www.apache.org/licenses/LICENSE-2.0.html>`_
31
32
33
34
35 Base URL
36 ~~~~~~~~
37
38 https://aaf.onap.org:10443/v1/sms/
39
40 Security
41 ~~~~~~~~
42
43
44 .. _securities_token:
45
46 token (API Key)
47 ---------------
48
49
50
51 **Name:** token
52
53 **Located in:** header
54
55
56
57
58 DOMAIN
59 ~~~~~~
60
61
62 Operations related to Secret Domains
63
64
65
66
67
68 DELETE ``/domain/{domainName}``
69 -------------------------------
70
71
72 Summary
73 +++++++
74
75 Deletes a domain by name
76
77 Description
78 +++++++++++
79
80 .. raw:: html
81
82     Deletes a domain with provided name
83
84 Parameters
85 ++++++++++
86
87 .. csv-table::
88     :delim: |
89     :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
90     :widths: 20, 15, 10, 10, 10, 20, 30
91
92         domainName | path | Yes | string |  |  | Name of the domain
93
94
95 Request
96 +++++++
97
98
99 Responses
100 +++++++++
101
102 **204**
103 ^^^^^^^
104
105 Successful Deletion
106
107
108 **404**
109 ^^^^^^^
110
111 Invalid Path or Path not found
112
113
114
115
116
117
118 POST ``/domain``
119 ----------------
120
121
122 Summary
123 +++++++
124
125 Add a new domain
126
127
128
129 Request
130 +++++++
131
132
133
134 .. _d_c7bdcff9aff0692da98e588abdbc895b:
135
136 Body
137 ^^^^
138
139 .. csv-table::
140     :delim: |
141     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
142     :widths: 20, 10, 15, 15, 30, 25
143
144         name | No | string |  |  | Name of the secret domain under which all secrets will be stored
145         uuid | No | string |  |  | Optional value provided by user. If user does not provide, server will auto generate
146
147 .. code-block:: javascript
148
149     {
150         "name": "somestring", 
151         "uuid": "somestring"
152     }
153
154 Responses
155 +++++++++
156
157 **201**
158 ^^^^^^^
159
160 Successful Creation
161
162
163 Type: :ref:`Domain <d_c7bdcff9aff0692da98e588abdbc895b>`
164
165 **Example:**
166
167 .. code-block:: javascript
168
169     {
170         "name": "somestring", 
171         "uuid": "somestring"
172     }
173
174 **400**
175 ^^^^^^^
176
177 Invalid input
178
179
180 **500**
181 ^^^^^^^
182
183 Internal Server Error
184
185
186
187
188   
189 LOGIN
190 ~~~~~
191
192
193 Operations related to username password based authentication
194
195
196
197
198
199 POST ``/login``
200 ---------------
201
202
203 Summary
204 +++++++
205
206 Login with username and password
207
208 Description
209 +++++++++++
210
211 .. raw:: html
212
213     Operations related to logging in via username and Password
214
215
216 Request
217 +++++++
218
219
220
221 .. _d_8e36d758bad367e4538a291a5dd5355f:
222
223 Body
224 ^^^^
225
226 .. csv-table::
227     :delim: |
228     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
229     :widths: 20, 10, 15, 15, 30, 25
230
231         password | No | string |  |  | 
232         username | No | string |  |  | 
233
234 .. code-block:: javascript
235
236     {
237         "password": "somestring", 
238         "username": "somestring"
239     }
240
241 Responses
242 +++++++++
243
244 **200**
245 ^^^^^^^
246
247 Successful Login returns a token
248
249
250 .. _i_bbceffdf8441c1c476ca77c42ad12f85:
251
252 **Response Schema:**
253
254 .. csv-table::
255     :delim: |
256     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
257     :widths: 20, 10, 15, 15, 30, 25
258
259         token | No | string |  |  | 
260         ttl | No | integer |  |  | ttl of returned token in seconds
261
262
263 **Example:**
264
265 .. code-block:: javascript
266
267     {
268         "token": "somestring", 
269         "ttl": 1
270     }
271
272 **404**
273 ^^^^^^^
274
275 Invalid Username or Password
276
277
278
279
280   
281 SECRET
282 ~~~~~~
283
284
285 Operations related to Secrets
286
287
288
289
290
291 DELETE ``/domain/{domainName}/secret/{secretName}``
292 ---------------------------------------------------
293
294
295 Summary
296 +++++++
297
298 Deletes a Secret
299
300
301 Parameters
302 ++++++++++
303
304 .. csv-table::
305     :delim: |
306     :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
307     :widths: 20, 15, 10, 10, 10, 20, 30
308
309         secretName | path | Yes | string |  |  | Name of Secret to Delete
310         domainName | path | Yes | string |  |  | Path to the SecretDomain which contains the Secret
311
312
313 Request
314 +++++++
315
316
317 Responses
318 +++++++++
319
320 **204**
321 ^^^^^^^
322
323 Successful Deletion
324
325
326 **404**
327 ^^^^^^^
328
329 Invalid Path or Path not found
330
331
332
333
334
335
336 GET ``/domain/{domainName}/secret``
337 -----------------------------------
338
339
340 Summary
341 +++++++
342
343 List secret Names in this domain
344
345 Description
346 +++++++++++
347
348 .. raw:: html
349
350     Gets all secret names in this domain
351
352 Parameters
353 ++++++++++
354
355 .. csv-table::
356     :delim: |
357     :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
358     :widths: 20, 15, 10, 10, 10, 20, 30
359
360         domainName | path | Yes | string |  |  | Name of the domain in which to look at
361
362
363 Request
364 +++++++
365
366
367 Responses
368 +++++++++
369
370 **200**
371 ^^^^^^^
372
373 Successful operation
374
375
376 .. _i_1dcddfd6f11cba3fb2516d3a61cd1b77:
377
378 **Response Schema:**
379
380 .. csv-table::
381     :delim: |
382     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
383     :widths: 20, 10, 15, 15, 30, 25
384
385         secretnames | No | array of string |  |  | Array of strings referencing the secret names
386
387
388 **Example:**
389
390 .. code-block:: javascript
391
392     {
393         "secretnames": [
394             "secretname1", 
395             "secretname2", 
396             "secretname3"
397         ]
398     }
399
400 **404**
401 ^^^^^^^
402
403 Invalid Path or Path not found
404
405
406
407
408
409
410 GET ``/domain/{domainName}/secret/{secretName}``
411 ------------------------------------------------
412
413
414 Summary
415 +++++++
416
417 Find Secret by Name
418
419 Description
420 +++++++++++
421
422 .. raw:: html
423
424     Returns a single secret
425
426 Parameters
427 ++++++++++
428
429 .. csv-table::
430     :delim: |
431     :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
432     :widths: 20, 15, 10, 10, 10, 20, 30
433
434         domainName | path | Yes | string |  |  | Name of the domain in which to look at
435         secretName | path | Yes | string |  |  | Name of the secret which is needed
436
437
438 Request
439 +++++++
440
441
442 Responses
443 +++++++++
444
445 **200**
446 ^^^^^^^
447
448 successful operation
449
450
451 Type: :ref:`Secret <d_5e5fddd9ede6eb091e8496a9c55b84c3>`
452
453 **Example:**
454
455 .. code-block:: javascript
456
457     {
458         "name": "somestring", 
459         "values": {
460             "Age": 40, 
461             "admin": true, 
462             "name": "john"
463         }
464     }
465
466 **404**
467 ^^^^^^^
468
469 Invalid Path or Path not found
470
471
472
473
474
475
476 POST ``/domain/{domainName}/secret``
477 ------------------------------------
478
479
480 Summary
481 +++++++
482
483 Add a new secret
484
485
486 Parameters
487 ++++++++++
488
489 .. csv-table::
490     :delim: |
491     :header: "Name", "Located in", "Required", "Type", "Format", "Properties", "Description"
492     :widths: 20, 15, 10, 10, 10, 20, 30
493
494         domainName | path | Yes | string |  |  | Name of the domain
495
496
497 Request
498 +++++++
499
500
501
502 .. _d_5e5fddd9ede6eb091e8496a9c55b84c3:
503
504 Body
505 ^^^^
506
507 .. csv-table::
508     :delim: |
509     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
510     :widths: 20, 10, 15, 15, 30, 25
511
512         name | No | string |  |  | Name of the secret
513         values | No | :ref:`values <i_a9213c9639162b77082e257e19cca0d0>` |  |  | Map of key value pairs that constitute the secret
514
515 .. _i_a9213c9639162b77082e257e19cca0d0:
516
517 **Values schema:**
518
519
520 Map of key value pairs that constitute the secret
521
522 Map of {"key":":ref:`values-mapped <m_4d863967ef9a9d9efdadd1b250c76bd6>`"}
523
524 .. csv-table::
525     :delim: |
526     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
527     :widths: 20, 10, 15, 15, 30, 25
528
529
530
531 .. code-block:: javascript
532
533     {
534         "name": "somestring", 
535         "values": {
536             "Age": 40, 
537             "admin": true, 
538             "name": "john"
539         }
540     }
541
542 Responses
543 +++++++++
544
545 **201**
546 ^^^^^^^
547
548 Successful Creation
549
550
551 **404**
552 ^^^^^^^
553
554 Invalid Path or Path not found
555
556
557
558
559   
560 SYSTEM
561 ~~~~~~
562
563
564 Operations related to quorum client which are not useful to clients
565
566
567
568
569
570 GET ``/status``
571 ---------------
572
573
574 Summary
575 +++++++
576
577 Get backend status
578
579 Description
580 +++++++++++
581
582 .. raw:: html
583
584     Gets current backend status. This API is used only by quorum clients
585
586
587 Request
588 +++++++
589
590
591 Responses
592 +++++++++
593
594 **200**
595 ^^^^^^^
596
597 Successful operation
598
599
600 .. _i_ac1bc8e82eadbd8c03f852e15be4d03b:
601
602 **Response Schema:**
603
604 .. csv-table::
605     :delim: |
606     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
607     :widths: 20, 10, 15, 15, 30, 25
608
609         sealstatus | No | string |  |  | seal status of backend
610
611
612 **Example:**
613
614 .. code-block:: javascript
615
616     {
617         "sealstatus": "somestring"
618     }
619
620 **404**
621 ^^^^^^^
622
623 Invalid Path or Path not found
624
625
626
627
628
629
630 POST ``/unseal``
631 ----------------
632
633
634 Summary
635 +++++++
636
637 Unseal backend
638
639 Description
640 +++++++++++
641
642 .. raw:: html
643
644     Sends unseal shard to unseal if backend is sealed
645
646
647 Request
648 +++++++
649
650
651
652 .. _i_9d32e021ba68855cbb6e633520b7cd2d:
653
654 Body
655 ^^^^
656
657 .. csv-table::
658     :delim: |
659     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
660     :widths: 20, 10, 15, 15, 30, 25
661
662         unsealshard | No | string |  |  | Unseal shard that will be used along with other shards to unseal backend
663
664 .. code-block:: javascript
665
666     {
667         "unsealshard": "somestring"
668     }
669
670 Responses
671 +++++++++
672
673 **201**
674 ^^^^^^^
675
676 Submitted unseal key
677
678
679 **404**
680 ^^^^^^^
681
682 Invalid Path or Path not found
683
684
685
686
687   
688 Data Structures
689 ~~~~~~~~~~~~~~~
690
691 .. _d_8e36d758bad367e4538a291a5dd5355f:
692
693 Credential Model Structure
694 --------------------------
695
696 .. csv-table::
697     :delim: |
698     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
699     :widths: 20, 10, 15, 15, 30, 25
700
701         password | No | string |  |  | 
702         username | No | string |  |  | 
703
704 .. _d_c7bdcff9aff0692da98e588abdbc895b:
705
706 Domain Model Structure
707 ----------------------
708
709 .. csv-table::
710     :delim: |
711     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
712     :widths: 20, 10, 15, 15, 30, 25
713
714         name | No | string |  |  | Name of the secret domain under which all secrets will be stored
715         uuid | No | string |  |  | Optional value provided by user. If user does not provide, server will auto generate
716
717 .. _d_5e5fddd9ede6eb091e8496a9c55b84c3:
718
719 Secret Model Structure
720 ----------------------
721
722 .. csv-table::
723     :delim: |
724     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
725     :widths: 20, 10, 15, 15, 30, 25
726
727         name | No | string |  |  | Name of the secret
728         values | No | :ref:`values <i_a9213c9639162b77082e257e19cca0d0>` |  |  | Map of key value pairs that constitute the secret
729
730 .. _i_a9213c9639162b77082e257e19cca0d0:
731
732 **Values schema:**
733
734
735 Map of key value pairs that constitute the secret
736
737 Map of {"key":":ref:`values-mapped <m_4d863967ef9a9d9efdadd1b250c76bd6>`"}
738
739 .. csv-table::
740     :delim: |
741     :header: "Name", "Required", "Type", "Format", "Properties", "Description"
742     :widths: 20, 10, 15, 15, 30, 25
743
744
745