summaryrefslogtreecommitdiffstats
path: root/docs/usage.rst
blob: c3e9317df6051529c519718a1c26919d2a06b1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2018 Intel Corporation, Inc

Usage Scenario
--------------

**Create a Domain**

This is the root where you will store your secrets.

.. code-block:: guess

    curl -H "Accept: application/json" --cacert ca.pem  --cert client.cert --key client.key
        -X POST \
        -d '{
                "name": "mysecretdomain"
            }'
        https://aaf-sms.onap:10443/v1/sms/domain

.. end

---------------

**Add a new Secret**

Store a new secret in your created Domain.
Secrets have a name and a map containing key value pairs.

.. code-block:: guess

    curl -H "Accept: application/json" --cacert ca.pem  --cert client.cert --key client.key
        -X POST \
        -d '{
                "name": "mysecret",
                "values": {
                    "name": "rah",
                    "age": 35,
                    "password": "mypassword"
                }
            }'
        https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret

.. end

---------------

**List all Secret Names in a Domain**

.. code-block:: guess

    curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
        -X GET \
        https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret

.. end

---------------

**Get a previously stored Secret from Domain**

.. code-block:: guess

    curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
        -X GET \
        https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret/<PREVIOUSLY CREATED SECRET NAME>

.. end

---------------

**Delete a Secret in specified Domain**

.. code-block:: guess

    curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
        -X DELETE \
        https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>/secret/<PREVIOUSLY CREATED SECRET NAME>

.. end

---------------

**Delete a Domain**

.. code-block:: guess

    curl -H "Accept: application/json" --cacert ca.pem --cert client.cert --key client.key
        -X DELETE \
        https://aaf-sms.onap:10443/v1/sms/domain/<PREVIOUSLY CREATED DOMAIN NAME>
.. end