summaryrefslogtreecommitdiffstats
path: root/controlloop/packages
diff options
context:
space:
mode:
authorSaravanan A <saravanan.a75@wipro.com>2018-09-10 17:31:33 +0530
committerSaravanan A <saravanan.a75@wipro.com>2018-09-12 21:51:11 +0530
commitdbecba3a4baffacf9f2da82592b3e3a9e2929f21 (patch)
tree71b93f111551115b8d0f8d634a23b825a9cd4b0e /controlloop/packages
parent2e2f7f988509b273912664ac2ffc07f583988b59 (diff)
Add implementation for OOF PCI use case
Receive DMaaP message from PCI-Handler MS with PCI Config change recommendations through DCAE_CL_OUTPUT topic. Trigger SDN-R (if allowed by policy) by sending DMaaP request through SDNR-CL topic. When the response is received from SDNR through SDNR-CL-RSP topic, just parse and print. Code review comments addressed Change-Id: If340a23ae18367b7f98e31fe79c09a09e645b2ad Issue-ID: POLICY-1089 Signed-off-by: Saravanan A<saravanan.a75@wipro.com>
Diffstat (limited to 'controlloop/packages')
-rw-r--r--controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca20
-rw-r--r--controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca13
2 files changed, 33 insertions, 0 deletions
diff --git a/controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca b/controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca
index dd88b5ccc..68395bc88 100644
--- a/controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca
+++ b/controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca
@@ -54,6 +54,11 @@ VOLTE_CONTROL_LOOP_NAME="ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b"
VOLTE_POLICY_NAME="volte"
VOLTE_CONTROL_LOOP_YAML="controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+VFC%0D%0A++++recipe%3A+Restart%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard"
+# vPCI Policy Parameters
+VPCI_CONTROL_LOOP_NAME="ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459"
+VPCI_POLICY_NAME="vpci"
+VPCI_CONTROL_LOOP_YAML="controlLoop%3A%0D%0A++version%3A+3.0.0%0D%0A++controlLoopName%3A+ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459%0D%0A++trigger_policy%3A+unique-policy-id-123-modifyconfig%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-123-modifyconfig%0D%0A++++name%3A+modify+PCI+config%0D%0A++++description%3A%0D%0A++++actor%3A+SDNR%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++%23+These+fields+are+not+used%0D%0A++++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+300%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard"
+
# Generic Scope and Version
POLICY_SCOPE="casablanca"
POLICY_VERSION="v0.0.1"
@@ -86,6 +91,10 @@ read -e -i "${VOLTE_CONTROL_LOOP_NAME}" -p "VOLTE Control Loop Name> " VOLTE_CON
read -e -i "${VOLTE_POLICY_NAME}" -p "VOLTE Policy Name> " VOLTE_POLICY_NAME
read -e -i "${VOLTE_CONTROL_LOOP_YAML}" -p "VOLTE Control Loop Yaml> " VOLTE_CONTROL_LOOP_YAML
+read -e -i "${VPCI_CONTROL_LOOP_NAME}" -p "VPCI Control Loop Name> " VPCI_CONTROL_LOOP_NAME
+read -e -i "${VPCI_POLICY_NAME}" -p "VPCI Policy Name> " VPCI_POLICY_NAME
+read -e -i "${VPCI_CONTROL_LOOP_YAML}" -p "VPCI Control Loop Yaml> " VPCI_CONTROL_LOOP_YAML
+
read -e -i "${POLICY_SCOPE}" -p "Generic Policy Scope> " POLICY_SCOPE
read -e -i "${POLICY_VERSION}" -p "Generic Policy Version> " POLICY_VERSION
@@ -120,6 +129,10 @@ if [ -z "${VOLTE_CONTROL_LOOP_NAME}" ]; then echo "Aborting: VOLTE Control Loop
if [ -z "${VOLTE_POLICY_NAME}" ]; then echo "Aborting: VOLTE Policy Name not provided"; exit 1; fi
if [ -z "${VOLTE_CONTROL_LOOP_YAML}" ]; then echo "Aborting: VOLTE Control Loop Yaml not provided"; exit 1; fi
+if [ -z "${VPCI_CONTROL_LOOP_NAME}" ]; then echo "Aborting: VPCI Control Loop Name not provided"; exit 1; fi
+if [ -z "${VPCI_POLICY_NAME}" ]; then echo "Aborting: VPCI Policy Name not provided"; exit 1; fi
+if [ -z "${VPCI_CONTROL_LOOP_YAML}" ]; then echo "Aborting: VPCI Control Loop Yaml not provided"; exit 1; fi
+
if [ -z "${POLICY_SCOPE}" ]; then echo "Aborting: Template Policy Scope not provided"; exit 1; fi
if [ -z "${POLICY_VERSION}" ]; then echo "Aborting: Template Policy Version not provided"; exit 1; fi
@@ -162,6 +175,10 @@ echo "VOLTE Drools Fact Generation: VOLTE Control Loop Control Name: ${VOLTE_CON
echo "VOLTE Drools Fact Generation: VOLTE Control Loop Policy Name: ${VOLTE_POLICY_NAME}"
echo "VOLTE Drools Fact Generation: VOLTE Control Loop Yaml: ${VOLTE_CONTROL_LOOP_YAML}"
echo
+echo "VPCI Drools Fact Generation: VPCI Control Loop Control Name: ${VPCI_CONTROL_LOOP_NAME}"
+echo "VPCI Drools Fact Generation: VPCI Control Loop Policy Name: ${VPCI_POLICY_NAME}"
+echo "VPCI Drools Fact Generation: VPCI Control Loop Yaml: ${VPCI_CONTROL_LOOP_YAML}"
+echo
echo "Generic Drools Fact: Control Loop Policy Scope: ${POLICY_SCOPE}"
echo "Generic: Control Loop Policy Version: ${POLICY_VERSION}"
echo
@@ -252,6 +269,9 @@ mvn archetype:generate \
-DvolteClosedLoopControlName="${VOLTE_CONTROL_LOOP_NAME}" \
-DvoltePolicyName="${VOLTE_POLICY_NAME}" \
-DvolteControlLoopYaml="${VOLTE_CONTROL_LOOP_YAML}" \
+ -DvpciClosedLoopControlName="${VPCI_CONTROL_LOOP_NAME}" \
+ -DvpciPolicyName="${VPCI_POLICY_NAME}" \
+ -DvpciControlLoopYaml="${VPCI_CONTROL_LOOP_YAML}" \
-DpolicyScope="${POLICY_SCOPE}" \
-DpolicyVersion="${POLICY_VERSION}" \
-DbrmsgwTopic="${BRMSGW_TOPIC}" \
diff --git a/controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca b/controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca
index 5bd23f49b..180cdff2d 100644
--- a/controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca
+++ b/controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca
@@ -113,6 +113,19 @@ curl --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain'
}' "http://localhost:9696/policy/pdp/engine/topics/sources/ueb/${BRMSGW_TOPIC}/events" | python -m json.tool
sleep 2
+echo
+echo "Inserting vPCI Policy..."
+curl --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain' -d '{
+ "closedLoopControlName": "ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459",
+ "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+3.0.0%0D%0A++controlLoopName%3A+ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459%0D%0A++trigger_policy%3A+unique-policy-id-123-modifyconfig%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-123-modifyconfig%0D%0A++++name%3A+modify+PCI+config%0D%0A++++description%3A%0D%0A++++actor%3A+SDNR%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++%23+These+fields+are+not+used%0D%0A++++++resourceID%3A+Eace933104d443b496b8.nodes.heat.vpg%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%0D%0A++++timeout%3A+300%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard",
+ "policyName": "vpci",
+ "policyScope": "DCAE",
+ "policyVersion": "1.2.0"
+}' "http://localhost:9696/policy/pdp/engine/topics/sources/ueb/${BRMSGW_TOPIC}/events" | python -m json.tool
+
+sleep 2
+
+
echo
echo "Policy insertions completed."