mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada, AT&T |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 15 | #! /bin/bash |
| 16 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 17 | # forked from https://gerrit.onap.org/r/gitweb?p=policy/docker.git;a=blob;f=config/pe/push-policies.sh;h=555ab357e6b4f54237bf07ef5e6777d782564bc0;hb=refs/heads/amsterdam and adapted for OOM |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 18 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 19 | #########################################Upload BRMS Param Template########################################## |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 20 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 21 | echo "Upload BRMS Param Template" |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 22 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 23 | sleep 2 |
| 24 | |
Jorge Hernandez | cb49888 | 2018-07-09 11:35:38 -0500 | [diff] [blame^] | 25 | wget -O cl-amsterdam-template.drl https://git.onap.org/policy/drools-applications/plain/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 26 | |
| 27 | sleep 2 |
| 28 | |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 29 | curl -v --silent -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -F "file=@cl-amsterdam-template.drl" -F "importParametersJson={\"serviceName\":\"ClosedLoopControlName\",\"serviceType\":\"BRMSPARAM\"}" 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/policyEngineImport' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 30 | |
| 31 | echo "PRELOAD_POLICIES is $PRELOAD_POLICIES" |
| 32 | |
| 33 | if [ "$PRELOAD_POLICIES" == "false" ]; then |
| 34 | exit 0 |
| 35 | fi |
| 36 | |
| 37 | #########################################Create BRMS Param policies########################################## |
| 38 | |
| 39 | echo "Create BRMSParam Operational Policies" |
| 40 | |
| 41 | sleep 2 |
| 42 | |
| 43 | echo "Create BRMSParamvFirewall Policy" |
| 44 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 45 | "policyConfigType": "BRMS_PARAM", |
| 46 | "policyName": "com.BRMSParamvFirewall", |
| 47 | "policyDescription": "BRMS Param vFirewall policy", |
| 48 | "policyScope": "com", |
| 49 | "attributes": { |
| 50 | "MATCHING": { |
| 51 | "controller" : "amsterdam" |
| 52 | }, |
| 53 | "RULE": { |
| 54 | "templateName": "ClosedLoopControlName", |
| 55 | "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a", |
| 56 | "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" |
| 57 | } |
| 58 | } |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 59 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 60 | |
| 61 | sleep 2 |
| 62 | |
| 63 | echo "Create BRMSParamvDNS Policy" |
| 64 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 65 | "policyConfigType": "BRMS_PARAM", |
| 66 | "policyName": "com.BRMSParamvDNS", |
| 67 | "policyDescription": "BRMS Param vDNS policy", |
| 68 | "policyScope": "com", |
| 69 | "attributes": { |
| 70 | "MATCHING": { |
| 71 | "controller" : "amsterdam" |
| 72 | }, |
| 73 | "RULE": { |
| 74 | "templateName": "ClosedLoopControlName", |
| 75 | "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", |
| 76 | "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" |
| 77 | } |
| 78 | } |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 79 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 80 | |
| 81 | sleep 2 |
| 82 | |
| 83 | echo "Create BRMSParamVOLTE Policy" |
| 84 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 85 | "policyConfigType": "BRMS_PARAM", |
| 86 | "policyName": "com.BRMSParamVOLTE", |
| 87 | "policyDescription": "BRMS Param VOLTE policy", |
| 88 | "policyScope": "com", |
| 89 | "attributes": { |
| 90 | "MATCHING": { |
| 91 | "controller" : "amsterdam" |
| 92 | }, |
| 93 | "RULE": { |
| 94 | "templateName": "ClosedLoopControlName", |
| 95 | "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", |
| 96 | "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" |
| 97 | } |
| 98 | } |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 99 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 100 | |
| 101 | sleep 2 |
| 102 | |
| 103 | echo "Create BRMSParamvCPE Policy" |
| 104 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 105 | "policyConfigType": "BRMS_PARAM", |
| 106 | "policyName": "com.BRMSParamvCPE", |
| 107 | "policyDescription": "BRMS Param vCPE policy", |
| 108 | "policyScope": "com", |
| 109 | "attributes": { |
| 110 | "MATCHING": { |
| 111 | "controller" : "amsterdam" |
| 112 | }, |
| 113 | "RULE": { |
| 114 | "templateName": "ClosedLoopControlName", |
| 115 | "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", |
| 116 | "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" |
| 117 | } |
| 118 | } |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 119 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 120 | |
| 121 | #########################################Create Micro Service Config policies########################################## |
| 122 | |
| 123 | echo "Create MicroService Config Policies" |
| 124 | |
| 125 | sleep 2 |
| 126 | |
| 127 | echo "Create MicroServicevFirewall Policy" |
| 128 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 129 | "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevFirewall\", \"description\": \"MicroService vFirewall Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"vFirewallBroadcastPackets\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 300, \"direction\": \"LESS_OR_EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ONSET\" }, { \"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 700, \"direction\": \"GREATER_OR_EQUAL\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" } ] }] } } }", |
| 130 | "policyConfigType": "MicroService", |
| 131 | "policyName": "com.MicroServicevFirewall", |
| 132 | "onapName": "DCAE" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 133 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 134 | |
| 135 | |
| 136 | sleep 2 |
| 137 | |
| 138 | echo "Create MicroServicevDNS Policy" |
| 139 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 140 | "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevDNS\", \"description\": \"MicroService vDNS Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"vLoadBalancer\", \"controlLoopSchemaType\": \"VM\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 300, \"direction\": \"GREATER_OR_EQUAL\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" }] }] } } }", |
| 141 | "policyConfigType": "MicroService", |
| 142 | "policyName": "com.MicroServicevDNS", |
| 143 | "onapName": "DCAE" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 144 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 145 | |
| 146 | |
| 147 | sleep 2 |
| 148 | |
| 149 | echo "Create MicroServicevCPE Policy" |
| 150 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 151 | "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevCPE\", \"description\": \"MicroService vCPE Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"Measurement_vGMUX\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ABATED\" }, { \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"GREATER\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" }] }] } } }", |
| 152 | "policyConfigType": "MicroService", |
| 153 | "policyName": "com.MicroServicevCPE", |
| 154 | "onapName": "DCAE" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 155 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 156 | |
| 157 | |
| 158 | #########################################Creating Decision Guard policy######################################### |
| 159 | |
| 160 | sleep 2 |
| 161 | |
| 162 | echo "Creating Decision Guard policy" |
| 163 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 164 | "policyClass": "Decision", |
| 165 | "policyName": "com.AllPermitGuard", |
| 166 | "policyDescription": "Testing all Permit YAML Guard Policy", |
| 167 | "ecompName": "PDPD", |
| 168 | "ruleProvider": "GUARD_YAML", |
| 169 | "attributes": { |
| 170 | "MATCHING": { |
| 171 | "actor": ".*", |
| 172 | "recipe": ".*", |
| 173 | "targets": ".*", |
| 174 | "clname": ".*", |
| 175 | "limit": "10", |
| 176 | "timeWindow": "1", |
| 177 | "timeUnits": "minute", |
| 178 | "guardActiveStart": "00:00:01-05:00", |
| 179 | "guardActiveEnd": "00:00:00-05:00" |
| 180 | } |
| 181 | } |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 182 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 183 | |
| 184 | #########################################Push Decision policy######################################### |
| 185 | |
| 186 | sleep 2 |
| 187 | |
| 188 | echo "Push Decision policy" |
| 189 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 190 | "pdpGroup": "default", |
| 191 | "policyName": "com.AllPermitGuard", |
| 192 | "policyType": "DECISION" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 193 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 194 | |
| 195 | #########################################Pushing BRMS Param policies########################################## |
| 196 | |
| 197 | echo "Pushing BRMSParam Operational policies" |
| 198 | |
| 199 | sleep 2 |
| 200 | |
| 201 | echo "pushPolicy : PUT : com.BRMSParamvFirewall" |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 202 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 203 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 204 | "policyName": "com.BRMSParamvFirewall", |
| 205 | "policyType": "BRMS_Param" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 206 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 207 | |
| 208 | sleep 2 |
| 209 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 210 | echo "pushPolicy : PUT : com.BRMSParamvDNS" |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 211 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 212 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 213 | "policyName": "com.BRMSParamvDNS", |
| 214 | "policyType": "BRMS_Param" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 215 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 216 | |
| 217 | sleep 2 |
| 218 | |
| 219 | echo "pushPolicy : PUT : com.BRMSParamVOLTE" |
| 220 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 221 | "pdpGroup": "default", |
| 222 | "policyName": "com.BRMSParamVOLTE", |
| 223 | "policyType": "BRMS_Param" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 224 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 225 | |
| 226 | sleep 2 |
| 227 | |
| 228 | echo "pushPolicy : PUT : com.BRMSParamvCPE" |
| 229 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 230 | "pdpGroup": "default", |
| 231 | "policyName": "com.BRMSParamvCPE", |
| 232 | "policyType": "BRMS_Param" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 233 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 234 | |
| 235 | #########################################Pushing MicroService Config policies########################################## |
| 236 | |
| 237 | echo "Pushing MicroService Config policies" |
| 238 | |
| 239 | sleep 2 |
| 240 | |
| 241 | echo "pushPolicy : PUT : com.MicroServicevFirewall" |
| 242 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 243 | "pdpGroup": "default", |
| 244 | "policyName": "com.MicroServicevFirewall", |
| 245 | "policyType": "MicroService" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 246 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 247 | |
| 248 | sleep 10 |
| 249 | |
| 250 | echo "pushPolicy : PUT : com.MicroServicevDNS" |
| 251 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 252 | "pdpGroup": "default", |
| 253 | "policyName": "com.MicroServicevDNS", |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 254 | "policyType": "MicroService" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 255 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 256 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 257 | sleep 10 |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 258 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 259 | echo "pushPolicy : PUT : com.MicroServicevCPE" |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 260 | curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 261 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 262 | "policyName": "com.MicroServicevCPE", |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 263 | "policyType": "MicroService" |
BorislavG | 1ffbd99 | 2018-04-24 07:56:27 +0000 | [diff] [blame] | 264 | }' 'http://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |