blob: 330bb64efff0218729017b001c9e72849207fe00 [file] [log] [blame]
Saryu Shah7c24c8a2017-11-08 21:20:04 +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*********************************************************
6Tutorial: Testing the vDNS Use Case in a standalone PDP-D
7*********************************************************
8
9.. contents::
10 :depth: 3
11
12In this tutorial we will go over how to access and start up the PDP-D, setup the prerequisites for the vDNS flow, enable/disable the AAI and SO Simulators that will be used in the vDNS flow, and inject messages to trigger the vDNS flow.
13
14Accessing and starting the PDP-D
15^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
17The first step is to access the docker container of name *drools*.
18
19 .. code-block:: bash
20
21 docker exec -it -u 0 drools su - policy
22
23The PDP-D software is installed under the *policy* account, the policy root directory is under *${POLICY_HOME}* environment variable and it may be changed on a per installation basis. It is typically set up under the */opt/app/policy* directory but can be changed during installation. All PDP-D software runs with non-root privileges as *policy* is a regular user account.
24
25Once within the drools container, the running status can be observed by using the *policy* command:
26
27 .. code-block:: bash
28
29 policy [--debug] status|start|stop
30
31The running status of the PDP-D can be observed with *policy status*
32
33 .. code-block:: bash
34
35 policy@drools:~$ policy status [drools-pdp-controllers] L []: Policy Management (pid 1500) is running 1 cron jobs installed.
36
37
38Prerequisites for the vDNS flow
39^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40
41In order to trigger the vDNS flow we will need to inject an ONSET message via curl command. We're going to create a temporary *util* directory to store a file that contains the vDNS ONSET message.
42
43Navigate to */tmp* and create directory *util*. *util* is just a temporary folder we've created to use as our 'workspace'.
44
45 .. code-block:: bash
46
47 cd /tmp
48 mkdir util
49
50
51Next, we're going to create a file named *dcae.vdns.onset.json* and edit it to paste the vDNS ONSET message contents.
52
53 .. code-block:: bash
54
55 touch dcae.vdns.onset.json
Saryu Shahcbc6cd12017-11-08 23:13:31 +000056 vi dcae.vdns.onset.json
Saryu Shah7c24c8a2017-11-08 21:20:04 +000057
58Here are the contents of the vDNS ONSET message. Copy/paste this into dcae.vdns.onset.json:
59
Saryu Shahcbc6cd12017-11-08 23:13:31 +000060 .. code-block:: json
Saryu Shah7c24c8a2017-11-08 21:20:04 +000061
Saryu Shah28d8a3e2018-10-17 00:27:13 +000062 {
63 "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
64 "closedLoopAlarmStart": 1484677482204798,
65 "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
66 "closedLoopEventStatus": "ONSET",
67 "requestID": "e4f95e0c-a013-4530-8e59-c5c5f9e539b6",
68 "target_type": "VNF",
69 "target": "vserver.vserver-name",
70 "AAI": {
71 "vserver.is-closed-loop-disabled": "false",
72 "vserver.prov-status": "ACTIVE",
73 "vserver.vserver-name": "dfw1lb01lb01"
74 },
75 "from": "DCAE",
76 "version": "1.0.2"
Saryu Shahcbc6cd12017-11-08 23:13:31 +000077 }
Saryu Shah28d8a3e2018-10-17 00:27:13 +000078
Saryu Shah7c24c8a2017-11-08 21:20:04 +000079
80
81Enabling the AAI and SO Simulators
82^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83
84Enabling the *controlloop-utils* feature will enable the simulators. To do this, simply stop the drools pdp, enable the feature, and restart the drools pdp like so:
85
86 .. code-block:: bash
87
88 policy stop
89 features enable controlloop-utils
90 policy start
91
92Now, in */opt/app/policy/config/* directory, you should see a new properties file named *simulators.properties.environment*. In here you will find the credentials for the AAI and SO simulators.
93
94Injecting an ONSET to trigger the vDNS Flow
95^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96
97We are now ready to inject an ONSET message to trigger the vDNS flow. Simply navigate back to the directory *dcae.vdns.onset.json* file is saved (i.e. cd /tmp/util) and run this curl command:
98
99 .. code-block:: bash
100
Saryu Shah28d8a3e2018-10-17 00:27:13 +0000101 http --verify=no --default-scheme=https -a @1b3rt:31nst31n PUT :9696/policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events @dcae.vdns.onset.json Content-Type:"text/plain"
Saryu Shah7c24c8a2017-11-08 21:20:04 +0000102
103You should see some output similar to this:
104
Saryu Shah28d8a3e2018-10-17 00:27:13 +0000105 .. image:: tutorial_vDNS_1.png
Saryu Shah7c24c8a2017-11-08 21:20:04 +0000106
107You can view the logs to see the network activity or find any errors that may have occurred. Logs are located in */opt/app/policy/logs*.
108
109Reading the logs
110^^^^^^^^^^^^^^^^
111
112Once you've injected the onset message, this should appear in the network.log:
113
Saryu Shah28d8a3e2018-10-17 00:27:13 +0000114 .. image:: tutorial_vDNS_2.png
Saryu Shah7c24c8a2017-11-08 21:20:04 +0000115
116
117End of Document
118
Saryu Shah28d8a3e2018-10-17 00:27:13 +0000119.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Tutorial%3A+Testing+the+vDNS+Use+Case+in+a+standalone+PDP-D