blob: 9074b9a63a9de18d92cb9ba6810d543ab89b2c0f [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
Vidyashree Ramad73af702018-12-04 08:57:49 +0530142sleep 2
143
144echo "Create BRMSParamCCVPN Policy"
145curl -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 '{
146 "policyConfigType": "BRMS_PARAM",
147 "policyName": "com.BRMSParamCCVPN",
148 "policyDescription": "BRMS Param CCVPN policy",
149 "policyScope": "com",
150 "attributes": {
151 "MATCHING": {
152 "controller" : "amsterdam"
153 },
154 "RULE": {
155 "templateName": "ClosedLoopControlName",
156 "closedLoopControlName": "ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b",
157 "controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b%0D%0A++trigger_policy%3A+unique-policy-id-16-Reroute%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-Reroute%0D%0A++++name%3A+Connectivity Reroute%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++recipe%3A+Reroute%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"
158 }
159 }
160}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
161
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500162#########################################Create Micro Service Config policies##########################################
163
164echo "Create MicroService Config Policies"
165
166sleep 2
167
168echo "Create MicroServicevFirewall Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500169curl -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 -0500170 "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\" } ] }] } } }",
171 "policyConfigType": "MicroService",
172 "policyName": "com.MicroServicevFirewall",
173 "onapName": "DCAE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500174}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500175
176
177sleep 2
178
179echo "Create MicroServicevDNS Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500180curl -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 -0500181 "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\" }] }] } } }",
182 "policyConfigType": "MicroService",
183 "policyName": "com.MicroServicevDNS",
184 "onapName": "DCAE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500185}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500186
187
188sleep 2
189
190echo "Create MicroServicevCPE Policy"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500191curl -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 -0500192 "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 -0500193 "policyConfigType": "MicroService",
194 "policyName": "com.MicroServicevCPE",
195 "onapName": "DCAE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500196}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500197
Michael Mokry3f13e282018-09-13 10:53:26 -0500198#########################################Create SDNC Naming Policies##########################################
199
200echo "Create SDNC Naming Policies"
201
202sleep 2
203
204echo "Create SDNC vFW Naming Policy"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500205curl -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 -0500206 "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\"}]}}",
207 "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP",
208 "policyConfigType": "MicroService",
209 "onapName": "SDNC",
210 "riskLevel": "4",
211 "riskType": "test",
212 "guard": "false",
213 "priority": "4",
214 "description": "ONAP_VFW_NAMING_TIMESTAMP"
215}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
216
217sleep 2
218
219echo "Create SDNC vPG Naming Policy"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500220curl -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 -0500221 "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\"}]}}",
222 "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP",
223 "policyConfigType": "MicroService",
224 "onapName": "SDNC",
225 "riskLevel": "4",
226 "riskType": "test",
227 "guard": "false",
228 "priority": "4",
229 "description": "ONAP_VPG_NAMING_TIMESTAMP"
230}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500231
Alexis de Talhouët01885fa2018-11-07 09:24:19 -0500232sleep 2
233
234echo "Create SDNC vSN Naming Policy"
235curl -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ët814e9f42018-11-08 14:12:50 -0500236 "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\"}]}}",
237 "policyName": "SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP",
Alexis de Talhouët01885fa2018-11-07 09:24:19 -0500238 "policyConfigType": "MicroService",
239 "onapName": "SDNC",
240 "riskLevel": "4",
241 "riskType": "test",
242 "guard": "false",
243 "priority": "4",
Alexis de Talhouët814e9f42018-11-08 14:12:50 -0500244 "description": "ONAP_VSN_NAMING_TIMESTAMP"
Alexis de Talhouët01885fa2018-11-07 09:24:19 -0500245}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
246
Saravanan Abfac07b2018-09-19 18:31:18 +0530247#########################################Creating OOF PCI Policies##########################################
248sleep 2
249
250echo "Create MicroServicevPCI Policy"
251curl -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 '{
252 "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\" } ] }] } } }",
253 "policyConfigType": "MicroService",
254 "policyName": "com.MicroServicevPCI",
255 "onapName": "DCAE"
256}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
257
258sleep 2
259
260echo "Create PCI MS Config Policy"
261curl -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 '{
262 "policyName": "com.PCIMS_CONFIG_POLICY",
263 "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\" }",
264 "policyType": "Config",
265 "attributes" : { "matching" : { "key1" : "value1" } },
266 "policyConfigType": "Base",
267 "onapName": "DCAE",
268 "configName": "PCIMS_CONFIG_POLICY",
269 "configBodyType": "JSON"
270}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
271
272sleep 2
273
274echo "Create OOF Config Policy"
275curl -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 '{
276 "policyName": "com.OOF_PCI_CONFIG_POLICY",
277 "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\" }",
278 "attributes" : { "matching" : { "key1" : "value1" } },
279 "policyType": "Config",
280 "policyConfigType": "Base",
281 "onapName": "DCAE",
282 "configName": "OOF_PCI_CONFIG_POLICY",
283 "configBodyType": "JSON"
284}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
285
Michael Mokryc8070ef2018-09-19 12:05:08 -0500286#########################################Creating Decision Guard policies#########################################
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500287
288sleep 2
289
290echo "Creating Decision Guard policy"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500291curl -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 '{
292 "policyClass": "Decision",
293 "policyName": "com.AllPermitGuard",
294 "policyDescription": "Testing all Permit YAML Guard Policy",
Michael Mokry6d366672018-11-12 20:10:34 -0600295 "onapName": "PDPD",
Michael Mokryc8070ef2018-09-19 12:05:08 -0500296 "ruleProvider": "GUARD_YAML",
297 "attributes": {
298 "MATCHING": {
299 "actor": ".*",
300 "recipe": ".*",
301 "targets": ".*",
302 "clname": ".*",
303 "limit": "10",
304 "timeWindow": "1",
305 "timeUnits": "minute",
306 "guardActiveStart": "00:00:01-05:00",
Michael Mokry6d366672018-11-12 20:10:34 -0600307 "guardActiveEnd": "23:59:59-05:00"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500308 }
309 }
310}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
311
312sleep 2
313
314echo "Creating Decision vDNS Guard - Frequency Limiter policy"
315curl -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 '{
316 "policyClass": "Decision",
317 "policyName": "com.vDNS_Frequency",
318 "policyDescription": "Limit vDNS Scale Up over time period",
Michael Mokry6d366672018-11-12 20:10:34 -0600319 "onapName": "PDPD",
Michael Mokryc8070ef2018-09-19 12:05:08 -0500320 "ruleProvider": "GUARD_YAML",
321 "attributes": {
322 "MATCHING": {
323 "actor": "SO",
324 "recipe": "scaleOut",
325 "targets": ".*",
326 "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
327 "limit": "1",
328 "timeWindow": "10",
329 "timeUnits": "minute",
330 "guardActiveStart": "00:00:01-05:00",
Michael Mokry6d366672018-11-12 20:10:34 -0600331 "guardActiveEnd": "23:59:59-05:00"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500332 }
333 }
334}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
335
336sleep 2
337
338echo "Creating Decision vDNS Guard - Min/Max policy"
339curl -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 '{
340 "policyClass": "Decision",
341 "policyName": "com.vDNS_MinMax",
342 "policyDescription": "Ensure number of instances within a range",
Michael Mokry6d366672018-11-12 20:10:34 -0600343 "onapName": "SampleDemo",
Michael Mokryc8070ef2018-09-19 12:05:08 -0500344 "ruleProvider": "GUARD_MIN_MAX",
345 "attributes": {
346 "MATCHING": {
347 "actor": "SO",
348 "recipe": "scaleOut",
349 "targets": ".*",
350 "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
351 "min": "1",
352 "max": "5",
353 "guardActiveStart": "00:00:01-05:00",
Michael Mokry6d366672018-11-12 20:10:34 -0600354 "guardActiveEnd": "23:59:59-05:00"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500355 }
356 }
Michael Mokry3efae0b2018-08-22 10:58:31 -0500357}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500358
359#########################################Push Decision policy#########################################
360
361sleep 2
362
Michael Mokryc8070ef2018-09-19 12:05:08 -0500363echo "Push Decision policy"
364curl -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 '{
365 "pdpGroup": "default",
366 "policyName": "com.AllPermitGuard",
367 "policyType": "DECISION"
368}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
369
370sleep 2
371
372echo "Push Decision policy"
373curl -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 '{
374 "pdpGroup": "default",
375 "policyName": "com.vDNS_Frequency",
376 "policyType": "DECISION"
377}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
378
379sleep 2
380
381echo "Push Decision policy"
382curl -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 '{
383 "pdpGroup": "default",
384 "policyName": "com.vDNS_MinMax",
385 "policyType": "DECISION"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500386}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500387
388#########################################Pushing BRMS Param policies##########################################
389
390echo "Pushing BRMSParam Operational policies"
391
392sleep 2
393
394echo "pushPolicy : PUT : com.BRMSParamvFirewall"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500395curl -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 +0000396 "pdpGroup": "default",
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500397 "policyName": "com.BRMSParamvFirewall",
398 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500399}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Mandeep Khinda12610242017-09-14 11:37:33 +0000400
401sleep 2
402
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500403echo "pushPolicy : PUT : com.BRMSParamvDNS"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500404curl -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 +0000405 "pdpGroup": "default",
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500406 "policyName": "com.BRMSParamvDNS",
407 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500408}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500409
410sleep 2
411
412echo "pushPolicy : PUT : com.BRMSParamVOLTE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500413curl -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 -0500414 "pdpGroup": "default",
415 "policyName": "com.BRMSParamVOLTE",
416 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500417}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500418
419sleep 2
420
421echo "pushPolicy : PUT : com.BRMSParamvCPE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500422curl -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 -0500423 "pdpGroup": "default",
424 "policyName": "com.BRMSParamvCPE",
425 "policyType": "BRMS_Param"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500426}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500427
Saravanan Abfac07b2018-09-19 18:31:18 +0530428sleep 2
429
430echo "pushPolicy : PUT : com.BRMSParamvPCI"
431curl -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 '{
432 "pdpGroup": "default",
433 "policyName": "com.BRMSParamvPCI",
434 "policyType": "BRMS_Param"
435}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
436
Vidyashree Ramad73af702018-12-04 08:57:49 +0530437sleep 2
438
439echo "pushPolicy : PUT : com.BRMSParamCCVPN"
440curl -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 '{
441 "pdpGroup": "default",
442 "policyName": "com.BRMSParamCCVPN",
443 "policyType": "BRMS_Param"
444}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
445
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500446#########################################Pushing MicroService Config policies##########################################
447
448echo "Pushing MicroService Config policies"
449
450sleep 2
451
452echo "pushPolicy : PUT : com.MicroServicevFirewall"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500453curl -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 -0500454 "pdpGroup": "default",
455 "policyName": "com.MicroServicevFirewall",
456 "policyType": "MicroService"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500457}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500458
459sleep 10
460
461echo "pushPolicy : PUT : com.MicroServicevDNS"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500462curl -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 -0500463 "pdpGroup": "default",
464 "policyName": "com.MicroServicevDNS",
Mandeep Khinda12610242017-09-14 11:37:33 +0000465 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500466}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Mandeep Khinda12610242017-09-14 11:37:33 +0000467
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500468sleep 10
Mandeep Khinda12610242017-09-14 11:37:33 +0000469
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500470echo "pushPolicy : PUT : com.MicroServicevCPE"
Michael Mokry3efae0b2018-08-22 10:58:31 -0500471curl -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 +0000472 "pdpGroup": "default",
Alexis de Talhouëtdf4db0b2017-12-11 08:36:25 -0500473 "policyName": "com.MicroServicevCPE",
Mandeep Khinda12610242017-09-14 11:37:33 +0000474 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500475}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Michael Mokry3f13e282018-09-13 10:53:26 -0500476
477#########################################Pushing SDNC Naming Policies##########################################
478echo "Pushing SDNC Naming Policies"
479
480sleep 2
481
482echo "pushPolicy : PUT : SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP"
483curl -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 '{
484 "pdpGroup": "default",
485 "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP",
486 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500487}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Michael Mokry3f13e282018-09-13 10:53:26 -0500488
489sleep 10
490
491echo "pushPolicy : PUT : SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP"
492curl -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 '{
493 "pdpGroup": "default",
494 "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP",
495 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500496}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Saravanan Abfac07b2018-09-19 18:31:18 +0530497
Alexis de Talhouët01885fa2018-11-07 09:24:19 -0500498sleep 10
499
Alexis de Talhouët814e9f42018-11-08 14:12:50 -0500500echo "pushPolicy : PUT : SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP"
Alexis de Talhouët01885fa2018-11-07 09:24:19 -0500501curl -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 '{
502 "pdpGroup": "default",
Alexis de Talhouët814e9f42018-11-08 14:12:50 -0500503 "policyName": "SDNC_Policy.ONAP_VSN_NAMING_TIMESTAMP",
Alexis de Talhouët01885fa2018-11-07 09:24:19 -0500504 "policyType": "MicroService"
505}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
506
Saravanan Abfac07b2018-09-19 18:31:18 +0530507#########################################Pushing OOF PCI Policies##########################################
508sleep 10
509
510echo "pushPolicy : PUT : com.MicroServicevPCI"
511curl -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 '{
512 "pdpGroup": "default",
513 "policyName": "com.MicroServicevPCI",
514 "policyType": "MicroService"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500515}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Saravanan Abfac07b2018-09-19 18:31:18 +0530516
517sleep 10
518
519echo "pushPolicy : PUT : com.PCIMS_CONFIG_POLICY"
520curl -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 '{
521 "pdpGroup": "default",
522 "policyName": "com.PCIMS_CONFIG_POLICY",
523 "policyType": "Base"
Michael Mokryc8070ef2018-09-19 12:05:08 -0500524}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'
Saravanan Abfac07b2018-09-19 18:31:18 +0530525
526sleep 10
527
528echo "pushPolicy : PUT : com.OOF_PCI_CONFIG_POLICY"
529curl -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 '{
530 "pdpGroup": "default",
531 "policyName": "com.OOF_PCI_CONFIG_POLICY",
532 "policyType": "Base"
Jim Hahn0f1a4122018-10-31 18:36:39 -0400533}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy'