...
Steps for creating and pushing the policy model:
1.Login to PDP container
View file |
---|
name | policy_type.json |
---|
height | 250 |
---|
|
View file |
---|
name | son_policy.json |
---|
height | 250 |
---|
|
Code Block |
---|
language | bash |
---|
firstline | 1 |
---|
title | Login to PDP container |
---|
|
kubectl exec -ti --namespace onap policy-pdp-0 bash |
...
Code Block |
---|
language | bash |
---|
firstline | 1 |
---|
title | Policy Creation |
---|
|
curl -k -v --silentuser 'healthcheck:zb!XztG34' -X PUTPOST --headerH 'Content-Type: application/json' --headerH 'Accept: textapplication/plainjson' --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'
|
3.Push policy model
Code Block |
---|
language | bash |
---|
firstline | 1 |
---|
title | Push 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",
"policyType": "Base"
}' 'https://pdp:8081/pdp/api/pushPolicy' |
...
d @policy_type.json https://policy-api:6969/policy/api/v1/policytypes
curl -v -k --silent --user 'healthcheck:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.monitoring.docker.sonhandler.app/versions/1.0.0/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @son_policy.json
|
3.Push policy model
Code Block |
---|
language | bash |
---|
firstline | 1 |
---|
title | Fetch policyPush Policy |
---|
|
curl -k -v --silent -Xk POST --headeruser 'Content-Type: application/jsonhealthcheck:zb!XztG34' --header 'Accept: application/json' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ "configName": "PCIMS_CONFIG_POLICY", "policyName": "com.Config_PCIMS_CONFIG_POLICY1*", "requestID":"e65cc45a-9efb-11e8-98d0-529269ffa459" }' 'https://pdp:8081/pdp/api/getConfig'X POST "https://policy-pap:6969/policy/pap/v1/pdps/policies" -H "Accept: application/json" -H "Content-Type: application/json" -d @push.json |
4.Verify config policy is present
Code Block |
---|
language | bash |
---|
firstline | 1 |
---|
title | Fetch policy |
---|
|
curl -v -k --silent --user 'healthcheck:zb!XztG34' -X GET "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.monitoring.docker.sonhandler.app/versions/1.0.0/policies" -H "Accept: application/json"
|
ConfigDB set-up:
The steps to set up configDB can be found in the attachment below.
...