diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2019-04-05 11:58:19 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-05 11:58:19 +0000 |
commit | c3f8dd9e309bcbf2c466e551f3c03125e5d3bbb3 (patch) | |
tree | a753fd4f96f54e7c3a86e2f57a9c2a04181e237e /controlloop/common/feature-controlloop-management | |
parent | 07e29100f99036fe7170b7ff43dca651983b888d (diff) | |
parent | c4c99f0d6cb5eeb7475ccac5c00c960b1d8f83ed (diff) |
Merge "Add CCVPN Bandwidth on demand policy"
Diffstat (limited to 'controlloop/common/feature-controlloop-management')
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 |