blob: a93f66be8a0c494b34c4ad0ddb033f35e9f0b385 [file] [log] [blame]
Saryu Shah82b62ca2018-03-19 22:18:13 +00001
2.. This work is licensed under a Creative Commons Attribution 4.0 International License.
3.. http://creativecommons.org/licenses/by/4.0
4
5*******************************
6Policy Cookbook |cookbooklogo|
7*******************************
8
9Policy VM/Docker Recipes
10^^^^^^^^^^^^^^^^^^^^^^^^
11
12 .. code-block:: bash
13 :caption: Get latest images in an already setup policy VM
14 :linenos:
15
16 /opt/policy_vm_init.sh
17
18
19 .. code-block:: bash
20 :caption: Install/start docker policy containers with no policies preloaded
21 :linenos:
22
23 echo "PRELOAD_POLICIES=false" > /opt/policy/.env
24 /opt/policy_vm_init.sh
25
26
27 .. code-block:: bash
28 :caption: Install/start docker policy containers with policies preloaded
29 :linenos:
30
31 # This is the current default mode of instantiation.
32 # These operations are unnecessary unless PRELOAD_POLICIES
33 # was previously set to true
34
35 echo "PRELOAD_POLICIES=true" > /opt/policy/.env
36 /opt/policy_vm_init.sh
37
38
39 .. code-block:: bash
40 :caption: Access the PDP-D container as a policy user
41 :linenos:
42
43 docker exec -it drools bash
44
45
46 .. code-block:: bash
47 :caption: Access the PDP-X container as a policy user
48 :linenos:
49
50 docker exec -it -u 0 pdp su - policy
51
52
53 .. code-block:: bash
54 :caption: Access the BRMSGW container as a policy user
55 :linenos:
56
57 docker exec -it -u 0 brmsgw su - policy
58
59
60 .. code-block:: bash
61 :caption: Access PAP container as a policy user
62 :linenos:
63
64 docker exec -it -u 0 pap su - policy
65
66
67 .. code-block:: bash
68 :caption: Access the CONSOLE container as a policy user
69 :linenos:
70
71 docker exec -it -u 0 console su - policy
72
73
74 .. code-block:: bash
75 :caption: Manual Healthcheck invokation
76 :linenos:
77
78 # Assuming the healthcheck service credentials have not been changed
79 # post-installation within the drools container
80
81 source /opt/app/policy/config/feature-healthcheck.conf.environment
82 curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}"
83 -X GET http://localhost:6969/healthcheck | python -m json.tool
84
85
86PDP-D Recipes ("drools" container)
87^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88
89 .. code-block:: bash
90 :caption: Stop the PDP-D
91 :linenos:
92
93 policy stop
94
95
96 .. code-block:: bash
97 :caption: Start the PDP-D
98 :linenos:
99
100 policy start
101
102
103 .. code-block:: bash
104 :caption: Manual Healthcheck Invokation
105 :linenos:
106
107 # Assuming the healthcheck service credentials have not been changed
108 # post-installation within the drools container
109
110 source ${POLICY_HOME}/config/feature-healthcheck.conf
111 curl --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}"
112 -X GET http://localhost:6969/healthcheck | python -m json.tool
113
114
115.. |recipelogo| image:: recipecard.png
116 :width: 80pt
117 :height: 80pt
118
119.. |cookbooklogo| image:: cookbook.gif
120 :width: 80pt
121 :height: 80pt
122
123End of Document
124
125.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Policy+Cookbook
126
127
128