Merge "user guide demo for monitoring gui"
[policy/parent.git] / docs / drools / tutorial_vDNS.rst
1
2 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4
5 *********************************************************
6 Tutorial: Testing the vDNS Use Case in a standalone PDP-D
7 *********************************************************
8
9 .. contents::
10     :depth: 3
11
12 In this tutorial we will test the vDNS flow in a standalone PDP-D docker container.
13
14 Initial Setup
15 ^^^^^^^^^^^^^
16
17 It is assumed that the set up steps from section
18 *Using the Control Loop PDP-D docker image for standalone testing* has been followed for
19 this tutorial.
20
21 Running the Flow
22 ^^^^^^^^^^^^^^^^
23
24 **Step 1:** Deploy the vDNS Operational Policy.
25
26     .. code-block:: bash
27
28         cat pdp-update-vdns.json
29         {
30           "policies": [
31              {
32              "type": "onap.policies.controlloop.Operational",
33              "type_version": "1.0.0",
34              "properties": {
35              "content": "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A%20%20services%3A%0A%20%20%20%20-%20serviceName%3A%20d4738992-6497-4dca-9db9%0A%20%20%20%20%20%20serviceInvariantUUID%3A%20dc112d6e-7e73-4777-9c6f-1a7fb5fd1b6f%0A%20%20%20%20%20%20serviceUUID%3A%202eea06c6-e1d3-4c3a-b9c4-478c506eeedf%0A%20%20trigger_policy%3A%20unique-policy-id-1-scale-up%0A%20%20timeout%3A%2060%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20name%3A%20Create%20a%20new%20VF%20Module%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20SO%0A%20%20%20%20recipe%3A%20VF%20Module%20Create%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VFMODULE%0A%20%20%20%20%20%20modelInvariantId%3A%2090b793b5-b8ae-4c36-b10b-4b6372859d3a%0A%20%20%20%20%20%20modelVersionId%3A%202210154d-e61a-4d7f-8fb9-0face1aee3f8%0A%20%20%20%20%20%20modelName%3A%20SproutScalingVf..scaling_sprout..module-1%0A%20%20%20%20%20%20modelVersion%3A%201%0A%20%20%20%20%20%20modelCustomizationId%3A%203e2d67ad-3495-4732-82f6-b0b872791fff%0A%20%20%20%20payload%3A%0A%20%20%20%20%20%20requestParameters%3A%20%27%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D%27%0A%20%20%20%20%20%20configurationParameters%3A%20%27%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D%27%0A%20%20%20%20retry%3A%200%0A%20%20%20%20timeout%3A%2030%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard%0A"
36              },
37              "name": "operational.scaleout",
38              "version": "1.0.0"
39              }
40            ],
41            "messageName": "PDP_UPDATE",
42            "requestId": "a7a32d3b-37b4-4fb7-9322-b90c6a6fe365",
43            "timestampMs": 1556125347251,
44            "name": "pdpd",
45            "pdpGroup": "controlloop",
46            "pdpSubgroup": "drools"
47         }
48
49         http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/POLICY-PDP-PAP/events @pdp-update-vdns.json Content-Type:'text/plain'
50
51         telemetry
52         > get controllers/usecases/drools/facts/usecases/controlloops
53         > get controllers/usecases/drools/facts/usecases/controlloops/ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
54
55 **Step 2:** Inject a simulated *ONSET* message.
56
57     .. code-block:: bash
58
59         cat dcae.vdns.onset.json
60         {
61           "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
62           "closedLoopAlarmStart": 1484677482204798,
63           "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
64           "closedLoopEventStatus": "ONSET",
65           "requestID": "e4f95e0c-a013-4530-8e59-c5c5f9e539b6",
66           "target_type": "VNF",
67           "target": "vserver.vserver-name",
68           "AAI": {
69             "vserver.is-closed-loop-disabled": "false",
70             "vserver.prov-status": "ACTIVE",
71             "vserver.vserver-name": "dfw1lb01lb01"
72           },
73           "from": "DCAE",
74           "version": "1.0.2"
75         }
76
77         http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/DCAE_TOPIC/switches/activation    # activate noop source
78
79         http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/DCAE_TOPIC/events @dcae.vdns.onset.json Content-Type:'text/plain'   # send onset
80
81 The network log can be used to monitor the PDP-D network input/output operations. This log is located at *$POLICY_LOGS/network.log*.  The log file will show interactions with the AAI and SO simulator to fulfill the flow.  Once the transaction has completed, a final success notification will be recorded in this file.
82
83     .. code-block:: bash
84
85         {
86           "AAI": {
87             "vserver.prov-status": "ACTIVE",
88             "vserver.is-closed-loop-disabled": "false",
89             "vserver.vserver-name": "dfw1lb01lb01"
90           },
91           "closedLoopAlarmStart": 1484677482204798,
92           "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
93           "version": "1.0.2",
94           "requestId": "e4f95e0c-a013-4530-8e59-c5c5f9e539b6",
95           "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca",
96           "targetType": "VNF",
97           "target": "vserver.vserver-name",
98           "from": "policy:usecases",
99           "policyScope": "onap.policies.controlloop.Operational:1.0.0",
100           "policyName": "operational.scaleout.EVENT.MANAGER",
101           "policyVersion": "1.0.0",
102           "notification": "FINAL: SUCCESS",
103           "notificationTime": "2019-06-24 20:52:16.370000+00:00",
104           "history": [
105             {
106               "actor": "SO",
107               "operation": "VF Module Create",
108               "target": "Target [type=VFMODULE, resourceId=null]",
109               "start": 1561409536125,
110               "end": 1561409536368,
111               "subRequestId": "1",
112               "outcome": "Success",
113               "message": "200 Success"
114             }
115           ]
116         }
117
118 End of Document