diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2019-06-04 12:02:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-06-04 12:02:35 +0000 |
commit | e0c35e720daba281e20e3e028f9d65fff3ec3b8b (patch) | |
tree | 82e2f7f7418be6d0f3699e580b1c68ada6df1bfa | |
parent | 20e78d75bc091b1ca11e446659ab3322d47cc98d (diff) | |
parent | f93b44eb98be35cdd1b58d11681a54d625f47266 (diff) |
Merge "Create Drools PDP documentation - Tutorials"
89 files changed, 1707 insertions, 0 deletions
diff --git a/docs/drools/RunEcl_console_output.png b/docs/drools/RunEcl_console_output.png Binary files differnew file mode 100755 index 00000000..d2c39439 --- /dev/null +++ b/docs/drools/RunEcl_console_output.png diff --git a/docs/drools/RunEcl_drools_pdp_project.png b/docs/drools/RunEcl_drools_pdp_project.png Binary files differnew file mode 100755 index 00000000..bafb94ea --- /dev/null +++ b/docs/drools/RunEcl_drools_pdp_project.png diff --git a/docs/drools/RunEcl_main.png b/docs/drools/RunEcl_main.png Binary files differnew file mode 100755 index 00000000..9dec695f --- /dev/null +++ b/docs/drools/RunEcl_main.png diff --git a/docs/drools/RunEcl_pdpd_200.png b/docs/drools/RunEcl_pdpd_200.png Binary files differnew file mode 100755 index 00000000..32e4e5ed --- /dev/null +++ b/docs/drools/RunEcl_pdpd_200.png diff --git a/docs/drools/RunEcl_run_as.png b/docs/drools/RunEcl_run_as.png Binary files differnew file mode 100755 index 00000000..579dc4db --- /dev/null +++ b/docs/drools/RunEcl_run_as.png diff --git a/docs/drools/RunEcl_telemetry.png b/docs/drools/RunEcl_telemetry.png Binary files differnew file mode 100755 index 00000000..ae4f65cc --- /dev/null +++ b/docs/drools/RunEcl_telemetry.png diff --git a/docs/drools/Tut_cl_confirmAndDirectory.PNG b/docs/drools/Tut_cl_confirmAndDirectory.PNG Binary files differnew file mode 100755 index 00000000..cdb84a89 --- /dev/null +++ b/docs/drools/Tut_cl_confirmAndDirectory.PNG diff --git a/docs/drools/Tut_cl_finalStep.PNG b/docs/drools/Tut_cl_finalStep.PNG Binary files differnew file mode 100755 index 00000000..b56b06e4 --- /dev/null +++ b/docs/drools/Tut_cl_finalStep.PNG diff --git a/docs/drools/Tut_cl_preDeploy.PNG b/docs/drools/Tut_cl_preDeploy.PNG Binary files differnew file mode 100755 index 00000000..69a2cdb1 --- /dev/null +++ b/docs/drools/Tut_cl_preDeploy.PNG diff --git a/docs/drools/Tut_cl_propFile.PNG b/docs/drools/Tut_cl_propFile.PNG Binary files differnew file mode 100755 index 00000000..960e182d --- /dev/null +++ b/docs/drools/Tut_cl_propFile.PNG diff --git a/docs/drools/Tut_cl_valuesHighlight.png b/docs/drools/Tut_cl_valuesHighlight.png Binary files differnew file mode 100755 index 00000000..7a4bb790 --- /dev/null +++ b/docs/drools/Tut_cl_valuesHighlight.png diff --git a/docs/drools/Tut_vCPE_appc_request.JPG b/docs/drools/Tut_vCPE_appc_request.JPG Binary files differnew file mode 100755 index 00000000..75d8848a --- /dev/null +++ b/docs/drools/Tut_vCPE_appc_request.JPG diff --git a/docs/drools/Tut_vCPE_final_memory.JPG b/docs/drools/Tut_vCPE_final_memory.JPG Binary files differnew file mode 100755 index 00000000..f68aac79 --- /dev/null +++ b/docs/drools/Tut_vCPE_final_memory.JPG diff --git a/docs/drools/Tut_vCPE_get_facts.JPG b/docs/drools/Tut_vCPE_get_facts.JPG Binary files differnew file mode 100755 index 00000000..27637257 --- /dev/null +++ b/docs/drools/Tut_vCPE_get_facts.JPG diff --git a/docs/drools/Tut_vCPE_get_facts_2.JPG b/docs/drools/Tut_vCPE_get_facts_2.JPG Binary files differnew file mode 100755 index 00000000..4bf8e9f3 --- /dev/null +++ b/docs/drools/Tut_vCPE_get_facts_2.JPG diff --git a/docs/drools/Tut_vCPE_guard_not_queried.JPG b/docs/drools/Tut_vCPE_guard_not_queried.JPG Binary files differnew file mode 100755 index 00000000..14e52e79 --- /dev/null +++ b/docs/drools/Tut_vCPE_guard_not_queried.JPG diff --git a/docs/drools/Tut_vCPE_guard_result.JPG b/docs/drools/Tut_vCPE_guard_result.JPG Binary files differnew file mode 100755 index 00000000..b1818d39 --- /dev/null +++ b/docs/drools/Tut_vCPE_guard_result.JPG diff --git a/docs/drools/Tut_vCPE_inject_appc_response.JPG b/docs/drools/Tut_vCPE_inject_appc_response.JPG Binary files differnew file mode 100755 index 00000000..6f5f21ba --- /dev/null +++ b/docs/drools/Tut_vCPE_inject_appc_response.JPG diff --git a/docs/drools/Tut_vCPE_insert_abatement.JPG b/docs/drools/Tut_vCPE_insert_abatement.JPG Binary files differnew file mode 100755 index 00000000..d0da4d5d --- /dev/null +++ b/docs/drools/Tut_vCPE_insert_abatement.JPG diff --git a/docs/drools/Tut_vCPE_insert_onset.JPG b/docs/drools/Tut_vCPE_insert_onset.JPG Binary files differnew file mode 100755 index 00000000..0316609a --- /dev/null +++ b/docs/drools/Tut_vCPE_insert_onset.JPG diff --git a/docs/drools/Tut_vCPE_policy_active.JPG b/docs/drools/Tut_vCPE_policy_active.JPG Binary files differnew file mode 100755 index 00000000..02544f41 --- /dev/null +++ b/docs/drools/Tut_vCPE_policy_active.JPG diff --git a/docs/drools/Tut_vCPE_policy_final_success.JPG b/docs/drools/Tut_vCPE_policy_final_success.JPG Binary files differnew file mode 100755 index 00000000..f063d09c --- /dev/null +++ b/docs/drools/Tut_vCPE_policy_final_success.JPG diff --git a/docs/drools/Tut_vCPE_policy_operation.JPG b/docs/drools/Tut_vCPE_policy_operation.JPG Binary files differnew file mode 100755 index 00000000..1666ea62 --- /dev/null +++ b/docs/drools/Tut_vCPE_policy_operation.JPG diff --git a/docs/drools/Tut_vCPE_policy_operation_success.JPG b/docs/drools/Tut_vCPE_policy_operation_success.JPG Binary files differnew file mode 100755 index 00000000..9206847f --- /dev/null +++ b/docs/drools/Tut_vCPE_policy_operation_success.JPG diff --git a/docs/drools/Tut_vCPE_policy_start.JPG b/docs/drools/Tut_vCPE_policy_start.JPG Binary files differnew file mode 100755 index 00000000..91be90e6 --- /dev/null +++ b/docs/drools/Tut_vCPE_policy_start.JPG diff --git a/docs/drools/Tut_vCPE_simulated_abatement.JPG b/docs/drools/Tut_vCPE_simulated_abatement.JPG Binary files differnew file mode 100755 index 00000000..2133ff85 --- /dev/null +++ b/docs/drools/Tut_vCPE_simulated_abatement.JPG diff --git a/docs/drools/Tut_vCPE_simulated_appc_response.JPG b/docs/drools/Tut_vCPE_simulated_appc_response.JPG Binary files differnew file mode 100755 index 00000000..3d90e04d --- /dev/null +++ b/docs/drools/Tut_vCPE_simulated_appc_response.JPG diff --git a/docs/drools/Tut_vCPE_simulated_onset.JPG b/docs/drools/Tut_vCPE_simulated_onset.JPG Binary files differnew file mode 100755 index 00000000..a50b3c29 --- /dev/null +++ b/docs/drools/Tut_vCPE_simulated_onset.JPG diff --git a/docs/drools/Tut_vCPE_simulators_enabled.JPG b/docs/drools/Tut_vCPE_simulators_enabled.JPG Binary files differnew file mode 100755 index 00000000..8cd9902d --- /dev/null +++ b/docs/drools/Tut_vCPE_simulators_enabled.JPG diff --git a/docs/drools/Tut_vFW_aai_get.JPG b/docs/drools/Tut_vFW_aai_get.JPG Binary files differnew file mode 100755 index 00000000..1b00d60b --- /dev/null +++ b/docs/drools/Tut_vFW_aai_get.JPG diff --git a/docs/drools/Tut_vFW_aai_named_query_request.JPG b/docs/drools/Tut_vFW_aai_named_query_request.JPG Binary files differnew file mode 100755 index 00000000..c7f86f93 --- /dev/null +++ b/docs/drools/Tut_vFW_aai_named_query_request.JPG diff --git a/docs/drools/Tut_vFW_aai_named_query_response.JPG b/docs/drools/Tut_vFW_aai_named_query_response.JPG Binary files differnew file mode 100755 index 00000000..b3a9fa94 --- /dev/null +++ b/docs/drools/Tut_vFW_aai_named_query_response.JPG diff --git a/docs/drools/Tut_vFW_appc_request.JPG b/docs/drools/Tut_vFW_appc_request.JPG Binary files differnew file mode 100755 index 00000000..737719f7 --- /dev/null +++ b/docs/drools/Tut_vFW_appc_request.JPG diff --git a/docs/drools/Tut_vFW_final_memory.JPG b/docs/drools/Tut_vFW_final_memory.JPG Binary files differnew file mode 100755 index 00000000..f68aac79 --- /dev/null +++ b/docs/drools/Tut_vFW_final_memory.JPG diff --git a/docs/drools/Tut_vFW_get_facts.JPG b/docs/drools/Tut_vFW_get_facts.JPG Binary files differnew file mode 100755 index 00000000..27637257 --- /dev/null +++ b/docs/drools/Tut_vFW_get_facts.JPG diff --git a/docs/drools/Tut_vFW_get_facts_2.JPG b/docs/drools/Tut_vFW_get_facts_2.JPG Binary files differnew file mode 100755 index 00000000..4bf8e9f3 --- /dev/null +++ b/docs/drools/Tut_vFW_get_facts_2.JPG diff --git a/docs/drools/Tut_vFW_insert_appc_response.JPG b/docs/drools/Tut_vFW_insert_appc_response.JPG Binary files differnew file mode 100755 index 00000000..d631603c --- /dev/null +++ b/docs/drools/Tut_vFW_insert_appc_response.JPG diff --git a/docs/drools/Tut_vFW_onset_injected.JPG b/docs/drools/Tut_vFW_onset_injected.JPG Binary files differnew file mode 100755 index 00000000..ebff2e36 --- /dev/null +++ b/docs/drools/Tut_vFW_onset_injected.JPG diff --git a/docs/drools/Tut_vFW_policy_active.JPG b/docs/drools/Tut_vFW_policy_active.JPG Binary files differnew file mode 100755 index 00000000..d3530a74 --- /dev/null +++ b/docs/drools/Tut_vFW_policy_active.JPG diff --git a/docs/drools/Tut_vFW_policy_final_success.JPG b/docs/drools/Tut_vFW_policy_final_success.JPG Binary files differnew file mode 100755 index 00000000..bdb7858b --- /dev/null +++ b/docs/drools/Tut_vFW_policy_final_success.JPG diff --git a/docs/drools/Tut_vFW_policy_guard_result.JPG b/docs/drools/Tut_vFW_policy_guard_result.JPG Binary files differnew file mode 100755 index 00000000..89a2f4f8 --- /dev/null +++ b/docs/drools/Tut_vFW_policy_guard_result.JPG diff --git a/docs/drools/Tut_vFW_policy_guard_start.JPG b/docs/drools/Tut_vFW_policy_guard_start.JPG Binary files differnew file mode 100755 index 00000000..1aa5490a --- /dev/null +++ b/docs/drools/Tut_vFW_policy_guard_start.JPG diff --git a/docs/drools/Tut_vFW_policy_operation_start.JPG b/docs/drools/Tut_vFW_policy_operation_start.JPG Binary files differnew file mode 100755 index 00000000..0203c93a --- /dev/null +++ b/docs/drools/Tut_vFW_policy_operation_start.JPG diff --git a/docs/drools/Tut_vFW_policy_operation_success.JPG b/docs/drools/Tut_vFW_policy_operation_success.JPG Binary files differnew file mode 100755 index 00000000..8e4b8e18 --- /dev/null +++ b/docs/drools/Tut_vFW_policy_operation_success.JPG diff --git a/docs/drools/Tut_vFW_policy_start.JPG b/docs/drools/Tut_vFW_policy_start.JPG Binary files differnew file mode 100755 index 00000000..91be90e6 --- /dev/null +++ b/docs/drools/Tut_vFW_policy_start.JPG diff --git a/docs/drools/Tut_vFW_simulated_appc_response.JPG b/docs/drools/Tut_vFW_simulated_appc_response.JPG Binary files differnew file mode 100755 index 00000000..8ceb89cf --- /dev/null +++ b/docs/drools/Tut_vFW_simulated_appc_response.JPG diff --git a/docs/drools/Tut_vFW_simulated_onset.JPG b/docs/drools/Tut_vFW_simulated_onset.JPG Binary files differnew file mode 100755 index 00000000..b6d40113 --- /dev/null +++ b/docs/drools/Tut_vFW_simulated_onset.JPG diff --git a/docs/drools/Tut_vFW_simulators_enabled.JPG b/docs/drools/Tut_vFW_simulators_enabled.JPG Binary files differnew file mode 100755 index 00000000..8cd9902d --- /dev/null +++ b/docs/drools/Tut_vFW_simulators_enabled.JPG diff --git a/docs/drools/clsimulation.rst b/docs/drools/clsimulation.rst new file mode 100644 index 00000000..8182ebb5 --- /dev/null +++ b/docs/drools/clsimulation.rst @@ -0,0 +1,696 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +********************************************************** +Control Loop Simulation and Injection of Messages Overview +********************************************************** + +.. contents:: + :depth: 2 + +Telemetry +^^^^^^^^^ +The username and password for the Telemetry commands are in *${POLCIY_HOME}/config/policy-engine.properties*. + +Injecting messages: +------------------- + +To inject messages use the following command. The injected message will look as if it came in from the specified topic and will be processed accordingly. + +Use the command: + + .. code-block:: bash + + http --verify=no --default-scheme=https -a <userName>:<password> PUT :9696/policy/pdp/engine/topics/sources/ueb/<topic>/events @<onsetFile> Content-Type:"text/plain" + +Alternatively, this command could be used: + + .. code-block:: bash + + curl --insecure --silent --user <userName>:<password> -X PUT --header "Content-Type: text/plain" --data @<onsetFile> https://localhost:9696/policy/pdp/engine/topics/sources/ueb/<topic>/events + +The topic being used is *unauthenticated.DCAE_CL_OUTPUT*, which is subject to change. The onset file is a file that contains the data to inject as the onset. The data contained depends on the use case. This is an example for VoLTE: + + .. code-block:: json + :caption: VoLTE_Sample_Onset + + { + "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", + "closedLoopAlarmStart": 1484677482204798, + "closedLoopEventClient": "DCAE.HolmesInstance", + "closedLoopEventStatus": "ONSET", + "requestID": "97964e10-686e-4790-8c45-bdfa61df770f", + "target_type": "VM", + "target": "vserver.vserver-name", + "AAI": { + "vserver.is-closed-loop-disabled": "false", + "vserver.vserver-name": "dfw1lb01lb01", + "service-instance.service-instance-id" : "vserver-name-16102016-aai3255-data-11-1", + "generic-vnf.vnf-id" : "vnf-id-16102016-aai3255-data-11-1", + "generic-vnf.vnf-name" : "vnf-name-16102016-aai3255-data-11-1" + }, + "from": "DCAE", + "version": "1.0.2" + } + +Getting Information +------------------- + +To get the name of the active controller(s), use: + + .. code-block:: bash + + curl --insecure --silent --user <username>:<password> -X GET https://localhost:9696/policy/pdp/engine/controllers | python -m json.tool + +To check the facts currently in memory, use the following command. There should be 1 each of org.onap.policy.controlloop.PapParams and org.onap.policy.controlloop.Params per policy pushed. + + .. code-block:: bash + + curl --insecure --silent --user <username>:<password> -X GET https://localhost:9696/policy/pdp/engine/controllers/<controllerName>/drools/facts/<artifactId> | python -m json.tool + +To get additional information about the controller, use: + + .. code-block:: bash + + curl --insecure --silent --user <username>:<password> -X GET https://localhost:9696/policy/pdp/engine/controllers/<controllerName> | python -m json.tool + + +Simulators +^^^^^^^^^^ + +Currently, there are 4 supported simulators: A&AI, SO, vFC, and guard. When they are up, they are accessed via localhost on the following ports: A&AI – 6666, SO – 6667, vFC – 6668, and guard – 6669. They all respond with hard-coded values representing their various success messages except for with certain inputs. For the A&AI simulator, if the value being queried with a “GET” query is “getFail” the simulator returns an exception message, if the value being queried in a “GET” query is “disableClosedLoop” the simulator returns a response with the value of “is-closed-loop-disabled” set to true, and if the value being queried in a named query is “error” the response from the simulator is A&AI’s failure message. The other simulator that can return multiple response is the guard simulator, and that returns a deny response if the closed loop control name passed in is “denyGuard” + +Using the Simulators +-------------------- + +To check the status of the simulators, run the command: "*features status*". If the feature controlloop-utils is enabled, the simulators are being used, otherwise, they are not. + +**Turning on the simulators** + + - First, make sure the controller is off by running the command “*policy stop*”. + - Then turn the feature on with the command “*features enable controlloop-utils*”. + - Finally restart the controller by running “*policy start*”. + - Run “*features status*” again and the *feature controlloop-utils* will be **enabled**. + +**Turning the simulators off** + + - First, make sure the controller is off by running the command “*policy stop*”. + - Then turn the feature off with the command “*features disable controlloop-utils*”. + - Finally restart the controller by running “*policy start*”. + - Run “*features status*” again and the *feature controlloop-utils* will be **disabled**. + +**For Junits** + + For Junits, the package *org.onap.policy.simulators* is neeeded. In the Util class, there are four methods to start the four different simulators: *buildAaiSim()*, *buildSoSim()*, *buildVfcSim()*, and *buildGuardSim()*. Once the method is called, the simulator should be up and waiting to respond to requests. To bring down the simulators, call *HttpServletServer.factory.destroy()*. + +Responses +--------- + +**A&AI** + + .. code-block:: bash + :caption: vnf-GET-response + + { + "vnf-id": vnfId, //vnfId will be the vnfId you query on. If you query on a vnfName, the id will be "error" if the name is "error", "5e49ca06-2972-4532-9ed4-6d071588d792" otherwise + "vnf-name": vnfName, //vnfName will be the vnfName you query on. If you query on a vnfId, the name will be "USUCP0PCOIL0110UJRT01" + "vnf-type": "RT", + "service-id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "equipment-role": "UCPE", + "orchestration-status": "created", + "management-option": "ATT", + "ipv4-oam-address": "32.40.68.35", + "ipv4-loopback0-address": "32.40.64.57", + "nm-lan-v6-address": "2001:1890:e00e:fffe::1345", + "management-v6-address": "2001:1890:e00e:fffd::36", + "in-maint": false, + "prov-status":"ACTIVE", + "is-closed-loop-disabled": isDisabled, //isDisabled will be true if the vnf name/Id you query on is disableClosedLoop, false otherwise + "resource-version": "1493389458092", + "relationship-list": { + "relationship": [{ + "related-to": "service-instance", + "related-link": "/aai/v11/business/customers/customer/1610_Func_Global_20160817084727/service-subscriptions/service-subscription/uCPE-VMS/service-instances/service-instance/USUCP0PCOIL0110UJZZ01", + "relationship-data": [{ + "relationship-key": "customer.global-customer-id", + "relationship-value": "1610_Func_Global_20160817084727" + }, { + "relationship-key": "service-subscription.service-type", + "relationship-value": "uCPE-VMS" + }, { + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "USUCP0PCOIL0110UJZZ01" + }], + "related-to-property": [{ + "property-key": "service-instance.service-instance-name" + }] + }, { + "related-to": "vserver", + "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/USUCP0PCOIL0110UJZZ01%3A%3AuCPE-VMS/vservers/vserver/3b2558f4-39d8-40e7-bfc7-30660fb52c45", + "relationship-data": [{ + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "att-aic" + }, { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIAIC25" + }, { + "relationship-key": "tenant.tenant-id", + "relationship-value": "USUCP0PCOIL0110UJZZ01::uCPE-VMS" + }, { + "relationship-key": "vserver.vserver-id", + "relationship-value": "3b2558f4-39d8-40e7-bfc7-30660fb52c45" + }], + "related-to-property": [{ + "property-key": "vserver.vserver-name", + "property-value": "USUCP0PCOIL0110UJZZ01-vsrx" + }] + }] + } + + + .. code-block:: bash + :caption: vnf-GET-fail + + //This is returned if you query on the value "getFail" + { + "requestError": { + "serviceException": { + "messageId": "SVC3001", + "text": "Resource not found for %1 using id %2 (msg=%3) (ec=%4)", + "variables": ["GET", "network/generic-vnfs/generic-vnf/getFail", "Node Not Found:No Node of type generic-vnf found at network/generic-vnfs/generic-vnf/getFail", "ERR.5.4.6114"] + } + } + } + + + .. code-block:: bash + :caption: vserver-GET-response + + { + "vserver": [{ + "vserver-id": "d0668d4f-c25e-4a1b-87c4-83845c01efd8", + "vserver-name": vserverName, // The value you query on + "vserver-name2": "vjunos0", + "vserver-selflink": "https://aai-ext1.test.att.com:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/att-aic/AAIAIC25/tenants/tenant/USMSO1SX7NJ0103UJZZ01%3A%3AuCPE-VMS/vservers/vserver/d0668d4f-c25e-4a1b-87c4-83845c01efd8", + "in-maint": false, + "prov-status":"ACTIVE", + "is-closed-loop-disabled": isDisabled, // True if the vserverName is "disableClosedLoop", false otherwise + "resource-version": "1494001931513", + "relationship-list": { + "relationship": [{ + "related-to": "generic-vnf", + "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/e1a41e99-4ede-409a-8f9d-b5e12984203a", + "relationship-data": [{ + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "e1a41e99-4ede-409a-8f9d-b5e12984203a" + }], + "related-to-property": [{ + "property-key": "generic-vnf.vnf-name", + "property-value": "USMSO1SX7NJ0103UJSW01" + }] + }, { + "related-to": "pserver", + "related-link": "/aai/v11/cloud-infrastructure/pservers/pserver/USMSO1SX7NJ0103UJZZ01", + "relationship-data": [{ + "relationship-key": "pserver.hostname", + "relationship-value": "USMSO1SX7NJ0103UJZZ01" + }], + "related-to-property": [{ + "property-key": "pserver.pserver-name2" + }] + }] + } + }] + } + + + .. code-block:: bash + :caption: vserver-GET-error + + //This is returned if you query on the value "getFail" + { + "requestError": { + "serviceException": { + "messageId": "SVC3001", + "text": "Resource not found for %1 using id %2 (msg=%3) (ec=%4)", + "variables": ["GET", "nodes/vservers", "Node Not Found:No Node of type generic-vnf found at nodes/vservers", "ERR.5.4.6114"] + } + } + } + + + .. code-block:: bash + :caption: vnf-NamedQuery-response + + { + "inventory-response-item": [ + { + "model-name": "service-instance", + "generic-vnf": { + "vnf-id": "vnfId", //vnfId will be the vnfId you query on + "vnf-name": "ZRDM2MMEX39", + "vnf-type": "vMME Svc Jul 14/vMME VF Jul 14 1", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "ACTIVE", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1503082370097", + "model-invariant-id": "82194af1-3c2c-485a-8f44-420e22a9eaa4", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9" + }, + "extra-properties": { + "extra-property": [] + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "service-instance", + "service-instance": { + "service-instance-id": "37b8cdb7-94eb-468f-a0c2-4e3c3546578e", + "service-instance-name": "Changed Service Instance NAME", + "resource-version": "1503082993532", + "model-invariant-id": "82194af1-3c2c-485a-8f44-420e22a9eaa4", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9" + }, + "extra-properties": { + "extra-property": [] + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "pnf", + "generic-vnf": { + "vnf-id": "pnfVnfId", // pnfVnfId is UUID generated from ${pnfVnfName} + "vnf-name": "pnfVnfName", // pnfVnfName is pnf-test-${vnfId} + "vnf-type": "vMME Svc Jul 14/vMME VF Jul 14 1", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1504013830207", + "model-invariant-id": "862b25a1-262a-4961-bdaa-cdc55d69785a", + "model-version-id": "e9f1fa7d-c839-418a-9601-03dc0d2ad687" + }, + "extra-properties": { + "extra-property": [] + } + }, + { + "model-name": "service-instance", + "generic-vnf": { + "vnf-id": "serviceInstanceVnfId", // serviceInstanceVnfId is UUID generated from ${serviceInstanceVnfName} + "vnf-name": "serviceInstanceVnfName", // serviceInstanceVnfName is service-instance-test-${vnfId} + "vnf-type": "vMME Svc Jul 14/vMME VF Jul 14 1", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1504014833841", + "model-invariant-id": "Eace933104d443b496b8.nodes.heat.vpg", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9" + }, + "extra-properties": { + "extra-property": [] + } + } + ] + } + } + ] + } + } + ] + } + + + .. code-block:: bash + :caption: vserver-NamedQuery-response + + { + "inventory-response-item": [ + { + "vserver": { + "vserver-id": "6ed3642c-f7a1-4a7c-9290-3d51fe1531eb", + "vserver-name": "zdfw1lb01lb02", + "vserver-name2": "zdfw1lb01lb02", + "prov-status": "ACTIVE", + "vserver-selflink": "http://10.12.25.2:8774/v2.1/41d6d38489bd40b09ea8a6b6b852dcbd/servers/6ed3642c-f7a1-4a7c-9290-3d51fe1531eb", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1510606403522" + }, + "extra-properties": { + "extra-property": [] + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vLoadBalancer", + "generic-vnf": { + "vnf-id": "db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "vnf-name": "Vfmodule_vLB1113", + "vnf-type": "vLoadBalancer-1106/vLoadBalancer 0", + "service-id": "66f157fc-4148-4880-95f5-e120677e98d1", + "prov-status": "PREPROV", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1510604011851", + "model-invariant-id": "cee050ed-92a5-494f-ab04-234307a846dc", + "model-version-id": "fd65becc-6b2c-4fe8-ace9-cc29db9a3da2" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "fd65becc-6b2c-4fe8-ace9-cc29db9a3da2" + }, + { + "property-name": "model-ver.model-name", + "property-value": "vLoadBalancer" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "cee050ed-92a5-494f-ab04-234307a846dc" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1.0" + } + ] + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vLoadBalancer-1106", + "service-instance": { + "service-instance-id": "3b12f31f-8f2d-4f5c-b875-61ff1194b941", + "service-instance-name": "vLoadBalancer-1113", + "resource-version": "1510603936425", + "model-invariant-id": "1321d60d-f7ff-4300-96c2-6bf0b3268b7a", + "model-version-id": "732d4692-4b97-46f9-a996-0b3339e88c50" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "732d4692-4b97-46f9-a996-0b3339e88c50" + }, + { + "property-name": "model-ver.model-name", + "property-value": "vLoadBalancer-1106" + }, + { + "property-name": "model.model-type", + "property-value": "service" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "1321d60d-f7ff-4300-96c2-6bf0b3268b7a" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1.0" + } + ] + } + }, + { + "model-name": "Vloadbalancer..base_vlb..module-0", + "vf-module": { + "vf-module-id": "e6b3e3eb-34e1-4c00-b8c1-2a4fbe479b12", + "vf-module-name": "Vfmodule_vLB1113-1", + "heat-stack-id": "Vfmodule_vLB1113-1/3dd6d900-772f-4fcc-a0cb-e250ab2bb4db", + "orchestration-status": "active", + "is-base-vf-module": true, + "resource-version": "1510604612557", + "model-invariant-id": "6d760188-9a24-451a-b05b-e08b86cb94f2", + "model-version-id": "93facad9-55f2-4fe0-9574-814c2bc2d071" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "93facad9-55f2-4fe0-9574-814c2bc2d071" + }, + { + "property-name": "model-ver.model-name", + "property-value": "Vloadbalancer..base_vlb..module-0" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "6d760188-9a24-451a-b05b-e08b86cb94f2" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1" + } + ] + } + }, + { + "model-name": "Vloadbalancer..dnsscaling..module-1", + "vf-module": { + "vf-module-id": "dummy_db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "vf-module-name": "dummy_db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "is-base-vf-module": false, + "resource-version": "1510610079687", + "model-invariant-id": "356a1cff-71f2-4086-9980-a2927ce11c1c", + "model-version-id": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + { + "property-name": "model-ver.model-name", + "property-value": "Vloadbalancer..dnsscaling..module-1" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "356a1cff-71f2-4086-9980-a2927ce11c1c" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1" + } + ] + } + }, + { + "model-name": "Vloadbalancer..dnsscaling..module-1", + "vf-module": { + "vf-module-id": "my_module_db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "vf-module-name": "my_module_1", + "is-base-vf-module": false, + "resource-version": "1510610079687", + "model-invariant-id": "356a1cff-71f2-4086-9980-a2927ce11c1c", + "model-version-id": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + { + "property-name": "model-ver.model-name", + "property-value": "Vloadbalancer..dnsscaling..module-1" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "356a1cff-71f2-4086-9980-a2927ce11c1c" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1" + } + ] + } + }, + { + "model-name": "Vloadbalancer..dnsscaling..module-1", + "vf-module": { + "vf-module-id": "my_module_db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "vf-module-name": "my_module_2", + "is-base-vf-module": false, + "resource-version": "1510610079687", + "model-invariant-id": "356a1cff-71f2-4086-9980-a2927ce11c1c", + "model-version-id": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + { + "property-name": "model-ver.model-name", + "property-value": "Vloadbalancer..dnsscaling..module-1" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "356a1cff-71f2-4086-9980-a2927ce11c1c" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1" + } + ] + } + } + ] + } + }, + { + "tenant": { + "tenant-id": "41d6d38489bd40b09ea8a6b6b852dcbd", + "tenant-name": "Integration-SB-00", + "resource-version": "1509587770200" + }, + "extra-properties": { + "extra-property": [] + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "cloud-region": { + "cloud-owner": "CloudOwner", + "cloud-region-id": "RegionOne", + "cloud-region-version": "v1", + "resource-version": "1509587770092" + }, + "extra-properties": { + "extra-property": [] + } + } + ] + } + } + ] + } + } + ] + } + + + .. code-block:: bash + :caption: NamedQuery-error + + // This is returned if you query the value "error" + { + "requestError": { + "serviceException": { + "messageId": "SVC3001", + "text": "Resource not found for %1 using id %2 (msg=%3) (ec=%4)", + "variables": ["POST Search", "getNamedQueryResponse", "Node Not Found:No Node of type generic-vnf found for properties", "ERR.5.4.6114"] + } + } + } + + +**SO** + + .. code-block:: bash + :caption: SO-response + + { + "requestReferences": { + "requestId":"3e074e0e-5468-48f2-9226-51039d30fe5d" // randomly generated UUID + }, + "request": { + "requestId":"a8f58372-aab2-45b8-9d36-c7a42e701c29", // randomly generated UUID + "requestStatus": { + "percentProgress":0, + "requestState":"COMPLETE", + "wasRolledBack":false + } + } + } + } + + + +**vFC** + + .. code-block:: bash + :caption: vFC-POST-response + + { + "jobId": "1" + } + + + .. code-block:: bash + :caption: vFC-GET-response + + { + "jobId": jobId, //The jod id that you query + "responseDescriptor": { + "progress": "40", + "status": "finished", + "statusDescription": "OMC VMs are decommissioned in VIM", + "errorCode": null, + "responseId": 101, + "responseHistoryList": [{ + "progress": "40", + "status": "proccessing", + "statusDescription": "OMC VMs are decommissioned in VIM", + "errorCode": null, + "responseId": "1" + }, { + "progress": "41", + "status": "proccessing", + "statusDescription": "OMC VMs are decommissioned in VIM", + "errorCode": null, + "responseId": "2" + }] + } + } + + +**GUARD** + + .. code-block:: bash + :caption: permit-response + + { + "decision": "PERMIT", + "details": "Decision Permit. OK!" + } + + + .. code-block:: bash + :caption: deny-response + + //This is returned if the closed loop name is denyGuard + { + "decision": "DENY", + "details": "Decision Deny. You asked for it" + } + + +End of Document + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Control+Loop+Simulation+and+Injection+of+Messages+Overview + diff --git a/docs/drools/droolsTutorialsIndex.rst b/docs/drools/droolsTutorialsIndex.rst index 227db2e9..fbc915ab 100644 --- a/docs/drools/droolsTutorialsIndex.rst +++ b/docs/drools/droolsTutorialsIndex.rst @@ -8,5 +8,16 @@ PDP-D Tutorials .. toctree:: :maxdepth: 1 + clsimulation.rst + guardpdp.rst + modAAIdata.rst + modAmsterTemplate.rst + runningEclipse.rst + tutorial_cl.rst + tutorial_vCPE.rst + tutorial_vDNS.rst + tutorial_vFW.rst + tutorial_VOLTE.rst + End of Document diff --git a/docs/drools/guardpdp.rst b/docs/drools/guardpdp.rst new file mode 100644 index 00000000..797557fc --- /dev/null +++ b/docs/drools/guardpdp.rst @@ -0,0 +1,153 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +************************ +Using guard in the PDP-D +************************ + +.. contents:: + :depth: 2 + +This guide will help configure and test guard connection from PDP-D to PDP-X. This guide assumes that the PDP-D is installed and running policy properly with other properties being set properly. + +Configuration +^^^^^^^^^^^^^ + +Prerequisites +------------- + +Stop Policy, open, and verify the config: + +- Stop policy with *policy stop* +- Open *$POLICY_HOME/config/controlloop.properties.environment* +- Make sure the *sql.db.host*, *sql.db.username* and *sql.db.password* are set correctly + + +Guard Properties +---------------- + +**guard.url** - URL endpoint of the PDP-X which will receive the request. + - For example, *http://pdp:8081/pdp/api/getDecision* will connect to the localhost PDP-X. + - This request requires some configuration for PDP-X properties below. + - For testing this URL before running policy, see Verification below. + +**guard.jdbc.url** - URL of the database location to which the operations history will be written. + - For example, *jdbc:mariadb://mariadb:3306/onap_sdk*. + - Note that the port is included. + - Note that at the end, the database name is used. + +**guard.disabled** - For enabling / disabling guard functionality. + - For example, to enable set it to false. + - When this is set to true, the previous two properties will be ignored. + - If guard is enabled, then the following PDP-X properties must also be set. + + +PDP-X Properties +---------------- + +For testing these properties before running policy, see Verification below. + +**pdpx.host** - URL of the PDP-X + - For example, pdp can be used when PDP-X is on localhost. + +**pdpx.username** - User to authenticate + +**pdpx.password** - User Password + +**pdpx.environment** - Environment making requests + - For example, TEST + +**pdpx.client.username** - Client to authenticate + +**pdpx.client.password** - Client password + + + +Verification +^^^^^^^^^^^^ + +It is recommended to test using CLI tools before running since changing bash command parameters are faster than restarting policy. + +Logs Verification +----------------- +Checking the logs is straight forward. Check the *$POLICY_HOME/logs/error.log* file for the word "*callRESTfulPDP*" for any exceptions thrown. If they are thrown then there was a problem with the connection. +You can also check the *$POLICY_HOME/logs/network.log* file for the word "*Indeterminate*" which implies the connection failed or got a non 200 response code. + +CLI Verification +---------------- + +It can be helpful to test the PDP-X connection using bash commands to make sure that the PDP-X properties are correct and the guard.url property is correct before running policy. + +**Method 1: httpie - CLI, cURL-like tool for humans** + + Using the http command we can make a request directly to PDP-X from the command line. Use the following form: + + .. code-block:: bash + + http + POST pdp:8081/pdp/api/getDecision + Authorization:<yourAuth> ClientAuth:<yourClientAuth> + Environment:<environment> Content-Type:application/json < guard_request.json + + | where: + | *<yourAuth>* is the string generated from user:pass converted to base64 encoding + | (a conversion tool is available at https://www.base64encode.org/) + | *<yourClientAuth>* is generated the same way but from the client user and pass. + | *<environment>* is the context of the request. For example: TEST + | *pdp* is the host of the PDP-X + + + The guard_request.json should be in the form of the following: + + .. code-block:: json + :caption: guard_request.json + + { + "decisionAttributes": { + "actor": "APPC", + "recipe": "Restart", + "target": "test13", + "clname" : "piptest" + }, + "onapName": "PDPD" + } + + * This request uses Basic Access Authentication. + * This request will need further configuration if you are using a proxy. + + + You know a successful connection is set when a response containing a “PERMIT” or “DENY” in uppercase is returned as follows: + + .. code-block:: json + :caption: Response + + { + "decision": "PERMIT", + "details": "Decision Permit. OK!" + } + +**Method 2: curl** + + This method does the same as the http command but uses the alternate command of curl. The command should have the following form: + + .. code-block:: bash + + curl -u <user>:<pass> -H "Content-Type: application/json" -H "ClientAuth:<yourClientAuth>" + -H "Environment:<environment>" -X POST -d @guard_req.json pdp:8081/pdp/api/getDecision + + * Note that <user> and <pass> are in plain text, while the other headers follow the same form as in Method 1 above. + * This request will need further configuration if you are using a proxy + * The response is the same as in Method 1. + + +**Note on Proxies** + + * JVM system properties should be set if a proxy is being used to make the connection work with policy. + * The connection may succeed but have response code 401 or 403 with improper proxy authentication, which leads to "Indeterminate" + * Additionally, the CLI tools have specific proxy configuration. See their respective manual pages for more info. + + +End of Document + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Using+guard+in+the+PDP-D diff --git a/docs/drools/mat_add_local_catalog.JPG b/docs/drools/mat_add_local_catalog.JPG Binary files differnew file mode 100755 index 00000000..e71dcc54 --- /dev/null +++ b/docs/drools/mat_add_local_catalog.JPG diff --git a/docs/drools/mat_amsterdam_controller.JPG b/docs/drools/mat_amsterdam_controller.JPG Binary files differnew file mode 100755 index 00000000..c095082a --- /dev/null +++ b/docs/drools/mat_amsterdam_controller.JPG diff --git a/docs/drools/mat_amsterdam_drl.JPG b/docs/drools/mat_amsterdam_drl.JPG Binary files differnew file mode 100755 index 00000000..01b0126c --- /dev/null +++ b/docs/drools/mat_amsterdam_drl.JPG diff --git a/docs/drools/mat_amsterdam_project.JPG b/docs/drools/mat_amsterdam_project.JPG Binary files differnew file mode 100755 index 00000000..4a494065 --- /dev/null +++ b/docs/drools/mat_amsterdam_project.JPG diff --git a/docs/drools/mat_archetype_checkparams.png b/docs/drools/mat_archetype_checkparams.png Binary files differnew file mode 100755 index 00000000..88b67443 --- /dev/null +++ b/docs/drools/mat_archetype_checkparams.png diff --git a/docs/drools/mat_archetype_params.JPG b/docs/drools/mat_archetype_params.JPG Binary files differnew file mode 100755 index 00000000..bca06360 --- /dev/null +++ b/docs/drools/mat_archetype_params.JPG diff --git a/docs/drools/mat_archetypes.JPG b/docs/drools/mat_archetypes.JPG Binary files differnew file mode 100755 index 00000000..87ee3ce4 --- /dev/null +++ b/docs/drools/mat_archetypes.JPG diff --git a/docs/drools/mat_build_success.JPG b/docs/drools/mat_build_success.JPG Binary files differnew file mode 100755 index 00000000..cd2c2988 --- /dev/null +++ b/docs/drools/mat_build_success.JPG diff --git a/docs/drools/mat_clean_install.JPG b/docs/drools/mat_clean_install.JPG Binary files differnew file mode 100755 index 00000000..0a2a5c81 --- /dev/null +++ b/docs/drools/mat_clean_install.JPG diff --git a/docs/drools/mat_configure.JPG b/docs/drools/mat_configure.JPG Binary files differnew file mode 100755 index 00000000..0965e679 --- /dev/null +++ b/docs/drools/mat_configure.JPG diff --git a/docs/drools/mat_console_output.JPG b/docs/drools/mat_console_output.JPG Binary files differnew file mode 100755 index 00000000..23689fa9 --- /dev/null +++ b/docs/drools/mat_console_output.JPG diff --git a/docs/drools/mat_error.JPG b/docs/drools/mat_error.JPG Binary files differnew file mode 100755 index 00000000..565266f6 --- /dev/null +++ b/docs/drools/mat_error.JPG diff --git a/docs/drools/mat_hello_world.JPG b/docs/drools/mat_hello_world.JPG Binary files differnew file mode 100755 index 00000000..d52e4c75 --- /dev/null +++ b/docs/drools/mat_hello_world.JPG diff --git a/docs/drools/mat_local_archetypes.png b/docs/drools/mat_local_archetypes.png Binary files differnew file mode 100755 index 00000000..2172e636 --- /dev/null +++ b/docs/drools/mat_local_archetypes.png diff --git a/docs/drools/mat_maven_build.JPG b/docs/drools/mat_maven_build.JPG Binary files differnew file mode 100755 index 00000000..2752a633 --- /dev/null +++ b/docs/drools/mat_maven_build.JPG diff --git a/docs/drools/mat_maven_project.JPG b/docs/drools/mat_maven_project.JPG Binary files differnew file mode 100755 index 00000000..3d8efe38 --- /dev/null +++ b/docs/drools/mat_maven_project.JPG diff --git a/docs/drools/mat_new_project.JPG b/docs/drools/mat_new_project.JPG Binary files differnew file mode 100755 index 00000000..2deed0d8 --- /dev/null +++ b/docs/drools/mat_new_project.JPG diff --git a/docs/drools/mat_nexus_catalog.JPG b/docs/drools/mat_nexus_catalog.JPG Binary files differnew file mode 100755 index 00000000..4240eaa3 --- /dev/null +++ b/docs/drools/mat_nexus_catalog.JPG diff --git a/docs/drools/mat_nexus_local_catalog.png b/docs/drools/mat_nexus_local_catalog.png Binary files differnew file mode 100755 index 00000000..b12533e8 --- /dev/null +++ b/docs/drools/mat_nexus_local_catalog.png diff --git a/docs/drools/mat_project_location.JPG b/docs/drools/mat_project_location.JPG Binary files differnew file mode 100755 index 00000000..34c3cb93 --- /dev/null +++ b/docs/drools/mat_project_location.JPG diff --git a/docs/drools/mat_run_as.JPG b/docs/drools/mat_run_as.JPG Binary files differnew file mode 100755 index 00000000..d4401b11 --- /dev/null +++ b/docs/drools/mat_run_as.JPG diff --git a/docs/drools/mat_select_archetypes.png b/docs/drools/mat_select_archetypes.png Binary files differnew file mode 100755 index 00000000..07991c49 --- /dev/null +++ b/docs/drools/mat_select_archetypes.png diff --git a/docs/drools/modAAI_getAllVserver.PNG b/docs/drools/modAAI_getAllVserver.PNG Binary files differnew file mode 100755 index 00000000..611992f4 --- /dev/null +++ b/docs/drools/modAAI_getAllVserver.PNG diff --git a/docs/drools/modAAI_getByVserverName.PNG b/docs/drools/modAAI_getByVserverName.PNG Binary files differnew file mode 100755 index 00000000..7670ff89 --- /dev/null +++ b/docs/drools/modAAI_getByVserverName.PNG diff --git a/docs/drools/modAAI_getCloudRegions.png b/docs/drools/modAAI_getCloudRegions.png Binary files differnew file mode 100755 index 00000000..82fb659c --- /dev/null +++ b/docs/drools/modAAI_getCloudRegions.png diff --git a/docs/drools/modAAI_namedQueryVnfId.PNG b/docs/drools/modAAI_namedQueryVnfId.PNG Binary files differnew file mode 100755 index 00000000..14ca3121 --- /dev/null +++ b/docs/drools/modAAI_namedQueryVnfId.PNG diff --git a/docs/drools/modAAIdata.rst b/docs/drools/modAAIdata.rst new file mode 100644 index 00000000..220d38f4 --- /dev/null +++ b/docs/drools/modAAIdata.rst @@ -0,0 +1,124 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +**************************** +Verifying/Modifying AAI Data +**************************** + +.. contents:: + :depth: 2 + +This page highlights key commands used by Policy to look at and modify A&AI data for testing purposes. Please refer to the A&AI REST API Documentation for more details. + +Checking Current Data +^^^^^^^^^^^^^^^^^^^^^ + +To get all the vnfs that are in AAI +----------------------------------- + +Use this command if you want to get all the vnf's that are provisioned in A&AI. This is useful if you want to find a couple vnf's you can later query. + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -X GET https://aai.api.simpledemo.openecomp.org:8443/aai/v11/network/generic-vnfs | python -m json.tool + +To get a specific vnf +--------------------- + +If you have a **vnf-id**, this command returns the details related to the specific vnf id you are querying. Policy primarily does this query if the onset has a vnf id but not the isClosedLoopDisabled field. + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -X GET https://aai.api.simpledemo.openecomp.org:8443/aai/v11/network/generic-vnfs/generic-vnf/<vnfID> | python -m json.tool + +If you have a **vnf-name**, this command returns the details related to the specific vnf name you are querying. Policy primarily does this query if the onset has a vnf name but no vnf id. + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -X GET https://aai.api.simpledemo.openecomp.org:8443/aai/v11/network/generic-vnfs/generic-vnf?vnf-name=<vnfName> | python -m json.tool + +To find all the vservers +------------------------ + +Follow these steps to get all of the vservers. This is useful to get a couple of vservers to query later, either manually or through a closed loop. + +**Step 1:** Execute the following: + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -X GET https://aai.api.simpledemo.openecomp.org:8443/aai/v11/cloud-infrastructure/cloud-regions | python -m json.tool + + Take note of all the cloud-owner/cloud-region combinations. In this example, there are 3 combinations: Skynet/CL-MR1, AMIST/AMCR1, and Rackspace/DFW. + + .. image:: modAAI_getCloudRegions.png + +**Step 2:** Invoke the following command for each combination: + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -X GET https://aai.api.simpledemo.openecomp.org:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/<cloudOwner>/<cloudRegion>?depth=all | python -m json.tool + + .. image:: modAAI_getAllVserver.PNG + +To get a specific vserver +------------------------- + +Use this command to get the details of a specific vserver based on its vserver name. + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -X GET https://aai.api.simpledemo.openecomp.org:8443/aai/v11/nodes/vservers?vserver-name=<vserverName> | python -m json.tool + + .. image:: modAAI_getByVserverName.PNG + +Named-Queries +------------- + +These commands are used to get more information than can be obtained in a single other query. They require more data to be sent in the query, but return information on the related instances of a given vnf or vserver, as well as the information about the vnf/vserver itself. + +**For vFW:** + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -d "{\"query-parameters\": { \"named-query\": { \"named-query-uuid\": \"a93ac487-409c-4e8c-9e5f-334ae8f99087\" } }, \"instance-filters\":{\"instance-filter\":[ {\"generic-vnf\": { \"vnf-id\": \"<vnfID>\"}}]}}" -X POST https://aai.api.simpledemo.openecomp.org:8443/aai/search/named-query | python -m json.tool + + .. image:: modAAI_namedQueryVnfId.PNG + +**For vDNS:** + + .. code-block:: bash + + curl --silent -k -u "<userName>:<password>" --header "X-FromAppId: <fromApp>" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: <requestID>" -d "{\"query-parameters\": { \"named-query\": { \"named-query-uuid\": \"4ff56a54-9e3f-46b7-a337-07a1d3c6b469\" } }, \"instance-filters\":{\"instance-filter\":[ {\"vserver\": { \"vserver-name\": \"<vnfID>\"}}]}}" -X POST https://aai.api.simpledemo.openecomp.org:8443/aai/search/named-query | python -m json.tool + +Adding Data to A&AI +^^^^^^^^^^^^^^^^^^^ + +Generic-Vnf +----------- + + .. code-block:: bash + + curl --silent -k -u "<username>:<password>" --header "X-FromAppId: POLICY" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: 8611ece5-5786-4e71-b72f-e87ef44029da" -X PUT -H "Content-Type: application/json" --data @addVnf.txt https://aai.api.simpledemo.openecomp.org:8443/aai/v11/network/generic-vnfs/generic-vnf/<vnfID> | python -m json.tool + +The addVNF.txt file is just the data you would like to add. At minimum, the vnf-id, vnf-name, vnf-type and is-closed-loop-disabled fields need to be filled out, and the vnf-id needs to match the one you choose in the url of the curl command. + +Vserver +------- + + .. code-block:: bash + + curl --silent -k -u "<username>:<password>" --header "X-FromAppId: POLICY" --header "Content-Type: application/json" --header "Accept: application/json" --header "X-TransactionId: 8611ece5-5786-4e71-b72f-e87ef44029da" -X PUT -H "Content-Type: application/json" --data @addVserver.txt https://aai.api.simpledemo.openecomp.org:8443/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/<cloud-owner>/<cloud-region-id>/tenants/tenant/<tenant-id>/vservers/vserver/<vserver-id> + +The addVserver.txt file is the vserver object you would like to add. It needs values for vserver-id, vserver-name, vserver-selflink, in-maint, and is-close-loop-disabled at minimum. The values of <cloud-owner>, <cloud-region-id>, and <tenants> depends on the values already in Rackspace, see the section above under finding all Vservers. + +Named Queries +------------- + +The data for the named queries is based off of the data in the relationship-list field for both vservers and vnfs. + +End of Document + +.. SSNote: Wiki page ref. https://wiki.onap.org/pages/viewpage.action?pageId=16005849#Verifying/ModifyingAAIData + + diff --git a/docs/drools/modAmsterTemplate.rst b/docs/drools/modAmsterTemplate.rst new file mode 100644 index 00000000..4456f292 --- /dev/null +++ b/docs/drools/modAmsterTemplate.rst @@ -0,0 +1,130 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +****************************** +Modifying the Release Template +****************************** + +.. contents:: + :depth: 3 + + +This tutorial is intended for Policy Drools Applications developers who would like to test their code using the PDP-D in Eclipse instead of installing in a lab. The example for this tutorial will walk through making a change to the Amsterdam Control Loop Template, building the archetype project, and instantiating a controller with the PDP-D. + +Installing the Archetype Project in Eclipse +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**STEP 1:** First, open the drools-pdp project in Eclipse and navigate to File → New → Project... + + .. image:: mat_new_project.JPG + +**STEP 2:** Navigate to Maven → Maven Project + + .. image:: mat_maven_project.JPG + +**STEP 3:** For demo purposes, the location of the project will be put in Documents/demo. Hit next to proceed. + + .. image:: mat_project_location.JPG + +**STEP 4:** Click "Configure" near the top right. + + .. image:: mat_configure.JPG + +**STEP 5:** Add a Remote and/or a Local catalog + + **STEP 5.1:** Add a Remote Catalog to find the ONAP staged drools-applications + + **STEP 5.1.1:** Click "Add Remote Catalog..." + + .. image:: mat_add_local_catalog.JPG + + **STEP 5.1.2:** Add the ONAP Staging repository archetype-catalog.xml with a description if desired. Click "OK" then "Apply", then "OK". + + .. image:: mat_nexus_catalog.JPG + + **STEP 5.1.3:** The ONAP staging archetypes are now an option: + + .. image:: mat_archetypes.JPG + + **STEP 5.2:** Add a Local Catalog to find a local drools-applications in your .m2 local repository + + **STEP 5.2.1:** Click "Add Local Catalog..." + + .. image:: mat_add_local_catalog.JPG + + **STEP 5.2.2:** Browse to or type in the path to your .m2 repository, give it a name and click "OK" + + .. image:: mat_nexus_local_catalog.png + + **STEP 5.2.3:** The new local repository appears on the catalog list, click "Apply and Close" + + .. image:: mat_local_archetypes.png + +**STEP 6:** If you wish to use a snapshot version of drools-applications, make sure to check the "Include snapshot archetypes" box. Highlight the option with the Artifact Id "archetype-cl-amsterdam" and click next. + + .. image:: mat_select_archetypes.png + +**STEP 7:** The following screen allows the user to modify some of the configurable parameters of the control loop. For this demo the default parameters that are already populated will be used. Fill out the Groud Id, Artifact Id, Version, and Package and hit "Finish". For the demo the following is used: + + .. image:: mat_archetype_params.JPG + +**NOTE:** If you are using a snapshot version of drools-applications. make sure that the "dependenciesVersion" variable value you specify matches the drools-applications artifact versions + + .. image:: mat_archetype_checkparams.png + + +**STEP 8:** Depending on the IDE in use, an error may be generated about handling the kie-maven-plugin:6.5.0.Final:build plugin. This can be ignored, click "Finish" and then "OK" if a warning pops up about having build errors. + + .. image:: mat_error.JPG + +**STEP 9:** Amsterdam can now be seen in the Project Explorer: + + .. image:: mat_amsterdam_project.JPG + + +Modifying the Amsterdam Template +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**STEP 1:** Expand the amsterdam project and "src/main/resources". The drl generated from the archetype will be present as follows: + + .. image:: mat_amsterdam_drl.JPG + +**STEP 2:** Now a change will be added to the drl from above. For this tutorial, a new logging statement will be added that will show in the console of Eclipse when the changes are tested. We'll add this in the SETUP rule. + + .. image:: mat_hello_world.JPG + +**STEP 3:** Right click on the Amsterdam project, hover over "Run As", then click "Maven build". + + .. image:: mat_maven_build.JPG + +**STEP 4:** For the goals type "clean install", click "Apply" and then click "Run". + + .. image:: mat_clean_install.JPG + + .. image:: mat_build_success.JPG + +Running the PDP-D with the Amsterdam Controller +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**STEP 1:** Copy the controller properties file that was generated from the archetype in amsterdam/src/main/config into policy-management/src/main/config + + .. image:: mat_amsterdam_controller.JPG + +**STEP 2:** Go src/main/java and expand the package "org.onap.policy.drools.system". Right click on "Main.java", then hover over "Run As..." and click "Java Application". + + .. image:: mat_run_as.JPG + +**STEP 3:** Search through the console for the logging statement "\***** HELLO WORLD \*****". This indicates that the template change worked. Modifications can continue to be made and the Telemetry API can be used to interact with the PDP-D that is running in Eclipse and to test control loop flows. + + .. image:: mat_console_output.JPG + + + +End of Document + + +.. SSNote: Beijing release update. https://wiki.onap.org/display/DW/Modifying+the+Release+template +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Modifying+the+Amsterdam+release+template + + diff --git a/docs/drools/runningEclipse.rst b/docs/drools/runningEclipse.rst new file mode 100644 index 00000000..136efe73 --- /dev/null +++ b/docs/drools/runningEclipse.rst @@ -0,0 +1,56 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +************************ +Running PDP-D in Eclipse +************************ + +.. contents:: + :depth: 3 + +This tutorial is intended for developers who would like to run the PDP-D in an Eclipse environment. It is assumed that the drools-pdp git project has been imported in an Eclipse workspace. + +Starting the PDP-D +^^^^^^^^^^^^^^^^^^ +For the Amsterdam release, the project directory will look as follows assuming all drools-pdp projects were selected when importing. + + .. image:: RunEcl_drools_pdp_project.png + +Right click on policy-management hover over "Run As" and select "Java Application" + + .. image:: RunEcl_run_as.png + +Search for "Main" in the pop up and select the Main with the package "org.onap.policy.drools.system" and click "OK". + + .. image:: RunEcl_main.png + +The PDP-D will start running; the console will display output. + + .. image:: RunEcl_console_output.png + +Interacting with the PDP-D +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To interact with the PDP-D, the Telemetry API can be used. A simple GET on the engine will show that the PDP-D is running in Eclipse. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n -X GET https://localhost:9696/policy/pdp/engine/ | python -m json.tool + + .. image:: RunEcl_telemetry.png + +An HTTP 200 message for the GET request will also appear in the console in Eclipse. + + .. image:: RunEcl_pdpd_200.png + + +.. seealso:: To create a controller and run a control loop, refer to `Modifying the Release Template <modAmsterTemplate.html>`_. + + +End of Document + + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Running+PDP-D+in+Eclipse + + diff --git a/docs/drools/tutorial_VOLTE.rst b/docs/drools/tutorial_VOLTE.rst new file mode 100644 index 00000000..2dc84628 --- /dev/null +++ b/docs/drools/tutorial_VOLTE.rst @@ -0,0 +1,121 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +********************************************************** +Tutorial: Testing the VOLTE Use Case in a standalone PDP-D +********************************************************** + +.. contents:: + :depth: 3 + +In this tutorial we will go over how to access and start up the PDP-D, setup the prerequisites for the VOLTE flow, enable/disable the VFC Simulator that will be used in the VOLTE flow, and inject messages to trigger the VOLTE flow. + +Accessing and starting the PDP-D +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The first step is to access the docker container of name *drools*. + + .. code-block:: bash + + docker exec -it -u 0 drools su - policy + +The 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. + +Once within the drools container, the running status can be observed by using the *policy* command: + + .. code-block:: bash + + policy [--debug] status|start|stop + +The running status of the PDP-D can be observed with *policy status* + + .. code-block:: bash + + policy@drools:~$ policy status [drools-pdp-controllers] L []: Policy Management (pid 1500) is running 1 cron jobs installed. + + +Prerequisites for the VOLTE flow +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In order to trigger the VOLTE 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 VOLTE ONSET message. + +Navigate to */tmp* and create directory *util*. *util* is just a temporary folder we've created to use as our 'workspace'. + + .. code-block:: bash + + cd /tmp + mkdir util + + +Next, we're going to create a file named *dcae.volte.onset.json* and edit it to paste the VOLTE ONSET message contents. + + .. code-block:: bash + + touch dcae.volte.onset.json + vi dcae.volte.onset.json + +Here are the contents of the VOLTE ONSET message. Copy/paste this into dcae.volte.onset.json: + + .. code-block:: json + + { + "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", + "closedLoopAlarmStart": 1484677482204798, + "closedLoopEventClient": "DCAE.HolmesInstance", + "closedLoopEventStatus": "ONSET", + "requestID": "97964e10-686e-4790-8c45-bdfa61df770f", + "target_type": "VM", + "target": "vserver.vserver-name", + "AAI": { + "vserver.is-closed-loop-disabled": "false", + "vserver.prov-status": "ACTIVE", + "vserver.vserver-name": "dfw1lb01lb01", + "service-instance.service-instance-id" : "vserver-name-16102016-aai3255-data-11-1", + "generic-vnf.vnf-id" : "vnf-id-16102016-aai3255-data-11-1", + "generic-vnf.vnf-name" : "vnf-name-16102016-aai3255-data-11-1" + }, + "from": "DCAE", + "version": "1.0.2" + } + + +Enabling the VFC Simulator +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Enabling 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: + + .. code-block:: bash + + policy stop + features enable controlloop-utils + policy start + +Now, 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 VFC simulator. + +Injecting an ONSET to trigger the VOLTE Flow +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We are now ready to inject an ONSET message to trigger the VOLTE flow. Simply navigate back to the directory *dcae.volte.onset.json* file is saved (i.e. cd /tmp/util) and run this curl command: + + .. code-block:: bash + + http --verify=no --default-scheme=https -a @1b3rt:31nst31n PUT :9696/policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_CL_OUTPUT/events @dcae.volte.onset.json Content-Type:"text/plain" + +You should see some output similar to this: + +.. image:: tutorial_VOLTE_1.png + +You 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*. + +Reading the logs +^^^^^^^^^^^^^^^^ + +Once you've injected the onset message, this should appear in the network.log: + +.. image:: tutorial_VOLTE_2.png + + +End of Document + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Tutorial%3A+Testing+the+VOLTE+Use+Case+in+a+standalone+PDP-D diff --git a/docs/drools/tutorial_VOLTE_1.png b/docs/drools/tutorial_VOLTE_1.png Binary files differnew file mode 100755 index 00000000..938604df --- /dev/null +++ b/docs/drools/tutorial_VOLTE_1.png diff --git a/docs/drools/tutorial_VOLTE_2.png b/docs/drools/tutorial_VOLTE_2.png Binary files differnew file mode 100755 index 00000000..53ee7802 --- /dev/null +++ b/docs/drools/tutorial_VOLTE_2.png diff --git a/docs/drools/tutorial_cl.rst b/docs/drools/tutorial_cl.rst new file mode 100644 index 00000000..3395ea71 --- /dev/null +++ b/docs/drools/tutorial_cl.rst @@ -0,0 +1,51 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +*********************************************************************************************** +Tutorial: Generating and Testing your own Control Loop Operational Policy in a standalone PDP-D +*********************************************************************************************** + +.. contents:: + :depth: 3 + +To generate your own control loop operational policy, use the *create-cl-amsterdam* tool. The *create-cl-amsterdam* script is located in *${POLICY_HOME}/bin (/opt/app/policy/bin)*. When the script is run, it will ask for values for a variety of fields. The fields will have pre-filled out defaults, and for the most part, the defaults are fine to leave in. The two main fields that should be changed are the Template Control Loop Name and the Control Loop Yaml. + + .. image:: Tut_cl_valuesHighlight.png + +Make sure the Yaml’s controlLoopName matches the Template Control Loop Name you pass in. Finally, confirm that the parameters are correct, confirm the directory it will add the policy files in (default is /tmp) and tell the script to create the maven artifact. + + *Confirm the parameters and enter the directory to install in as shown below:* + + .. image:: Tut_cl_confirmAndDirectory.PNG + + *Choose whether to immediately deploy (in this case the directory is /tmp/amsterdam)* + + .. image:: Tut_cl_preDeploy.PNG + +When the processing is done, you get the choice of immediately deploying the policy to the local repository, or first examining the rules in the directory it tells you. If you don’t immediately deploy, you need to use the “*mvn install*” command in the newly created directory to continue. When all that is done, go to the directory where the rule was placed (the /tmp/amsterdam directory in this case) and copy the *<name>-controller.properties* file to *${POLICY_HOME}/config*. Turn the engine off and then back on with “*policy stop*” and then “*policy start*”. + + *Location of the properties file* + + .. image:: Tut_cl_propFile.PNG + + *Moving the properties file to ${POLICY_HOME}/config* + + .. image:: Tut_cl_finalStep.PNG + +Proceed with testing your new policy as described in the specific tutorials: + +• vCPE - `Tutorial: Testing the vCPE use case in a standalone PDP-D <tutorial_vCPE.html>`_ +• vDNS - `Tutorial: Testing the vDNS Use Case in a standalone PDP-D <tutorial_vDNS.html>`_ +• vFW - `Tutorial: Testing the vFW flow in a standalone PDP-D <tutorial_vFW.html>`_ +• VoLTE - `Tutorial: Testing the VOLTE Use Case in a standalone PDP-D <tutorial_VOLTE.html>`_ + + +.. seealso:: To deploy a control loop in Eclipse from the control loop archetype template, refer to `Modifying the Release Template <modAmsterTemplate.html>`_. + + +End of Document + + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Tutorial%3A+Generating+and+Testing+your+own+Control+Loop+Operational+Policy+in+a+standalone+PDP-D + diff --git a/docs/drools/tutorial_vCPE.rst b/docs/drools/tutorial_vCPE.rst new file mode 100644 index 00000000..9a2ac1a4 --- /dev/null +++ b/docs/drools/tutorial_vCPE.rst @@ -0,0 +1,122 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +********************************************************* +Tutorial: Testing the vCPE use case in a standalone PDP-D +********************************************************* + +.. contents:: + :depth: 3 + + +High Level Architecture +^^^^^^^^^^^^^^^^^^^^^^^ +The vCPE flow begins with an onset message that is sent from DCAE notifying the PDP-D that an action needs to be taken on a VM/VNF. Once the PDP-D has inserted the onset into drools memory, rules begin to fire to start processing the onset for the vCPE policy that exists in drools memory. If the onset is not enriched with A&AI data, Policy will query A&AI for the VM/VNF data otherwise the PDP-D will get the A&AI data needed directly from the onset. A Guard query is then executed to determine if the action to be taken is allowed. If Guard returns a permit, the PDP-D will then send an APPC Restart recipe request to restart the VM/VNF specified in the request. If APPC is successful then the PDP-D will send a operation success notification on the POLICY-CL-MGT topic. The PDP-D waits for an abatement message to come from DCAE before ending the transaction. Once the abatement is received the PDP-D sends a final success notification and gracefully ends processing the event. + +Initial Setup +^^^^^^^^^^^^^ + +For this tutorial, a feature for simulating components involved in the flow outside of Policy will be turned on. Run "*features enable controlloop-utils*". + + .. image:: Tut_vCPE_simulators_enabled.JPG + +Now start the PDP-D using the command "policy start" + + .. image:: Tut_vCPE_policy_start.JPG + +Running the Flow +^^^^^^^^^^^^^^^^ + +The telemetry API is used to see what is in memory. There should only be 1 fact, the Params object which is created at initialization time and contains the vCPE policy that was created. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n -X GET https://localhost:9696/policy/pdp/engine/controllers/amsterdam/drools/facts/amsterdam | python -m json.tool + + + .. image:: Tut_vCPE_get_facts.JPG + +Using the telemetry API, a simulated onset can be injected by the user. For demo purposes, this is the simulated onset that will be used: + + .. image:: Tut_vCPE_simulated_onset.JPG + +**NOTE:** The onset that gets injected has to have a closedLoopControlName that matches the pushed policy's closedLoopControlName. + +Inject the onset using the Telemetry API. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n --header "Content-Type: text/plain" --data @dcae.vcpe.onset.json -X PUT https://localhost:9696/policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_EVENT_OUTPUT/events | python -m json.tool + + .. image:: Tut_vCPE_insert_onset.JPG + +**NOTE:** The simulated onset is enriched with A&AI data. The PDP-D will not make an A&AI query since the data needed can be extracted from the onset. + +Now check the facts in memory, there should be 7 objects present. Two timers exist to put a time limit on the operation and on the overall control loop (in the case of retries or policy chaining). The event and it's associated manager and operation manager are also present in memory. A lock on the target entity is inserted to ensure no other events try to take action on the VM/VNF that is currently processing. + + .. image:: Tut_vCPE_get_facts_2.JPG + +The network log will be used to monitor the activity coming in and out of the PDP-D. This log is located at *$POLICY_HOME/logs/network.log*. This will show the notifications that the PDP-D sends out at different stages of processing. The order of successful processing begins with an ACTIVE notification to show that the onset was acknowledged and the operation is beginning transit. + + .. image:: Tut_vCPE_policy_active.JPG + +Once the event is in the ACTIVE state, the PDP-D consults Guard to determine if this operation should be allowed, a series of operation notifications are sent for starting the Guard query, obtaining a PERMIT or DENY, and beginning the operation. + + .. image:: Tut_vCPE_guard_not_queried.JPG + +| + + .. image:: Tut_vCPE_guard_result.JPG + +| + + .. image:: Tut_vCPE_policy_operation.JPG + +Once the operation starts an APPC request is sent out. + + .. image:: Tut_vCPE_appc_request.JPG + +A simulated APPC response will be injected to the APPC-LCM-WRITE topic, this is the example response used: + + .. image:: Tut_vCPE_simulated_appc_response.JPG + +Inject the response using the Telemetry API. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n --header "Content-Type: text/plain" --data @appc.lcm.success.json -X PUT https://localhost:9696/policy/pdp/engine/topics/sources/ueb/APPC-LCM-WRITE/events | python -m json.tool + + .. image:: Tut_vCPE_inject_appc_response.JPG + +The network log will show the PDP-D sent an operation success notification. + + .. image:: Tut_vCPE_policy_operation_success.JPG + +For the vCPE use case, once an operation is successful, the PDP-D waits for DCAE to send an abatement message to end processing. The following abatement message will be used: + + .. image:: Tut_vCPE_simulated_abatement.JPG + +Inject the abatement message using the Telemetry API. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n --header "Content-Type: text/plain" --data @dcae.vcpe.abatement.json -X PUT https://localhost:9696/policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_EVENT_OUTPUT/events | python -m json.tool + + .. image:: Tut_vCPE_insert_abatement.JPG + +Once the abatement is received, a final success notification is sent from the PDP-D. + + .. image:: Tut_vCPE_policy_final_success.JPG + +After processing there should only be 1 fact left in memory. + + .. image:: Tut_vCPE_final_memory.JPG + + +End of Document + + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Tutorial%3A+Testing+the+vCPE+use+case+in+a+standalone+PDP-D + + diff --git a/docs/drools/tutorial_vDNS.rst b/docs/drools/tutorial_vDNS.rst new file mode 100644 index 00000000..330bb64e --- /dev/null +++ b/docs/drools/tutorial_vDNS.rst @@ -0,0 +1,119 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +********************************************************* +Tutorial: Testing the vDNS Use Case in a standalone PDP-D +********************************************************* + +.. contents:: + :depth: 3 + +In 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. + +Accessing and starting the PDP-D +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The first step is to access the docker container of name *drools*. + + .. code-block:: bash + + docker exec -it -u 0 drools su - policy + +The 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. + +Once within the drools container, the running status can be observed by using the *policy* command: + + .. code-block:: bash + + policy [--debug] status|start|stop + +The running status of the PDP-D can be observed with *policy status* + + .. code-block:: bash + + policy@drools:~$ policy status [drools-pdp-controllers] L []: Policy Management (pid 1500) is running 1 cron jobs installed. + + +Prerequisites for the vDNS flow +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In 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. + +Navigate to */tmp* and create directory *util*. *util* is just a temporary folder we've created to use as our 'workspace'. + + .. code-block:: bash + + cd /tmp + mkdir util + + +Next, we're going to create a file named *dcae.vdns.onset.json* and edit it to paste the vDNS ONSET message contents. + + .. code-block:: bash + + touch dcae.vdns.onset.json + vi dcae.vdns.onset.json + +Here are the contents of the vDNS ONSET message. Copy/paste this into dcae.vdns.onset.json: + + .. code-block:: json + + { + "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "closedLoopAlarmStart": 1484677482204798, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ONSET", + "requestID": "e4f95e0c-a013-4530-8e59-c5c5f9e539b6", + "target_type": "VNF", + "target": "vserver.vserver-name", + "AAI": { + "vserver.is-closed-loop-disabled": "false", + "vserver.prov-status": "ACTIVE", + "vserver.vserver-name": "dfw1lb01lb01" + }, + "from": "DCAE", + "version": "1.0.2" + } + + + +Enabling the AAI and SO Simulators +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Enabling 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: + + .. code-block:: bash + + policy stop + features enable controlloop-utils + policy start + +Now, 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. + +Injecting an ONSET to trigger the vDNS Flow +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We 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: + + .. code-block:: bash + + 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" + +You should see some output similar to this: + + .. image:: tutorial_vDNS_1.png + +You 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*. + +Reading the logs +^^^^^^^^^^^^^^^^ + +Once you've injected the onset message, this should appear in the network.log: + + .. image:: tutorial_vDNS_2.png + + +End of Document + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Tutorial%3A+Testing+the+vDNS+Use+Case+in+a+standalone+PDP-D diff --git a/docs/drools/tutorial_vDNS_1.png b/docs/drools/tutorial_vDNS_1.png Binary files differnew file mode 100644 index 00000000..ed2cb36f --- /dev/null +++ b/docs/drools/tutorial_vDNS_1.png diff --git a/docs/drools/tutorial_vDNS_2.png b/docs/drools/tutorial_vDNS_2.png Binary files differnew file mode 100644 index 00000000..bbfb8206 --- /dev/null +++ b/docs/drools/tutorial_vDNS_2.png diff --git a/docs/drools/tutorial_vFW.rst b/docs/drools/tutorial_vFW.rst new file mode 100644 index 00000000..72288f33 --- /dev/null +++ b/docs/drools/tutorial_vFW.rst @@ -0,0 +1,124 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +**************************************************** +Tutorial: Testing the vFW flow in a standalone PDP-D +**************************************************** + +.. contents:: + :depth: 3 + + +High Level Architecture +^^^^^^^^^^^^^^^^^^^^^^^ +The vFW flow begins with an onset message that is sent from DCAE notifying the PDP-D that an action needs to be taken on a VNF. Once the PDP-D has inserted the onset into drools memory, rules begin to fire to start processing the onset for the vFW policy that exists in drools memory. If the onset is not enriched with A&AI data, Policy will query A&AI for the VNF data otherwise the PDP-D will get the A&AI data needed directly from the onset. Then an A&AI named query is executed on the source VNF entity from the onset to find the target VNF entity that the PDP-D will take action on. Once the target entity is retrieved from A&AI, a Guard query is executed to determine if the action to be taken is allowed. If Guard returns a permit, the PDP-D will then send an APPC ModifyConfig recipe request to modify pg-streams as specified in the request payload. If APPC is successful then the PDP-D will send a final success notification on the POLICY-CL-MGT topic and gracefully end processing the event. + +Initial Setup +^^^^^^^^^^^^^ + +For this tutorial, a feature for simulating components involved in the flow outside of Policy will be turned on. Run "*features enable controlloop-utils*". + + .. image:: Tut_vFW_simulators_enabled.JPG + +Now start the PDP-D using the command "policy start" + + .. image:: Tut_vFW_policy_start.JPG + +Running the Flow +^^^^^^^^^^^^^^^^ + +The telemetry API is used to see what is in memory. There should only be 1 fact, the Params object which is created at initialization time and contains the vFW policy that was created. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n -X GET https://localhost:9696/policy/pdp/engine/controllers/amsterdam/drools/facts/amsterdam | python -m json.tool + + .. image:: Tut_vFW_get_facts.JPG + +Using the telemetry API, a simulated onset can be injected by the user. For demo purposes, this is the simulated onset that will be used: + + .. image:: Tut_vFW_simulated_onset.JPG + +**NOTE:** The onset that gets injected has to have a closedLoopControlName that matches the pushed policy's closedLoopControlName. + +Inject the onset using the Telemetry API. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n --header "Content-Type: text/plain" --data @dcae.vfw.onset.json -X PUT https://localhost:9696/policy/pdp/engine/topics/sources/ueb/unauthenticated.DCAE_EVENT_OUTPUT/events | python -m json.tool + + .. image:: Tut_vFW_onset_injected.JPG + +Now check the facts in memory, there should be 7 objects present. Two timers exist to put a time limit on the operation and on the overall control loop (in the case of retries or policy chaining). The event and it's associated manager and operation manager are also present in memory. A lock on the target entity is inserted to ensure no other events try to take action on the VNF that is currently processing. + + .. image:: Tut_vFW_get_facts_2.JPG + +The network log will be used to monitor the activity coming in and out of the PDP-D. This log is located at *$POLICY_HOME/logs/network.log*. This will show the notifications that the PDP-D sends out at different stages of processing. The order of successful processing begins with an ACTIVE notification to show that the onset was acknowledged and the operation is beginning transit. + + .. image:: Tut_vFW_policy_active.JPG + +Next a query will be sent to A&AI to get information on the VNF specified from the onset. The picture below shows the query going OUT of the PDP-D and the response coming IN. + +**NOTE:** Policy does A&AI queries for VNF information when the onset is not enriched with A&AI data. In this example only the generic-vnf.vnf-name was provided so a query to A&AI is necessary to retrieve data that is needed in the APPC request. + + .. image:: Tut_vFW_aai_get.JPG + +For the vFW use case, the source entity reported in the onset message may not be the target entity that the APPC operation takes action on. To determine the true target entity, an A&AI named query is performed. The request is shown in the network log. + + .. image:: Tut_vFW_aai_named_query_request.JPG + +The response is also displayed in the network log. + + .. image:: Tut_vFW_aai_named_query_response.JPG + +Once the target entity is found, the PDP-D consults Guard to determine if this operation should be allowed, a series of operation notifications are sent for starting the Guard query, obtaining a PERMIT or DENY, and beginning the operation. + + .. image:: Tut_vFW_policy_guard_start.JPG + +| + + .. image:: Tut_vFW_policy_guard_result.JPG + +| + + .. image:: Tut_vFW_policy_operation_start.JPG + +Once the operation starts an APPC request is sent out. + + .. image:: Tut_vFW_appc_request.JPG + +A simulated APPC response will be injected to the APPC-CL topic, this is the example response used: + + .. image:: Tut_vFW_simulated_appc_response.JPG + +Inject the response using the Telemetry API. + + .. code-block:: bash + + curl -k --silent --user @1b3rt:31nst31n --header "Content-Type: text/plain" --data @appc.legacy.success.json -X PUT https://localhost:9696/policy/pdp/engine/topics/sources/ueb/APPC-CL/events | python -m json.tool + + .. image:: Tut_vFW_insert_appc_response.JPG + +The network log will show the PDP-D sent an operation success notification. + + .. image:: Tut_vFW_policy_operation_success.JPG + +Then a final success notification is sent. + + .. image:: Tut_vFW_policy_final_success.JPG + +After processing there should only be 1 fact left in memory. + + .. image:: Tut_vFW_final_memory.JPG + + + + +End of Document + + + + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Tutorial%3A+Testing+the+vFW+flow+in+a+standalone+PDP-D + |