onap on kubernetes source files
[oom.git] / kubernetes / config / docker / init / src / config / policy / opt / policy / config / pe / push-policies.sh
1 #! /bin/bash
2
3
4 echo "Pushing default policies"
5
6 # Sometimes brmsgw gets an error when trying to retrieve the policies on initial push,
7 # so for the BRMS policies we will do a push, then delete from the pdp group, then push again.
8 # Second push should be successful.
9
10 curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
11   "pdpGroup": "default",
12   "policyName": "vFirewall",
13   "policyScope": "com",
14   "policyType": "MicroService"
15 }' 'http://pypdp:8480/PyPDPServer/pushPolicy'
16
17 sleep 2
18
19 curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
20   "pdpGroup": "default",
21   "policyName": "vLoadBalancer",
22   "policyScope": "com",
23   "policyType": "MicroService"
24 }' 'http://pypdp:8480/PyPDPServer/pushPolicy' 
25
26 sleep 2
27 curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
28   "pdpGroup": "default",
29   "policyName": "BRMSParamvLBDemoPolicy",
30   "policyScope": "com",
31   "policyType": "BRMS_Param"
32 }' 'http://pypdp:8480/PyPDPServer/pushPolicy'
33
34 sleep 2
35
36 curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
37   "pdpGroup": "default",
38   "policyName": "BRMSParamvFWDemoPolicy",
39   "policyScope": "com",
40   "policyType": "BRMS_Param"
41 }' 'http://pypdp:8480/PyPDPServer/pushPolicy'
42
43 sleep 2
44
45 curl -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
46 "pdpGroup": "default",
47 "policyComponent": "PDP",
48 "policyName": "com.Config_BRMS_Param_BRMSParamvFWDemoPolicy.1.xml"
49 }' 'http://pypdp:8480/PyPDPServer/deletePolicy'
50
51
52
53 curl -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
54 "pdpGroup": "default",
55 "policyComponent": "PDP",
56 "policyName": "com.Config_BRMS_Param_BRMSParamvLBDemoPolicy.1.xml"
57 }' 'http://pypdp:8480/PyPDPServer/deletePolicy'
58
59 sleep 2
60 curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
61   "pdpGroup": "default",
62   "policyName": "BRMSParamvLBDemoPolicy",
63   "policyScope": "com",
64   "policyType": "BRMS_Param"
65 }' 'http://pypdp:8480/PyPDPServer/pushPolicy'
66
67 sleep 2
68
69 curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
70   "pdpGroup": "default",
71   "policyName": "BRMSParamvFWDemoPolicy",
72   "policyScope": "com",
73   "policyType": "BRMS_Param"
74 }' 'http://pypdp:8480/PyPDPServer/pushPolicy'
75