aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/config/docker/init/src/config/policy/opt/policy/config/pe/push-policies.sh
blob: 957156edb8f347a681195eed8de9c95366775be4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/bash


echo "Pushing default policies"

# Sometimes brmsgw gets an error when trying to retrieve the policies on initial push,
# so for the BRMS policies we will do a push, then delete from the pdp group, then push again.
# Second push should be successful.

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
  "pdpGroup": "default",
  "policyName": "vFirewall",
  "policyScope": "com",
  "policyType": "MicroService"
}' 'http://pypdp:8480/PyPDPServer/pushPolicy'

sleep 2

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
  "pdpGroup": "default",
  "policyName": "vLoadBalancer",
  "policyScope": "com",
  "policyType": "MicroService"
}' 'http://pypdp:8480/PyPDPServer/pushPolicy' 

sleep 2
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
  "pdpGroup": "default",
  "policyName": "BRMSParamvLBDemoPolicy",
  "policyScope": "com",
  "policyType": "BRMS_Param"
}' 'http://pypdp:8480/PyPDPServer/pushPolicy'

sleep 2

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
  "pdpGroup": "default",
  "policyName": "BRMSParamvFWDemoPolicy",
  "policyScope": "com",
  "policyType": "BRMS_Param"
}' 'http://pypdp:8480/PyPDPServer/pushPolicy'

sleep 2

curl -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
"pdpGroup": "default",
"policyComponent": "PDP",
"policyName": "com.Config_BRMS_Param_BRMSParamvFWDemoPolicy.1.xml"
}' 'http://pypdp:8480/PyPDPServer/deletePolicy'



curl -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
"pdpGroup": "default",
"policyComponent": "PDP",
"policyName": "com.Config_BRMS_Param_BRMSParamvLBDemoPolicy.1.xml"
}' 'http://pypdp:8480/PyPDPServer/deletePolicy'

sleep 2
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
  "pdpGroup": "default",
  "policyName": "BRMSParamvLBDemoPolicy",
  "policyScope": "com",
  "policyType": "BRMS_Param"
}' 'http://pypdp:8480/PyPDPServer/pushPolicy'

sleep 2

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHJlc3Q6M2MwbXBVI2gwMUBOMWMz' --header 'Environment: TEST' -d '{
  "pdpGroup": "default",
  "policyName": "BRMSParamvFWDemoPolicy",
  "policyScope": "com",
  "policyType": "BRMS_Param"
}' 'http://pypdp:8480/PyPDPServer/pushPolicy'