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 | |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 29 | curl -k -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\"}" 'https://{{.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" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 44 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 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 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 59 | }' 'https://{{.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" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 64 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 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 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 79 | }' 'https://{{.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" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 84 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 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 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 99 | }' 'https://{{.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" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 104 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 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 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 119 | }' 'https://{{.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 | |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 121 | sleep 2 |
| 122 | |
| 123 | echo "Create BRMSParamvPCI Policy" |
| 124 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 125 | "policyConfigType": "BRMS_PARAM", |
| 126 | "policyName": "com.BRMSParamvPCI", |
| 127 | "policyDescription": "BRMS Param vPCI policy", |
| 128 | "policyScope": "com", |
| 129 | "attributes": { |
| 130 | "MATCHING": { |
| 131 | "controller" : "casablanca" |
| 132 | }, |
| 133 | "RULE": { |
| 134 | "templateName": "ClosedLoopControlName", |
| 135 | "closedLoopControlName": "ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459", |
| 136 | "controlLoopYaml": "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" |
| 137 | } |
| 138 | } |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 139 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 140 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 141 | #########################################Create Micro Service Config policies########################################## |
| 142 | |
| 143 | echo "Create MicroService Config Policies" |
| 144 | |
| 145 | sleep 2 |
| 146 | |
| 147 | echo "Create MicroServicevFirewall Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 148 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 149 | "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\" } ] }] } } }", |
| 150 | "policyConfigType": "MicroService", |
| 151 | "policyName": "com.MicroServicevFirewall", |
| 152 | "onapName": "DCAE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 153 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 154 | |
| 155 | |
| 156 | sleep 2 |
| 157 | |
| 158 | echo "Create MicroServicevDNS Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 159 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 160 | "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\" }] }] } } }", |
| 161 | "policyConfigType": "MicroService", |
| 162 | "policyName": "com.MicroServicevDNS", |
| 163 | "onapName": "DCAE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 164 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 165 | |
| 166 | |
| 167 | sleep 2 |
| 168 | |
| 169 | echo "Create MicroServicevCPE Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 170 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 171 | "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\" }] }] } } }", |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 172 | "policyConfigType": "MicroService", |
| 173 | "policyName": "com.MicroServicevCPE", |
| 174 | "onapName": "DCAE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 175 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 176 | |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 177 | #########################################Create SDNC Naming Policies########################################## |
| 178 | |
| 179 | echo "Create SDNC Naming Policies" |
| 180 | |
| 181 | sleep 2 |
| 182 | |
| 183 | echo "Create SDNC vFW Naming Policy" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 184 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 185 | "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VFW_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vFW\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", |
| 186 | "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", |
| 187 | "policyConfigType": "MicroService", |
| 188 | "onapName": "SDNC", |
| 189 | "riskLevel": "4", |
| 190 | "riskType": "test", |
| 191 | "guard": "false", |
| 192 | "priority": "4", |
| 193 | "description": "ONAP_VFW_NAMING_TIMESTAMP" |
| 194 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 195 | |
| 196 | sleep 2 |
| 197 | |
| 198 | echo "Create SDNC vPG Naming Policy" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 199 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 200 | "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VPG_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vPG\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", |
| 201 | "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", |
| 202 | "policyConfigType": "MicroService", |
| 203 | "onapName": "SDNC", |
| 204 | "riskLevel": "4", |
| 205 | "riskType": "test", |
| 206 | "guard": "false", |
| 207 | "priority": "4", |
| 208 | "description": "ONAP_VPG_NAMING_TIMESTAMP" |
| 209 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 210 | |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 211 | #########################################Creating OOF PCI Policies########################################## |
| 212 | sleep 2 |
| 213 | |
| 214 | echo "Create MicroServicevPCI Policy" |
| 215 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 216 | "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation_pci\", \"uuid\": \"test_pci\", \"policyName\": \"MicroServicevPCI\", \"description\": \"MicroService vPCI Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459\", \"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-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.executePolicy\", \"thresholdValue\": 1, \"direction\": \"GREATER_OR_EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ONSET\" } ] }] } } }", |
| 217 | "policyConfigType": "MicroService", |
| 218 | "policyName": "com.MicroServicevPCI", |
| 219 | "onapName": "DCAE" |
| 220 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 221 | |
| 222 | sleep 2 |
| 223 | |
| 224 | echo "Create PCI MS Config Policy" |
| 225 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 226 | "policyName": "com.PCIMS_CONFIG_POLICY", |
| 227 | "configBody": "{ \"PCI_NEIGHBOR_CHANGE_CLUSTER_TIMEOUT_IN_SECS\":60, \"PCI_MODCONFIG_POLICY_NAME\":\"ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459\", \"PCI_OPTMIZATION_ALGO_CATEGORY_IN_OOF\":\"OOF-PCI-OPTIMIZATION\", \"PCI_SDNR_TARGET_NAME\":\"SDNR\" }", |
| 228 | "policyType": "Config", |
| 229 | "attributes" : { "matching" : { "key1" : "value1" } }, |
| 230 | "policyConfigType": "Base", |
| 231 | "onapName": "DCAE", |
| 232 | "configName": "PCIMS_CONFIG_POLICY", |
| 233 | "configBodyType": "JSON" |
| 234 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 235 | |
| 236 | sleep 2 |
| 237 | |
| 238 | echo "Create OOF Config Policy" |
| 239 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 240 | "policyName": "com.OOF_PCI_CONFIG_POLICY", |
| 241 | "configBody": "{ \"ALGO_CATEGORY\":\"OOF-PCI-OPTIMIZATION\", \"PCI_OPTMIZATION_ALGO_NAME\":\"OOF-PCI-OPTIMIZATION-LEVEL1\", \"PCI_OPTIMIZATION_NW_CONSTRAINT\":\"MAX5PCICHANGESONLY\", \"PCI_OPTIMIZATION_PRIORITY\": 2, \"PCI_OPTIMIZATION_TIME_CONSTRAINT\":\"ONLYATNIGHT\" }", |
| 242 | "attributes" : { "matching" : { "key1" : "value1" } }, |
| 243 | "policyType": "Config", |
| 244 | "policyConfigType": "Base", |
| 245 | "onapName": "DCAE", |
| 246 | "configName": "OOF_PCI_CONFIG_POLICY", |
| 247 | "configBodyType": "JSON" |
| 248 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 249 | |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 250 | #########################################Creating Decision Guard policies######################################### |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 251 | |
| 252 | sleep 2 |
| 253 | |
| 254 | echo "Creating Decision Guard policy" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 255 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 256 | "policyClass": "Decision", |
| 257 | "policyName": "com.AllPermitGuard", |
| 258 | "policyDescription": "Testing all Permit YAML Guard Policy", |
| 259 | "ecompName": "PDPD", |
| 260 | "ruleProvider": "GUARD_YAML", |
| 261 | "attributes": { |
| 262 | "MATCHING": { |
| 263 | "actor": ".*", |
| 264 | "recipe": ".*", |
| 265 | "targets": ".*", |
| 266 | "clname": ".*", |
| 267 | "limit": "10", |
| 268 | "timeWindow": "1", |
| 269 | "timeUnits": "minute", |
| 270 | "guardActiveStart": "00:00:01-05:00", |
| 271 | "guardActiveEnd": "00:00:00-05:00" |
| 272 | } |
| 273 | } |
| 274 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 275 | |
| 276 | sleep 2 |
| 277 | |
| 278 | echo "Creating Decision vDNS Guard - Frequency Limiter policy" |
| 279 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 280 | "policyClass": "Decision", |
| 281 | "policyName": "com.vDNS_Frequency", |
| 282 | "policyDescription": "Limit vDNS Scale Up over time period", |
| 283 | "ecompName": "PDPD", |
| 284 | "ruleProvider": "GUARD_YAML", |
| 285 | "attributes": { |
| 286 | "MATCHING": { |
| 287 | "actor": "SO", |
| 288 | "recipe": "scaleOut", |
| 289 | "targets": ".*", |
| 290 | "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", |
| 291 | "limit": "1", |
| 292 | "timeWindow": "10", |
| 293 | "timeUnits": "minute", |
| 294 | "guardActiveStart": "00:00:01-05:00", |
| 295 | "guardActiveEnd": "00:00:00-05:00" |
| 296 | } |
| 297 | } |
| 298 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 299 | |
| 300 | sleep 2 |
| 301 | |
| 302 | echo "Creating Decision vDNS Guard - Min/Max policy" |
| 303 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 304 | "policyClass": "Decision", |
| 305 | "policyName": "com.vDNS_MinMax", |
| 306 | "policyDescription": "Ensure number of instances within a range", |
| 307 | "ecompName": "PDPD", |
| 308 | "ruleProvider": "GUARD_MIN_MAX", |
| 309 | "attributes": { |
| 310 | "MATCHING": { |
| 311 | "actor": "SO", |
| 312 | "recipe": "scaleOut", |
| 313 | "targets": ".*", |
| 314 | "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", |
| 315 | "min": "1", |
| 316 | "max": "5", |
| 317 | "guardActiveStart": "00:00:01-05:00", |
| 318 | "guardActiveEnd": "00:00:00-05:00" |
| 319 | } |
| 320 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 321 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 322 | |
| 323 | #########################################Push Decision policy######################################### |
| 324 | |
| 325 | sleep 2 |
| 326 | |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 327 | echo "Push Decision policy" |
| 328 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 329 | "pdpGroup": "default", |
| 330 | "policyName": "com.AllPermitGuard", |
| 331 | "policyType": "DECISION" |
| 332 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
| 333 | |
| 334 | sleep 2 |
| 335 | |
| 336 | echo "Push Decision policy" |
| 337 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 338 | "pdpGroup": "default", |
| 339 | "policyName": "com.vDNS_Frequency", |
| 340 | "policyType": "DECISION" |
| 341 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
| 342 | |
| 343 | sleep 2 |
| 344 | |
| 345 | echo "Push Decision policy" |
| 346 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 347 | "pdpGroup": "default", |
| 348 | "policyName": "com.vDNS_MinMax", |
| 349 | "policyType": "DECISION" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 350 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 351 | |
| 352 | #########################################Pushing BRMS Param policies########################################## |
| 353 | |
| 354 | echo "Pushing BRMSParam Operational policies" |
| 355 | |
| 356 | sleep 2 |
| 357 | |
| 358 | echo "pushPolicy : PUT : com.BRMSParamvFirewall" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 359 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 360 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 361 | "policyName": "com.BRMSParamvFirewall", |
| 362 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 363 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 364 | |
| 365 | sleep 2 |
| 366 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 367 | echo "pushPolicy : PUT : com.BRMSParamvDNS" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 368 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 369 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 370 | "policyName": "com.BRMSParamvDNS", |
| 371 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 372 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 373 | |
| 374 | sleep 2 |
| 375 | |
| 376 | echo "pushPolicy : PUT : com.BRMSParamVOLTE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 377 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 378 | "pdpGroup": "default", |
| 379 | "policyName": "com.BRMSParamVOLTE", |
| 380 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 381 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 382 | |
| 383 | sleep 2 |
| 384 | |
| 385 | echo "pushPolicy : PUT : com.BRMSParamvCPE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 386 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 387 | "pdpGroup": "default", |
| 388 | "policyName": "com.BRMSParamvCPE", |
| 389 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 390 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 391 | |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 392 | sleep 2 |
| 393 | |
| 394 | echo "pushPolicy : PUT : com.BRMSParamvPCI" |
| 395 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 396 | "pdpGroup": "default", |
| 397 | "policyName": "com.BRMSParamvPCI", |
| 398 | "policyType": "BRMS_Param" |
| 399 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
| 400 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 401 | #########################################Pushing MicroService Config policies########################################## |
| 402 | |
| 403 | echo "Pushing MicroService Config policies" |
| 404 | |
| 405 | sleep 2 |
| 406 | |
| 407 | echo "pushPolicy : PUT : com.MicroServicevFirewall" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 408 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 409 | "pdpGroup": "default", |
| 410 | "policyName": "com.MicroServicevFirewall", |
| 411 | "policyType": "MicroService" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 412 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 413 | |
| 414 | sleep 10 |
| 415 | |
| 416 | echo "pushPolicy : PUT : com.MicroServicevDNS" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 417 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 418 | "pdpGroup": "default", |
| 419 | "policyName": "com.MicroServicevDNS", |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 420 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 421 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 422 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 423 | sleep 10 |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 424 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 425 | echo "pushPolicy : PUT : com.MicroServicevCPE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 426 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 427 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 428 | "policyName": "com.MicroServicevCPE", |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 429 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 430 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 431 | |
| 432 | #########################################Pushing SDNC Naming Policies########################################## |
| 433 | echo "Pushing SDNC Naming Policies" |
| 434 | |
| 435 | sleep 2 |
| 436 | |
| 437 | echo "pushPolicy : PUT : SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP" |
| 438 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 439 | "pdpGroup": "default", |
| 440 | "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", |
| 441 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 442 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 443 | |
| 444 | sleep 10 |
| 445 | |
| 446 | echo "pushPolicy : PUT : SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP" |
| 447 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 448 | "pdpGroup": "default", |
| 449 | "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", |
| 450 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 451 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 452 | |
| 453 | #########################################Pushing OOF PCI Policies########################################## |
| 454 | sleep 10 |
| 455 | |
| 456 | echo "pushPolicy : PUT : com.MicroServicevPCI" |
| 457 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 458 | "pdpGroup": "default", |
| 459 | "policyName": "com.MicroServicevPCI", |
| 460 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 461 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 462 | |
| 463 | sleep 10 |
| 464 | |
| 465 | echo "pushPolicy : PUT : com.PCIMS_CONFIG_POLICY" |
| 466 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 467 | "pdpGroup": "default", |
| 468 | "policyName": "com.PCIMS_CONFIG_POLICY", |
| 469 | "policyType": "Base" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 470 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 471 | |
| 472 | sleep 10 |
| 473 | |
| 474 | echo "pushPolicy : PUT : com.OOF_PCI_CONFIG_POLICY" |
| 475 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 476 | "pdpGroup": "default", |
| 477 | "policyName": "com.OOF_PCI_CONFIG_POLICY", |
| 478 | "policyType": "Base" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 479 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |