Adding a docs folder under sms repo
[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 Typical Usage Scenario
6 ======================
7
8 .. code-block:: guess
9
10     ## Create a Domain
11     ## This is where all your secrets will be stored
12     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
13         -X POST \
14         -d '{
15                 "name": "mysecretdomain"
16             }'
17         https://sms:10443/v1/sms/domain
18
19     ## Add a new Secret
20     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
21         -X POST \
22         -d '{
23                 "name": "mysecret",
24                 "values": {
25                     "name": "rah",
26                     "age": 35,
27                     "password": "mypassword"
28                 }
29             }'
30         https://sms:10443/v1/sms/domain/<domaincurltestdomain/secret
31
32
33     ## List all Secrets under a Domain
34     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
35         -X GET \
36         https://sms:10443/v1/sms/domain/curltestdomain/secret
37
38     ## Get a Secret in a Domain
39     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
40         -X GET \
41         https://sms:10443/v1/sms/domain/curltestdomain/secret/curltestsecret1
42
43     ## Delete a Secret in specified Domain
44     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
45         -X DELETE \
46         https://sms:10443/v1/sms/domain/curltestdomain/secret/curltestsecret1
47
48     ## Delete a Domain
49     ## This will delete all the secrets in that Domain
50     curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
51         -X DELETE \
52         https://sms:10443/v1/sms/domain/curltestdomain
53
54 .. end