summaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-management/src/main/feature/bin
diff options
context:
space:
mode:
authorVidyashree Rama <vidyashree.rama@huawei.com>2019-04-02 14:40:35 +0530
committerVidyashree Rama <vidyashree.rama@huawei.com>2019-04-05 12:02:38 +0530
commitc4c99f0d6cb5eeb7475ccac5c00c960b1d8f83ed (patch)
treed5312c789d268ea676273570d01c19df0d7a62b3 /controlloop/common/feature-controlloop-management/src/main/feature/bin
parent6b3e0fcc0b0c362ce6067f0d6604ec60f984f850 (diff)
Add CCVPN Bandwidth on demand policy
CCVPN Bandwidth on demand policy Issue-ID: POLICY-1405 Change-Id: I67bceb35e5a849933b3e46772c9cbbbaab1e9a75 Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
Diffstat (limited to 'controlloop/common/feature-controlloop-management/src/main/feature/bin')
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/bin/create-cl-usecases21
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/bin/push-policies-usecases13
2 files changed, 34 insertions, 0 deletions
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/bin/create-cl-usecases b/controlloop/common/feature-controlloop-management/src/main/feature/bin/create-cl-usecases
index 5662e7c92..99843aa10 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/bin/create-cl-usecases
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/bin/create-cl-usecases
@@ -5,6 +5,7 @@
# ONAP
# ================================================================================
# Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -67,6 +68,11 @@ imeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+
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"
+# CCVPN Bandwidth On Demand Policy Parameters
+CCVPN_BW_CONTROL_LOOP_NAME="ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c22b"
+CCVPN_BW_POLICY_NAME="CCVPNBandwidthOnDemand"
+CCVPN_BW_CONTROL_LOOP_YAML="controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c22b%0D%0A++trigger_policy%3A+unique-policy-id-16-BandwidthOnDemand%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-BandwidthOnDemand%0D%0A++++name%3A+CCVPNBandwidthOnDemand%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++recipe%3A+BandwidthOnDemand%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"
+
# Generic Scope and Version
POLICY_SCOPE="usecases"
POLICY_VERSION="v0.0.1"
@@ -107,6 +113,10 @@ read -e -i "${CCVPN_CONTROL_LOOP_NAME}" -p "CCVPN Control Loop Name> " CCVPN_CON
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 "${CCVPN_BW_CONTROL_LOOP_NAME}" -p "CCVPN BW Control Loop Name> " CCVPN_BW_CONTROL_LOOP_NAME
+read -e -i "${CCVPN_BW_POLICY_NAME}" -p "CCVPN BW Policy Name> " CCVPN_BW_POLICY_NAME
+read -e -i "${CCVPN_BW_CONTROL_LOOP_YAML}" -p "CCVPN BW Control Loop Yaml> " CCVPN_BW_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
@@ -149,6 +159,10 @@ if [ -z "${CCVPN_CONTROL_LOOP_NAME}" ]; then echo "Aborting: CCVPN Control Loop
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 "${CCVPN_BW_CONTROL_LOOP_NAME}" ]; then echo "Aborting: CCVPN BW Control Loop Name not provided"; exit 1; fi
+if [ -z "${CCVPN_BW_POLICY_NAME}" ]; then echo "Aborting: CCVPN BW Policy Name not provided"; exit 1; fi
+if [ -z "${CCVPN_BW_CONTROL_LOOP_YAML}" ]; then echo "Aborting: CCVPN BW 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
@@ -199,6 +213,10 @@ echo "CCVPN Drools Fact Generation: CCVPN Control Loop Control Name: ${CCVPN_CON
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 "CCVPN BW Drools Fact Generation: CCVPN BW Control Loop Control Name: ${CCVPN_BW_CONTROL_LOOP_NAME}"
+echo "CCVPN BW Drools Fact Generation: CCVPN BW Control Loop Policy Name: ${CCVPN_BW_POLICY_NAME}"
+echo "CCVPN BW Drools Fact Generation: CCVPN BW Control Loop Yaml: ${CCVPN_BW_CONTROL_LOOP_YAML}"
+echo
echo "Generic Drools Fact: Control Loop Policy Scope: ${POLICY_SCOPE}"
echo "Generic: Control Loop Policy Version: ${POLICY_VERSION}"
echo
@@ -295,6 +313,9 @@ mvn archetype:generate \
-DccvpnClosedLoopControlName="${CCVPN_CONTROL_LOOP_NAME}" \
-DccvpnPolicyName="${CCVPN_POLICY_NAME}" \
-DccvpnControlLoopYaml="${CCVPN_CONTROL_LOOP_YAML}" \
+ -DccvpnBwClosedLoopControlName="${CCVPN_BW_CONTROL_LOOP_NAME}" \
+ -DccvpnBwPolicyName="${CCVPN_BW_POLICY_NAME}" \
+ -DccvpnBwControlLoopYaml="${CCVPN_BW_CONTROL_LOOP_YAML}" \
-DpolicyScope="${POLICY_SCOPE}" \
-DpolicyVersion="${POLICY_VERSION}" \
-DbrmsgwTopic="${BRMSGW_TOPIC}" \
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/bin/push-policies-usecases b/controlloop/common/feature-controlloop-management/src/main/feature/bin/push-policies-usecases
index dc64c3ece..307d7825a 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/bin/push-policies-usecases
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/bin/push-policies-usecases
@@ -5,6 +5,7 @@
# ONAP
# ================================================================================
# Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -138,6 +139,18 @@ curl -k --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plai
sleep 2
echo
+echo "Inserting CCVPN Bandwidth On Demand Policy..."
+curl -k --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain' -d '{
+ "closedLoopControlName": "ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c22b",
+ "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c22b%0D%0A++trigger_policy%3A+unique-policy-id-16-BandwidthOnDemand%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-BandwidthOnDemand%0D%0A++++name%3A+CCVPNBandwidthOnDemand%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++recipe%3A+BandwidthOnDemand%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": "ccvpnBandwidthOnDemand",
+ "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."
echo