aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/packages/basex-controlloop/src
diff options
context:
space:
mode:
authorVidyashree Rama <vidyashree.rama@huawei.com>2018-10-18 11:45:52 +0530
committerVidyashree Rama <vidyashree.rama@huawei.com>2018-10-23 18:28:01 +0530
commitb9007182f9a8fa0dea48fc970e38fb6761bf6c24 (patch)
tree8acc33b3aab928e3b7e1d4db7baee7c5ee4135af /controlloop/packages/basex-controlloop/src
parentecffd0e5dfe112bcc69ee420848bbc476571637c (diff)
Add CCVPN policy
CCVPN policy Issue-ID: POLICY-1209 Change-Id: I8adea233f8672c9ff43b4a169b50336d9e43c91d Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
Diffstat (limited to 'controlloop/packages/basex-controlloop/src')
-rw-r--r--controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca23
-rw-r--r--controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca10
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 68395bc88..8b2045488 100644
--- a/controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca
+++ b/controlloop/packages/basex-controlloop/src/files/bin/create-cl-casablanca
@@ -59,6 +59,14 @@ 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"
+# CCVPN Policy Parameters
+CCVPN_CONTROL_LOOP_NAME="ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b"
+CCVPN_POLICY_NAME="ccvpn"
+CCVPN_CONTROL_LOOP_YAML="controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b%0D%0A++trigger_policy%3A+unique-policy-id-16-Reroute%0D%0A++t
+imeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-Reroute%0D%0A++++name%3A+Connectivity Reroute%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++reci
+pe%3A+Reroute%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_fail
+ure_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"
@@ -95,6 +103,10 @@ read -e -i "${VPCI_CONTROL_LOOP_NAME}" -p "VPCI Control Loop Name> " VPCI_CONTRO
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 "${CCVPN_CONTROL_LOOP_NAME}" -p "CCVPN Control Loop Name> " CCVPN_CONTROL_LOOP_NAME
+read -e -i "${CCVPN_POLICY_NAME}" -p "CCVPN Policy Name> " CCVPN_POLICY_NAME
+read -e -i "${CCVPN_CONTROL_LOOP_YAML}" -p "CCVPN Control Loop Yaml> " CCVPN_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
@@ -133,6 +145,10 @@ if [ -z "${VPCI_CONTROL_LOOP_NAME}" ]; then echo "Aborting: VPCI Control Loop Na
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 "${CCVPN_CONTROL_LOOP_NAME}" ]; then echo "Aborting: CCVPN Control Loop Name not provided"; exit 1; fi
+if [ -z "${CCVPN_POLICY_NAME}" ]; then echo "Aborting: CCVPN Policy Name not provided"; exit 1; fi
+if [ -z "${CCVPN_CONTROL_LOOP_YAML}" ]; then echo "Aborting: CCVPN 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
@@ -179,6 +195,10 @@ echo "VPCI Drools Fact Generation: VPCI Control Loop Control Name: ${VPCI_CONTRO
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 "CCVPN Drools Fact Generation: CCVPN Control Loop Control Name: ${CCVPN_CONTROL_LOOP_NAME}"
+echo "CCVPN Drools Fact Generation: CCVPN Control Loop Policy Name: ${CCVPN_POLICY_NAME}"
+echo "CCVPN Drools Fact Generation: CCVPN Control Loop Yaml: ${CCVPN_CONTROL_LOOP_YAML}"
+echo
echo "Generic Drools Fact: Control Loop Policy Scope: ${POLICY_SCOPE}"
echo "Generic: Control Loop Policy Version: ${POLICY_VERSION}"
echo
@@ -272,6 +292,9 @@ mvn archetype:generate \
-DvpciClosedLoopControlName="${VPCI_CONTROL_LOOP_NAME}" \
-DvpciPolicyName="${VPCI_POLICY_NAME}" \
-DvpciControlLoopYaml="${VPCI_CONTROL_LOOP_YAML}" \
+ -DccvpnClosedLoopControlName="${CCVPN_CONTROL_LOOP_NAME}" \
+ -DccvpnPolicyName="${CCVPN_POLICY_NAME}" \
+ -DccvpnControlLoopYaml="${CCVPN_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 b09ea800f..d8140c0a5 100644
--- a/controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca
+++ b/controlloop/packages/basex-controlloop/src/files/bin/push-policies-casablanca
@@ -125,7 +125,17 @@ curl -k --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plai
sleep 2
+echo
+echo "Inserting CCVPN Policy..."
+curl -k --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain' -d '{
+ "closedLoopControlName": "ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b",
+ "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b%0D%0A++trigger_policy%3A+unique-policy-id-16-Reroute%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-Reroute%0D%0A++++name%3A+Connectivity Reroute%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++recipe%3A+Reroute%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",
+ "policyName": "ccvpn",
+ "policyScope": "DCAE",
+ "policyVersion": "1.2.0"
+}' "https://localhost:9696/policy/pdp/engine/topics/sources/ueb/${BRMSGW_TOPIC}/events" | python -m json.tool
+sleep 2
echo
echo "Policy insertions completed."