Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Steps for creating and pushing the policy model:

1.Login to PDP container

View file
namepolicy_type.json
height250
View file
namepush.json
height250
View file
nameson_policy.json
height250

Code Block
languagebash
firstline1
titleLogin to PDP container
kubectl exec -ti --namespace onap policy-pdp-0 bash

...

Code Block
languagebash
firstline1
titlePolicy 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
languagebash
firstline1
titlePush 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
languagebash
firstline1
titleFetch 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
languagebash
firstline1
titleFetch 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.

...