summaryrefslogtreecommitdiffstats
path: root/docs/platform/cookbook.rst
blob: a93f66be8a0c494b34c4ad0ddb033f35e9f0b385 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

*******************************
Policy Cookbook  |cookbooklogo|
*******************************

Policy VM/Docker Recipes
^^^^^^^^^^^^^^^^^^^^^^^^

    .. code-block:: bash
       :caption: Get latest images in an already setup policy VM
       :linenos:

        /opt/policy_vm_init.sh


    .. code-block:: bash
       :caption: Install/start docker policy containers with no policies preloaded
       :linenos:

        echo "PRELOAD_POLICIES=false" > /opt/policy/.env
        /opt/policy_vm_init.sh


    .. code-block:: bash
       :caption: Install/start docker policy containers with policies preloaded
       :linenos:

        # This is the current default mode of instantiation.
        # These operations are unnecessary unless PRELOAD_POLICIES
        # was previously set to true
         
        echo "PRELOAD_POLICIES=true" > /opt/policy/.env
        /opt/policy_vm_init.sh


    .. code-block:: bash
       :caption: Access the PDP-D container as a policy user
       :linenos:

        docker exec -it drools bash


    .. code-block:: bash
       :caption: Access the PDP-X container as a policy user
       :linenos:

        docker exec -it -u 0 pdp su - policy


    .. code-block:: bash
       :caption: Access the BRMSGW container as a policy user
       :linenos:

        docker exec -it -u 0 brmsgw su - policy


    .. code-block:: bash
       :caption: Access PAP container as a policy user
       :linenos:

        docker exec -it -u 0 pap su - policy


    .. code-block:: bash
       :caption: Access the CONSOLE container as a policy user
       :linenos:

        docker exec -it -u 0 console su - policy


    .. code-block:: bash
       :caption: Manual Healthcheck invokation
       :linenos:

        # Assuming the healthcheck service credentials have not been changed
        # post-installation within the drools container
         
        source /opt/app/policy/config/feature-healthcheck.conf.environment
        curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" 
             -X GET http://localhost:6969/healthcheck | python -m json.tool


PDP-D Recipes ("drools" container)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    .. code-block:: bash
       :caption: Stop the PDP-D
       :linenos:

        policy stop


    .. code-block:: bash
       :caption: Start the PDP-D
       :linenos:

        policy start


    .. code-block:: bash
       :caption: Manual Healthcheck Invokation
       :linenos:

        # Assuming the healthcheck service credentials have not been changed
        # post-installation within the drools container
 
        source ${POLICY_HOME}/config/feature-healthcheck.conf
        curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" 
             -X GET http://localhost:6969/healthcheck | python -m json.tool


.. |recipelogo| image:: recipecard.png
    :width: 80pt
    :height: 80pt

.. |cookbooklogo| image:: cookbook.gif
    :width: 80pt
    :height: 80pt

End of Document

.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Policy+Cookbook