mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada, AT&T |
Jim Hahn | 0f1a412 | 2018-10-31 18:36:39 -0400 | [diff] [blame] | 2 | # Modifications Copyright © 2018 AT&T. All rights reserved. |
mayankg2703 | ced8514 | 2018-03-20 05:42:53 +0000 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 16 | #! /bin/bash |
| 17 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 18 | # 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] | 19 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 20 | #########################################Upload BRMS Param Template########################################## |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 21 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 22 | echo "Upload BRMS Param Template" |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 23 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 24 | sleep 2 |
| 25 | |
Jorge Hernandez | cc11d35 | 2018-10-31 16:32:56 -0500 | [diff] [blame] | 26 | 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?h=casablanca |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 27 | |
| 28 | sleep 2 |
| 29 | |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 30 | 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] | 31 | |
| 32 | echo "PRELOAD_POLICIES is $PRELOAD_POLICIES" |
| 33 | |
| 34 | if [ "$PRELOAD_POLICIES" == "false" ]; then |
| 35 | exit 0 |
| 36 | fi |
| 37 | |
| 38 | #########################################Create BRMS Param policies########################################## |
| 39 | |
| 40 | echo "Create BRMSParam Operational Policies" |
| 41 | |
| 42 | sleep 2 |
| 43 | |
| 44 | echo "Create BRMSParamvFirewall Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 45 | 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] | 46 | "policyConfigType": "BRMS_PARAM", |
| 47 | "policyName": "com.BRMSParamvFirewall", |
| 48 | "policyDescription": "BRMS Param vFirewall policy", |
| 49 | "policyScope": "com", |
| 50 | "attributes": { |
| 51 | "MATCHING": { |
| 52 | "controller" : "amsterdam" |
| 53 | }, |
| 54 | "RULE": { |
| 55 | "templateName": "ClosedLoopControlName", |
| 56 | "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a", |
| 57 | "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" |
| 58 | } |
| 59 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 60 | }' '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] | 61 | |
| 62 | sleep 2 |
| 63 | |
| 64 | echo "Create BRMSParamvDNS Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 65 | 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] | 66 | "policyConfigType": "BRMS_PARAM", |
| 67 | "policyName": "com.BRMSParamvDNS", |
| 68 | "policyDescription": "BRMS Param vDNS policy", |
| 69 | "policyScope": "com", |
| 70 | "attributes": { |
| 71 | "MATCHING": { |
| 72 | "controller" : "amsterdam" |
| 73 | }, |
| 74 | "RULE": { |
| 75 | "templateName": "ClosedLoopControlName", |
| 76 | "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", |
Jim Hahn | 240d7be | 2018-11-02 14:20:33 -0400 | [diff] [blame] | 77 | "controlLoopYaml": "controlLoop%3A%0A++version%3A+2.0.0%0A++controlLoopName%3A+ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A++trigger_policy%3A+unique-policy-id-1-scale-up%0A++timeout%3A+1200%0A++abatement%3A+false%0Apolicies%3A%0A++-+id%3A+unique-policy-id-1-scale-up%0A++++name%3A+Create+a+new+VF+Module%0A++++description%3A%0A++++actor%3A+SO%0A++++recipe%3A+VF+Module+Create%0A++++target%3A%0A++++++type%3A+VNF%0A++++payload%3A%0A++++++requestParameters%3A+%27%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D%27%0A++++++configurationParameters%3A+%27%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D%27%0A++++retry%3A+0%0A++++timeout%3A+1200%0A++++success%3A+final_success%0A++++failure%3A+final_failure%0A++++failure_timeout%3A+final_failure_timeout%0A++++failure_retries%3A+final_failure_retries%0A++++failure_exception%3A+final_failure_exception%0A++++failure_guard%3A+final_failure_guard" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 78 | } |
| 79 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 80 | }' '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] | 81 | |
| 82 | sleep 2 |
| 83 | |
| 84 | echo "Create BRMSParamVOLTE Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 85 | 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] | 86 | "policyConfigType": "BRMS_PARAM", |
| 87 | "policyName": "com.BRMSParamVOLTE", |
| 88 | "policyDescription": "BRMS Param VOLTE policy", |
| 89 | "policyScope": "com", |
| 90 | "attributes": { |
| 91 | "MATCHING": { |
| 92 | "controller" : "amsterdam" |
| 93 | }, |
| 94 | "RULE": { |
| 95 | "templateName": "ClosedLoopControlName", |
| 96 | "closedLoopControlName": "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b", |
| 97 | "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" |
| 98 | } |
| 99 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 100 | }' '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] | 101 | |
| 102 | sleep 2 |
| 103 | |
| 104 | echo "Create BRMSParamvCPE Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 105 | 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] | 106 | "policyConfigType": "BRMS_PARAM", |
| 107 | "policyName": "com.BRMSParamvCPE", |
| 108 | "policyDescription": "BRMS Param vCPE policy", |
| 109 | "policyScope": "com", |
| 110 | "attributes": { |
| 111 | "MATCHING": { |
| 112 | "controller" : "amsterdam" |
| 113 | }, |
| 114 | "RULE": { |
| 115 | "templateName": "ClosedLoopControlName", |
| 116 | "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", |
| 117 | "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" |
| 118 | } |
| 119 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 120 | }' '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] | 121 | |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 122 | sleep 2 |
| 123 | |
| 124 | echo "Create BRMSParamvPCI Policy" |
| 125 | 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] | 126 | "policyConfigType": "BRMS_PARAM", |
| 127 | "policyName": "com.BRMSParamvPCI", |
| 128 | "policyDescription": "BRMS Param vPCI policy", |
| 129 | "policyScope": "com", |
| 130 | "attributes": { |
| 131 | "MATCHING": { |
| 132 | "controller" : "casablanca" |
| 133 | }, |
| 134 | "RULE": { |
| 135 | "templateName": "ClosedLoopControlName", |
| 136 | "closedLoopControlName": "ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459", |
| 137 | "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" |
| 138 | } |
| 139 | } |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 140 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 141 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 142 | #########################################Create Micro Service Config policies########################################## |
| 143 | |
| 144 | echo "Create MicroService Config Policies" |
| 145 | |
| 146 | sleep 2 |
| 147 | |
| 148 | echo "Create MicroServicevFirewall Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 149 | 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] | 150 | "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\" } ] }] } } }", |
| 151 | "policyConfigType": "MicroService", |
| 152 | "policyName": "com.MicroServicevFirewall", |
| 153 | "onapName": "DCAE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 154 | }' '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] | 155 | |
| 156 | |
| 157 | sleep 2 |
| 158 | |
| 159 | echo "Create MicroServicevDNS Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 160 | 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] | 161 | "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\" }] }] } } }", |
| 162 | "policyConfigType": "MicroService", |
| 163 | "policyName": "com.MicroServicevDNS", |
| 164 | "onapName": "DCAE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 165 | }' '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] | 166 | |
| 167 | |
| 168 | sleep 2 |
| 169 | |
| 170 | echo "Create MicroServicevCPE Policy" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 171 | 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] | 172 | "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] | 173 | "policyConfigType": "MicroService", |
| 174 | "policyName": "com.MicroServicevCPE", |
| 175 | "onapName": "DCAE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 176 | }' '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] | 177 | |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 178 | #########################################Create SDNC Naming Policies########################################## |
| 179 | |
| 180 | echo "Create SDNC Naming Policies" |
| 181 | |
| 182 | sleep 2 |
| 183 | |
| 184 | echo "Create SDNC vFW Naming Policy" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 185 | 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] | 186 | "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\"}]}}", |
| 187 | "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", |
| 188 | "policyConfigType": "MicroService", |
| 189 | "onapName": "SDNC", |
| 190 | "riskLevel": "4", |
| 191 | "riskType": "test", |
| 192 | "guard": "false", |
| 193 | "priority": "4", |
| 194 | "description": "ONAP_VFW_NAMING_TIMESTAMP" |
| 195 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 196 | |
| 197 | sleep 2 |
| 198 | |
| 199 | echo "Create SDNC vPG Naming Policy" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 200 | 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] | 201 | "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\"}]}}", |
| 202 | "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", |
| 203 | "policyConfigType": "MicroService", |
| 204 | "onapName": "SDNC", |
| 205 | "riskLevel": "4", |
| 206 | "riskType": "test", |
| 207 | "guard": "false", |
| 208 | "priority": "4", |
| 209 | "description": "ONAP_VPG_NAMING_TIMESTAMP" |
| 210 | }' '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] | 211 | |
Alexis de Talhouët | 01885fa | 2018-11-07 09:24:19 -0500 | [diff] [blame] | 212 | sleep 2 |
| 213 | |
| 214 | echo "Create SDNC vSN Naming 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 '{ |
Alexis de Talhouët | 814e9f4 | 2018-11-08 14:12:50 -0500 | [diff] [blame] | 216 | "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VSN_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\":\"vSN\",\"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\":\"vSN\",\"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\":\"vSN\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vSN\",\"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\":\"vSN\",\"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\":\"vSN\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", |
| 217 | "policyName": "SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP", |
Alexis de Talhouët | 01885fa | 2018-11-07 09:24:19 -0500 | [diff] [blame] | 218 | "policyConfigType": "MicroService", |
| 219 | "onapName": "SDNC", |
| 220 | "riskLevel": "4", |
| 221 | "riskType": "test", |
| 222 | "guard": "false", |
| 223 | "priority": "4", |
Alexis de Talhouët | 814e9f4 | 2018-11-08 14:12:50 -0500 | [diff] [blame] | 224 | "description": "ONAP_VSN_NAMING_TIMESTAMP" |
Alexis de Talhouët | 01885fa | 2018-11-07 09:24:19 -0500 | [diff] [blame] | 225 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 226 | |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 227 | #########################################Creating OOF PCI Policies########################################## |
| 228 | sleep 2 |
| 229 | |
| 230 | echo "Create MicroServicevPCI Policy" |
| 231 | 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 '{ |
| 232 | "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\" } ] }] } } }", |
| 233 | "policyConfigType": "MicroService", |
| 234 | "policyName": "com.MicroServicevPCI", |
| 235 | "onapName": "DCAE" |
| 236 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 237 | |
| 238 | sleep 2 |
| 239 | |
| 240 | echo "Create PCI MS Config Policy" |
| 241 | 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 '{ |
| 242 | "policyName": "com.PCIMS_CONFIG_POLICY", |
| 243 | "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\" }", |
| 244 | "policyType": "Config", |
| 245 | "attributes" : { "matching" : { "key1" : "value1" } }, |
| 246 | "policyConfigType": "Base", |
| 247 | "onapName": "DCAE", |
| 248 | "configName": "PCIMS_CONFIG_POLICY", |
| 249 | "configBodyType": "JSON" |
| 250 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 251 | |
| 252 | sleep 2 |
| 253 | |
| 254 | echo "Create OOF Config Policy" |
| 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 | "policyName": "com.OOF_PCI_CONFIG_POLICY", |
| 257 | "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\" }", |
| 258 | "attributes" : { "matching" : { "key1" : "value1" } }, |
| 259 | "policyType": "Config", |
| 260 | "policyConfigType": "Base", |
| 261 | "onapName": "DCAE", |
| 262 | "configName": "OOF_PCI_CONFIG_POLICY", |
| 263 | "configBodyType": "JSON" |
| 264 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 265 | |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 266 | #########################################Creating Decision Guard policies######################################### |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 267 | |
| 268 | sleep 2 |
| 269 | |
| 270 | echo "Creating Decision Guard policy" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 271 | 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 '{ |
| 272 | "policyClass": "Decision", |
| 273 | "policyName": "com.AllPermitGuard", |
| 274 | "policyDescription": "Testing all Permit YAML Guard Policy", |
| 275 | "ecompName": "PDPD", |
| 276 | "ruleProvider": "GUARD_YAML", |
| 277 | "attributes": { |
| 278 | "MATCHING": { |
| 279 | "actor": ".*", |
| 280 | "recipe": ".*", |
| 281 | "targets": ".*", |
| 282 | "clname": ".*", |
| 283 | "limit": "10", |
| 284 | "timeWindow": "1", |
| 285 | "timeUnits": "minute", |
| 286 | "guardActiveStart": "00:00:01-05:00", |
| 287 | "guardActiveEnd": "00:00:00-05:00" |
| 288 | } |
| 289 | } |
| 290 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 291 | |
| 292 | sleep 2 |
| 293 | |
| 294 | echo "Creating Decision vDNS Guard - Frequency Limiter policy" |
| 295 | 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 '{ |
| 296 | "policyClass": "Decision", |
| 297 | "policyName": "com.vDNS_Frequency", |
| 298 | "policyDescription": "Limit vDNS Scale Up over time period", |
| 299 | "ecompName": "PDPD", |
| 300 | "ruleProvider": "GUARD_YAML", |
| 301 | "attributes": { |
| 302 | "MATCHING": { |
| 303 | "actor": "SO", |
| 304 | "recipe": "scaleOut", |
| 305 | "targets": ".*", |
| 306 | "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", |
| 307 | "limit": "1", |
| 308 | "timeWindow": "10", |
| 309 | "timeUnits": "minute", |
| 310 | "guardActiveStart": "00:00:01-05:00", |
| 311 | "guardActiveEnd": "00:00:00-05:00" |
| 312 | } |
| 313 | } |
| 314 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' |
| 315 | |
| 316 | sleep 2 |
| 317 | |
| 318 | echo "Creating Decision vDNS Guard - Min/Max policy" |
| 319 | 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 '{ |
| 320 | "policyClass": "Decision", |
| 321 | "policyName": "com.vDNS_MinMax", |
| 322 | "policyDescription": "Ensure number of instances within a range", |
| 323 | "ecompName": "PDPD", |
| 324 | "ruleProvider": "GUARD_MIN_MAX", |
| 325 | "attributes": { |
| 326 | "MATCHING": { |
| 327 | "actor": "SO", |
| 328 | "recipe": "scaleOut", |
| 329 | "targets": ".*", |
| 330 | "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", |
| 331 | "min": "1", |
| 332 | "max": "5", |
| 333 | "guardActiveStart": "00:00:01-05:00", |
| 334 | "guardActiveEnd": "00:00:00-05:00" |
| 335 | } |
| 336 | } |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 337 | }' '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] | 338 | |
| 339 | #########################################Push Decision policy######################################### |
| 340 | |
| 341 | sleep 2 |
| 342 | |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 343 | echo "Push Decision policy" |
| 344 | 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 '{ |
| 345 | "pdpGroup": "default", |
| 346 | "policyName": "com.AllPermitGuard", |
| 347 | "policyType": "DECISION" |
| 348 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
| 349 | |
| 350 | sleep 2 |
| 351 | |
| 352 | echo "Push Decision policy" |
| 353 | 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 '{ |
| 354 | "pdpGroup": "default", |
| 355 | "policyName": "com.vDNS_Frequency", |
| 356 | "policyType": "DECISION" |
| 357 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
| 358 | |
| 359 | sleep 2 |
| 360 | |
| 361 | echo "Push Decision policy" |
| 362 | 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 '{ |
| 363 | "pdpGroup": "default", |
| 364 | "policyName": "com.vDNS_MinMax", |
| 365 | "policyType": "DECISION" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 366 | }' '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] | 367 | |
| 368 | #########################################Pushing BRMS Param policies########################################## |
| 369 | |
| 370 | echo "Pushing BRMSParam Operational policies" |
| 371 | |
| 372 | sleep 2 |
| 373 | |
| 374 | echo "pushPolicy : PUT : com.BRMSParamvFirewall" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 375 | 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] | 376 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 377 | "policyName": "com.BRMSParamvFirewall", |
| 378 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 379 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 380 | |
| 381 | sleep 2 |
| 382 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 383 | echo "pushPolicy : PUT : com.BRMSParamvDNS" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 384 | 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] | 385 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 386 | "policyName": "com.BRMSParamvDNS", |
| 387 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 388 | }' '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] | 389 | |
| 390 | sleep 2 |
| 391 | |
| 392 | echo "pushPolicy : PUT : com.BRMSParamVOLTE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 393 | 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] | 394 | "pdpGroup": "default", |
| 395 | "policyName": "com.BRMSParamVOLTE", |
| 396 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 397 | }' '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] | 398 | |
| 399 | sleep 2 |
| 400 | |
| 401 | echo "pushPolicy : PUT : com.BRMSParamvCPE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 402 | 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] | 403 | "pdpGroup": "default", |
| 404 | "policyName": "com.BRMSParamvCPE", |
| 405 | "policyType": "BRMS_Param" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 406 | }' '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] | 407 | |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 408 | sleep 2 |
| 409 | |
| 410 | echo "pushPolicy : PUT : com.BRMSParamvPCI" |
| 411 | 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 '{ |
| 412 | "pdpGroup": "default", |
| 413 | "policyName": "com.BRMSParamvPCI", |
| 414 | "policyType": "BRMS_Param" |
| 415 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
| 416 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 417 | #########################################Pushing MicroService Config policies########################################## |
| 418 | |
| 419 | echo "Pushing MicroService Config policies" |
| 420 | |
| 421 | sleep 2 |
| 422 | |
| 423 | echo "pushPolicy : PUT : com.MicroServicevFirewall" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 424 | 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] | 425 | "pdpGroup": "default", |
| 426 | "policyName": "com.MicroServicevFirewall", |
| 427 | "policyType": "MicroService" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 428 | }' '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] | 429 | |
| 430 | sleep 10 |
| 431 | |
| 432 | echo "pushPolicy : PUT : com.MicroServicevDNS" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 433 | 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] | 434 | "pdpGroup": "default", |
| 435 | "policyName": "com.MicroServicevDNS", |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 436 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 437 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 438 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 439 | sleep 10 |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 440 | |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 441 | echo "pushPolicy : PUT : com.MicroServicevCPE" |
Michael Mokry | 3efae0b | 2018-08-22 10:58:31 -0500 | [diff] [blame] | 442 | 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] | 443 | "pdpGroup": "default", |
Alexis de Talhouët | df4db0b | 2017-12-11 08:36:25 -0500 | [diff] [blame] | 444 | "policyName": "com.MicroServicevCPE", |
Mandeep Khinda | 1261024 | 2017-09-14 11:37:33 +0000 | [diff] [blame] | 445 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 446 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 447 | |
| 448 | #########################################Pushing SDNC Naming Policies########################################## |
| 449 | echo "Pushing SDNC Naming Policies" |
| 450 | |
| 451 | sleep 2 |
| 452 | |
| 453 | echo "pushPolicy : PUT : SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP" |
| 454 | 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 '{ |
| 455 | "pdpGroup": "default", |
| 456 | "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", |
| 457 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 458 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Michael Mokry | 3f13e28 | 2018-09-13 10:53:26 -0500 | [diff] [blame] | 459 | |
| 460 | sleep 10 |
| 461 | |
| 462 | echo "pushPolicy : PUT : SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP" |
| 463 | 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 '{ |
| 464 | "pdpGroup": "default", |
| 465 | "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", |
| 466 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 467 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 468 | |
Alexis de Talhouët | 01885fa | 2018-11-07 09:24:19 -0500 | [diff] [blame] | 469 | sleep 10 |
| 470 | |
Alexis de Talhouët | 814e9f4 | 2018-11-08 14:12:50 -0500 | [diff] [blame] | 471 | echo "pushPolicy : PUT : SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP" |
Alexis de Talhouët | 01885fa | 2018-11-07 09:24:19 -0500 | [diff] [blame] | 472 | 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 '{ |
| 473 | "pdpGroup": "default", |
Alexis de Talhouët | 814e9f4 | 2018-11-08 14:12:50 -0500 | [diff] [blame] | 474 | "policyName": "SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP", |
Alexis de Talhouët | 01885fa | 2018-11-07 09:24:19 -0500 | [diff] [blame] | 475 | "policyType": "MicroService" |
| 476 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
| 477 | |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 478 | #########################################Pushing OOF PCI Policies########################################## |
| 479 | sleep 10 |
| 480 | |
| 481 | echo "pushPolicy : PUT : com.MicroServicevPCI" |
| 482 | 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 '{ |
| 483 | "pdpGroup": "default", |
| 484 | "policyName": "com.MicroServicevPCI", |
| 485 | "policyType": "MicroService" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 486 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 487 | |
| 488 | sleep 10 |
| 489 | |
| 490 | echo "pushPolicy : PUT : com.PCIMS_CONFIG_POLICY" |
| 491 | 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 '{ |
| 492 | "pdpGroup": "default", |
| 493 | "policyName": "com.PCIMS_CONFIG_POLICY", |
| 494 | "policyType": "Base" |
Michael Mokry | c8070ef | 2018-09-19 12:05:08 -0500 | [diff] [blame] | 495 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |
Saravanan A | bfac07b | 2018-09-19 18:31:18 +0530 | [diff] [blame] | 496 | |
| 497 | sleep 10 |
| 498 | |
| 499 | echo "pushPolicy : PUT : com.OOF_PCI_CONFIG_POLICY" |
| 500 | 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 '{ |
| 501 | "pdpGroup": "default", |
| 502 | "policyName": "com.OOF_PCI_CONFIG_POLICY", |
| 503 | "policyType": "Base" |
Jim Hahn | 0f1a412 | 2018-10-31 18:36:39 -0400 | [diff] [blame] | 504 | }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' |