summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaravanan A <saravanan.a75@wipro.com>2018-09-18 14:53:45 +0530
committerSaravanan A <saravanan.a75@wipro.com>2018-09-18 14:55:22 +0530
commitbcf5b150cd2b8ebf0b69a9c8f78bb83391276302 (patch)
treeb467c0860b262aa1a8655ee7f1b23736c193ab9b
parent4959db7b8a8bbfbe72289c65ced32493d75f2052 (diff)
Add Config and CL policies for OOF PCI use case
Following config policies to be defined for OOF PCI use case for Casablanca: PCI-Handler MS config policy OOF config policy Control loop policy Change-Id: I2cd0c2221ee0b950463ab939b6426def14c8b69a Issue-ID: POLICY-1086 Signed-off-by: Saravanan A<saravanan.a75@wipro.com>
-rwxr-xr-xconfig/pe/push-policies.sh68
1 files changed, 68 insertions, 0 deletions
diff --git a/config/pe/push-policies.sh b/config/pe/push-policies.sh
index c7f3a3f4..4804deb7 100755
--- a/config/pe/push-policies.sh
+++ b/config/pe/push-policies.sh
@@ -185,6 +185,45 @@ curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'A
"description": "ONAP_VPG_NAMING_TIMESTAMP"
}' 'https://pdp:8081/pdp/api/createPolicy'
+#########################################Creating OOF PCI Policies##########################################
+sleep 2
+
+echo "Create MicroServicevPCI Policy"
+curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
+ "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\" } ] }] } } }",
+ "policyConfigType": "MicroService",
+ "policyName": "com.MicroServicevPCI",
+ "onapName": "DCAE"
+}' 'https://pdp:8081/pdp/api/createPolicy'
+
+sleep 2
+
+echo "Create PCI MS Config Policy"
+curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
+ "policyName": "com.PCIMS_CONFIG_POLICY",
+ "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\" }",
+ "policyType": "Config",
+ "attributes" : { "matching" : { "key1" : "value1" } },
+ "policyConfigType": "Base",
+ "onapName": "DCAE",
+ "configName": "PCIMS_CONFIG_POLICY",
+ "configBodyType": "JSON"
+}' 'https://pdp:8081/pdp/api/createPolicy'
+
+sleep 2
+
+echo "Create OOF Config Policy"
+curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
+ "policyName": "com.OOF_PCI_CONFIG_POLICY",
+ "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\" }",
+ "attributes" : { "matching" : { "key1" : "value1" } },
+ "policyType": "Config",
+ "policyConfigType": "Base",
+ "onapName": "DCAE",
+ "configName": "OOF_PCI_CONFIG_POLICY",
+ "configBodyType": "JSON"
+}' 'https://pdp:8081/pdp/api/createPolicy'
+
#########################################Creating Decision Guard policy#########################################
sleep 2
@@ -313,3 +352,32 @@ curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'A
"policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP",
"policyType": "MicroService"
}' 'https://pdp:8081/pdp/api/pushPolicy'
+
+
+#########################################Pushing OOF PCI Policies##########################################
+sleep 10
+
+echo "pushPolicy : PUT : com.MicroServicevPCI"
+curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
+ "pdpGroup": "default",
+ "policyName": "com.MicroServicevPCI",
+ "policyType": "MicroService"
+}' 'https://pdp:8081/pdp/api/pushPolicy'
+
+sleep 10
+
+echo "pushPolicy : PUT : com.PCIMS_CONFIG_POLICY"
+curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
+ "pdpGroup": "default",
+ "policyName": "com.PCIMS_CONFIG_POLICY",
+ "policyType": "Base"
+}' 'https://pdp:8081/pdp/api/pushPolicy'
+
+sleep 10
+
+echo "pushPolicy : PUT : com.OOF_PCI_CONFIG_POLICY"
+curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
+ "pdpGroup": "default",
+ "policyName": "com.OOF_PCI_CONFIG_POLICY",
+ "policyType": "Base"
+}' 'https://pdp:8081/pdp/api/pushPolicy'