Automation adds aaf-sms-architecture.rst
[aaf/sms.git] / docs / usage.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2018 Intel Corporation, Inc
4
5 Usage Scenario
6 --------------
7
8 **Create a Domain**
9
10 This is the root where you will store your secrets.
11
12 .. code-block:: guess
13
14     curl -H "Accept: application/json" --cacert ca.pem  --cert client.cert --key client.key
15         -X POST \
16         -d '{
17                 "name": "mysecretdomain"
18             }'
19         https://aaf-sms.onap:10443/v1/sms/domain
20
21 .. end
22
23 ---------------
24
25 **Add a new Secret**
26
27 Store a new secret in your created Domain.
28 Secrets have a name and a map containing key value pairs.
29
30 .. code-block:: guess
31
32     curl -H "Accept: application/json" --cacert ca.pem  --cert client.cert --key client.key
33         -X POST \
34         -d '{
35                 "name": "mysecret",
36                 "values": {
37                     "name": "rah",
38                     "age": 35,
39                     "password": "mypassword"
40                 }
41             }'
42         https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret
43
44 .. end
45
46 ---------------
47
48 **List all Secret Names in a Domain**
49
50 .. code-block:: guess
51
52     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
53         -X GET \
54         https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret
55
56 .. end
57
58 ---------------
59
60 **Get a previously stored Secret from Domain**
61
62 .. code-block:: guess
63
64     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
65         -X GET \
66         https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret/<PREVIOUSLY CREATED SECRET NAME>
67
68 .. end
69
70 ---------------
71
72 **Delete a Secret in specified Domain**
73
74 .. code-block:: guess
75
76     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
77         -X DELETE \
78         https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret/<PREVIOUSLY CREATED SECRET NAME>
79
80 .. end
81
82 ---------------
83
84 **Delete a Domain**
85
86 .. code-block:: guess
87
88     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
89         -X DELETE \
90         https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>
91 .. end