diff options
Diffstat (limited to 'controlloop/packages/basex/src/files/bin/push-policies-beijing')
-rw-r--r-- | controlloop/packages/basex/src/files/bin/push-policies-beijing | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/controlloop/packages/basex/src/files/bin/push-policies-beijing b/controlloop/packages/basex/src/files/bin/push-policies-beijing deleted file mode 100644 index 92259790a..000000000 --- a/controlloop/packages/basex/src/files/bin/push-policies-beijing +++ /dev/null @@ -1,122 +0,0 @@ -#! /bin/bash - -### -# ============LICENSE_START======================================================= -# PDP-D APPS Base Package -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -### - -# A script to insert policies using ControlLoopParams facts -# for a standalone PDP-D usage - -# Obtain the controller properties file -if [[ "${CONTROLLER_PROPERTIES}" != "" ]] ; then - # The user already exported CONTROLLER_PROPERTIES - configFile="${CONTROLLER_PROPERTIES}" -else - # CONTROL_LOOP_PROPERTIES are missing, ask the user for them - echo "What is the path to the controller properties file?" - read -e -i "${configFile}" -p "Controller properties file> " configFile - - # Ensure the user gave a path - if [ -z "${configFile}" ]; then echo "Aborting: No controller properties file was specified"; exit 1; fi - - # Ensure the controller properties file exists in the user specified path - if [[ ! -f "${configFile}" ]] ; then - echo "Aborting: Can't find controller properties file at: ${configFile}" - exit 1 - fi -fi - -echo -echo "Extracting properties from properties file..." -echo - -echo "Extracting the controller's name..." -CONTROLLER_NAME=$(egrep ".*controller.name=" \ - "${configFile}") -CONTROLLER_NAME=`echo ${CONTROLLER_NAME} | sed -e 's/.*controller\.name=\(.*\)/\1/'` -echo "The controller's name is: ${CONTROLLER_NAME}" -echo - -echo "Extracting the BRMSGW Topic..." -BRMSGW_TOPIC=$(egrep "^ *(ueb|dmaap)\.source\.topics\..*\.events=org.onap.policy.controlloop.params.ControlLoopParams" \ - "${configFile}") -BRMSGW_TOPIC=`echo ${BRMSGW_TOPIC} | sed -e 's/.*topics\.\(.*\)\.events=org.onap.policy.controlloop.params.ControlLoopParams/\1/'` -echo "The BRMSGW topic is: ${BRMSGW_TOPIC}" -echo - -if [ -z "${BRMSGW_TOPIC}" ]; then echo "Aborting: BRMSGW DMaaP Topic was not found in controller properties file"; exit 1; fi - -echo -echo "Inserting ControlLoopParams facts in to working memory..." -echo - -echo -echo "Inserting vCPE Policy..." -curl --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain' -d '{ - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+true%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+APPC%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", - "policyName": "vcpe", - "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 "Inserting vFW Policy..." -curl --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain' -d '{ - "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0D%0A++trigger_policy%3A+unique-policy-id-1-modifyConfig%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-modifyConfig%0D%0A++++name%3A+modify+packet+gen+config%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+ModifyConfig%0D%0A++++target%3A%0D%0A++++++%23+TBD+-+Cannot+be+known+until+instantiation+is+done%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": "vfw", - "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 "Inserting vDNS Policy..." -curl --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain' -d '{ - "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0D%0A++trigger_policy%3A+unique-policy-id-1-scale-up%0D%0A++timeout%3A+1200%0D%0A++abatement%3A+false%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-scale-up%0D%0A++++name%3A+Create+a+new+VF+Module%0D%0A++++description%3A%0D%0A++++actor%3A+SO%0D%0A++++recipe%3A+VF+Module+Create%0D%0A++++target%3A%0D%0A++++++type%3A+VNF%0D%0A++++retry%3A+0%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": "vdns", - "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 "Inserting VoLTE Policy..." -curl --silent --user @1b3rt:31nst31n -X PUT --header 'Content-Type: text/plain' -d '{ - "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", - "controlLoopYaml": "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", - "policyName": "volte", - "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." -echo - -echo "The working memory is now: " -curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/${CONTROLLER_NAME}/drools/facts/beijing | python -m json.tool |