blob: bdf5933318dcd15089b598866450604169936ea4 [file] [log] [blame]
mayankg2703ced85142018-03-20 05:42:53 +00001# Copyright © 2017 Amdocs, Bell Canada, AT&T
Jim Hahn0f1a4122018-10-31 18:36:39 -04002# Modifications Copyright © 2018 AT&T. All rights reserved.
mayankg2703ced85142018-03-20 05:42:53 +00003#
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 Khinda12610242017-09-14 11:37:33 +000016#! /bin/bash
17
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -050018# 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 Khinda12610242017-09-14 11:37:33 +000019
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -050020#########################################Upload BRMS Param Template##########################################
Mandeep Khinda12610242017-09-14 11:37:33 +000021
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -050022echo "Upload BRMS Param Template"
Mandeep Khinda12610242017-09-14 11:37:33 +000023
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -050024sleep 2
25
Jorge Hernandezcc11d352018-10-31 16:32:56 -050026wget -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ëtdf4db0b2017-12-11 08:36:25 -050027
28sleep 2
29
Michael Mokryc8070ef2018-09-19 12:05:08 -050030curl -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ëtdf4db0b2017-12-11 08:36:25 -050031
32echo "PRELOAD_POLICIES is $PRELOAD_POLICIES"
33
34if [ "$PRELOAD_POLICIES" == "false" ]; then
35 exit 0
36fi
37
38#########################################Create BRMS Param policies##########################################
39
40echo "Create BRMSParam Operational Policies"
41
42sleep 2
43
44echo "Create BRMSParamvFirewall Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -050045curl -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 Mokryc8070ef2018-09-19 12:05:08 -050046 "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 Mokry3efae0b2018-08-22 10:58:31 -050060}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -050061
62sleep 2
63
64echo "Create BRMSParamvDNS Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -050065curl -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 Mokryc8070ef2018-09-19 12:05:08 -050066 "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 Hahn240d7be2018-11-02 14:20:33 -040077 "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 Mokryc8070ef2018-09-19 12:05:08 -050078 }
79 }
Michael Mokry3efae0b2018-08-22 10:58:31 -050080}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -050081
82sleep 2
83
84echo "Create BRMSParamVOLTE Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -050085curl -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 Mokryc8070ef2018-09-19 12:05:08 -050086 "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 Mokry3efae0b2018-08-22 10:58:31 -0500100}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500101
102sleep 2
103
104echo "Create BRMSParamvCPE Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500105curl -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 Mokryc8070ef2018-09-19 12:05:08 -0500106 "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 Mokry3efae0b2018-08-22 10:58:31 -0500120}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500121
Saravanan Abfac07b2018-09-19 18:31:18 +0530122sleep 2
123
124echo "Create BRMSParamvPCI Policy"
125curl -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 Mokryc8070ef2018-09-19 12:05:08 -0500126 "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 Abfac07b2018-09-19 18:31:18 +0530140}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
141
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500142#########################################Create Micro Service Config policies##########################################
143
144echo "Create MicroService Config Policies"
145
146sleep 2
147
148echo "Create MicroServicevFirewall Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500149curl -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 Mokryc8070ef2018-09-19 12:05:08 -0500150 "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 Mokry3efae0b2018-08-22 10:58:31 -0500154}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500155
156
157sleep 2
158
159echo "Create MicroServicevDNS Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500160curl -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 Mokryc8070ef2018-09-19 12:05:08 -0500161 "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 Mokry3efae0b2018-08-22 10:58:31 -0500165}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500166
167
168sleep 2
169
170echo "Create MicroServicevCPE Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500171curl -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 Mokry3f13e282018-09-13 10:53:26 -0500172 "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 Mokryc8070ef2018-09-19 12:05:08 -0500173 "policyConfigType": "MicroService",
174 "policyName": "com.MicroServicevCPE",
175 "onapName": "DCAE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500176}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500177
Michael Mokry3f13e282018-09-13 10:53:26 -0500178#########################################Create SDNC Naming Policies##########################################
179
180echo "Create SDNC Naming Policies"
181
182sleep 2
183
184echo "Create SDNC vFW Naming Policy"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500185curl -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 Mokry3f13e282018-09-13 10:53:26 -0500186 "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
197sleep 2
198
199echo "Create SDNC vPG Naming Policy"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500200curl -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 Mokry3f13e282018-09-13 10:53:26 -0500201 "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ëtdf4db0b2017-12-11 08:36:25 -0500211
Saravanan Abfac07b2018-09-19 18:31:18 +0530212#########################################Creating OOF PCI Policies##########################################
213sleep 2
214
215echo "Create MicroServicevPCI Policy"
216curl -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 '{
217 "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\" } ] }] } } }",
218 "policyConfigType": "MicroService",
219 "policyName": "com.MicroServicevPCI",
220 "onapName": "DCAE"
221}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
222
223sleep 2
224
225echo "Create PCI MS Config Policy"
226curl -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 '{
227 "policyName": "com.PCIMS_CONFIG_POLICY",
228 "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\" }",
229 "policyType": "Config",
230 "attributes" : { "matching" : { "key1" : "value1" } },
231 "policyConfigType": "Base",
232 "onapName": "DCAE",
233 "configName": "PCIMS_CONFIG_POLICY",
234 "configBodyType": "JSON"
235}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
236
237sleep 2
238
239echo "Create OOF Config Policy"
240curl -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 '{
241 "policyName": "com.OOF_PCI_CONFIG_POLICY",
242 "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\" }",
243 "attributes" : { "matching" : { "key1" : "value1" } },
244 "policyType": "Config",
245 "policyConfigType": "Base",
246 "onapName": "DCAE",
247 "configName": "OOF_PCI_CONFIG_POLICY",
248 "configBodyType": "JSON"
249}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
250
Michael Mokryc8070ef2018-09-19 12:05:08 -0500251#########################################Creating Decision Guard policies#########################################
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500252
253sleep 2
254
255echo "Creating Decision Guard policy"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500256curl -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 '{
257 "policyClass": "Decision",
258 "policyName": "com.AllPermitGuard",
259 "policyDescription": "Testing all Permit YAML Guard Policy",
260 "ecompName": "PDPD",
261 "ruleProvider": "GUARD_YAML",
262 "attributes": {
263 "MATCHING": {
264 "actor": ".*",
265 "recipe": ".*",
266 "targets": ".*",
267 "clname": ".*",
268 "limit": "10",
269 "timeWindow": "1",
270 "timeUnits": "minute",
271 "guardActiveStart": "00:00:01-05:00",
272 "guardActiveEnd": "00:00:00-05:00"
273 }
274 }
275}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
276
277sleep 2
278
279echo "Creating Decision vDNS Guard - Frequency Limiter policy"
280curl -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 '{
281 "policyClass": "Decision",
282 "policyName": "com.vDNS_Frequency",
283 "policyDescription": "Limit vDNS Scale Up over time period",
284 "ecompName": "PDPD",
285 "ruleProvider": "GUARD_YAML",
286 "attributes": {
287 "MATCHING": {
288 "actor": "SO",
289 "recipe": "scaleOut",
290 "targets": ".*",
291 "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
292 "limit": "1",
293 "timeWindow": "10",
294 "timeUnits": "minute",
295 "guardActiveStart": "00:00:01-05:00",
296 "guardActiveEnd": "00:00:00-05:00"
297 }
298 }
299}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
300
301sleep 2
302
303echo "Creating Decision vDNS Guard - Min/Max policy"
304curl -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 '{
305 "policyClass": "Decision",
306 "policyName": "com.vDNS_MinMax",
307 "policyDescription": "Ensure number of instances within a range",
308 "ecompName": "PDPD",
309 "ruleProvider": "GUARD_MIN_MAX",
310 "attributes": {
311 "MATCHING": {
312 "actor": "SO",
313 "recipe": "scaleOut",
314 "targets": ".*",
315 "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
316 "min": "1",
317 "max": "5",
318 "guardActiveStart": "00:00:01-05:00",
319 "guardActiveEnd": "00:00:00-05:00"
320 }
321 }
Michael Mokry3efae0b2018-08-22 10:58:31 -0500322}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500323
324#########################################Push Decision policy#########################################
325
326sleep 2
327
Michael Mokryc8070ef2018-09-19 12:05:08 -0500328echo "Push Decision policy"
329curl -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 '{
330 "pdpGroup": "default",
331 "policyName": "com.AllPermitGuard",
332 "policyType": "DECISION"
333}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
334
335sleep 2
336
337echo "Push Decision policy"
338curl -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 '{
339 "pdpGroup": "default",
340 "policyName": "com.vDNS_Frequency",
341 "policyType": "DECISION"
342}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
343
344sleep 2
345
346echo "Push Decision policy"
347curl -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 '{
348 "pdpGroup": "default",
349 "policyName": "com.vDNS_MinMax",
350 "policyType": "DECISION"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500351}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500352
353#########################################Pushing BRMS Param policies##########################################
354
355echo "Pushing BRMSParam Operational policies"
356
357sleep 2
358
359echo "pushPolicy : PUT : com.BRMSParamvFirewall"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500360curl -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 Khinda12610242017-09-14 11:37:33 +0000361 "pdpGroup": "default",
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500362 "policyName": "com.BRMSParamvFirewall",
363 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500364}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Mandeep Khinda12610242017-09-14 11:37:33 +0000365
366sleep 2
367
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500368echo "pushPolicy : PUT : com.BRMSParamvDNS"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500369curl -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 Khinda12610242017-09-14 11:37:33 +0000370 "pdpGroup": "default",
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500371 "policyName": "com.BRMSParamvDNS",
372 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500373}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500374
375sleep 2
376
377echo "pushPolicy : PUT : com.BRMSParamVOLTE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500378curl -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ëtdf4db0b2017-12-11 08:36:25 -0500379 "pdpGroup": "default",
380 "policyName": "com.BRMSParamVOLTE",
381 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500382}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500383
384sleep 2
385
386echo "pushPolicy : PUT : com.BRMSParamvCPE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500387curl -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ëtdf4db0b2017-12-11 08:36:25 -0500388 "pdpGroup": "default",
389 "policyName": "com.BRMSParamvCPE",
390 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500391}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500392
Saravanan Abfac07b2018-09-19 18:31:18 +0530393sleep 2
394
395echo "pushPolicy : PUT : com.BRMSParamvPCI"
396curl -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 '{
397 "pdpGroup": "default",
398 "policyName": "com.BRMSParamvPCI",
399 "policyType": "BRMS_Param"
400}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
401
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500402#########################################Pushing MicroService Config policies##########################################
403
404echo "Pushing MicroService Config policies"
405
406sleep 2
407
408echo "pushPolicy : PUT : com.MicroServicevFirewall"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500409curl -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ëtdf4db0b2017-12-11 08:36:25 -0500410 "pdpGroup": "default",
411 "policyName": "com.MicroServicevFirewall",
412 "policyType": "MicroService"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500413}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500414
415sleep 10
416
417echo "pushPolicy : PUT : com.MicroServicevDNS"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500418curl -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ëtdf4db0b2017-12-11 08:36:25 -0500419 "pdpGroup": "default",
420 "policyName": "com.MicroServicevDNS",
Mandeep Khinda12610242017-09-14 11:37:33 +0000421 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500422}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Mandeep Khinda12610242017-09-14 11:37:33 +0000423
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500424sleep 10
Mandeep Khinda12610242017-09-14 11:37:33 +0000425
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500426echo "pushPolicy : PUT : com.MicroServicevCPE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500427curl -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 Khinda12610242017-09-14 11:37:33 +0000428 "pdpGroup": "default",
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500429 "policyName": "com.MicroServicevCPE",
Mandeep Khinda12610242017-09-14 11:37:33 +0000430 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500431}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Michael Mokry3f13e282018-09-13 10:53:26 -0500432
433#########################################Pushing SDNC Naming Policies##########################################
434echo "Pushing SDNC Naming Policies"
435
436sleep 2
437
438echo "pushPolicy : PUT : SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP"
439curl -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 '{
440 "pdpGroup": "default",
441 "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP",
442 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500443}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Michael Mokry3f13e282018-09-13 10:53:26 -0500444
445sleep 10
446
447echo "pushPolicy : PUT : SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP"
448curl -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 '{
449 "pdpGroup": "default",
450 "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP",
451 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500452}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Saravanan Abfac07b2018-09-19 18:31:18 +0530453
454#########################################Pushing OOF PCI Policies##########################################
455sleep 10
456
457echo "pushPolicy : PUT : com.MicroServicevPCI"
458curl -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 '{
459 "pdpGroup": "default",
460 "policyName": "com.MicroServicevPCI",
461 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500462}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Saravanan Abfac07b2018-09-19 18:31:18 +0530463
464sleep 10
465
466echo "pushPolicy : PUT : com.PCIMS_CONFIG_POLICY"
467curl -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 '{
468 "pdpGroup": "default",
469 "policyName": "com.PCIMS_CONFIG_POLICY",
470 "policyType": "Base"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500471}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Saravanan Abfac07b2018-09-19 18:31:18 +0530472
473sleep 10
474
475echo "pushPolicy : PUT : com.OOF_PCI_CONFIG_POLICY"
476curl -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 '{
477 "pdpGroup": "default",
478 "policyName": "com.OOF_PCI_CONFIG_POLICY",
479 "policyType": "Base"
Jim Hahn0f1a4122018-10-31 18:36:39 -0400480}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'