...
The Policy subsystem of ONAP maintains, distributes, and operates on the set of rules that underlie ONAP’s control, orchestration, and management functions. Policy provides a centralized environment for the creation and management of easily-updatable conditional rules. It enables users to validate policies and rules, identify and resolve overlaps and conflicts, and derive additional policies where needed. The following operations are support supported by the policy API:
- Create policies on the PAP
- Update policies on the PAP
- Delete policies on the PAP or PDP
- Push policies from the PAP to the PDP
- List policies on the PDP
- Get config data of policies on the PDP
- Create Dictionary Items
- Update Dictionary Items
- Retrieve Dictionary Items
- Import Micro Services Models
- Retrieve Metrics for policy counts from PDP and PAP
POLICY ENGINE SERVICES
SAMPLE JAVA CLIENT CODE
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
echo "deletePolicy : DELETE : com.vFirewall"
curl -v --silent -X DELETE --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: XYZ' --header 'Authorization: Basic XYZ' --header 'Environment: TEST' -d '{
"pdpGroup": "default",
"policyComponent": "PDP",
"policyName": "com.vFirewall",
"policyType": "MicroService"
}' 'http://pdp:8081/pdp/api/deletePolicy' |
Code Block | ||||
---|---|---|---|---|
| ||||
echo "Get all Config Policy example" curl -i -v -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'ClientAuth: XYZ' -H 'Authorization: Basic XYZ -H 'Environment: TEST' -X POST -d '{ "policyName": ".*" }' http://${PDP_IP}:8081/pdp/api/getConfig |
ADDITIONAL EXAMPLES
Code Block | ||||
---|---|---|---|---|
| ||||
// Deleting from PAP will remove the policy from the PolicyEntity & PolicyVersion tables (UI-Editor tab).
// This means that the policy is no longer be available in Policy System.
// PayLoad:
{ "policyName": "com.testpolicy", //scope.policyName
"policyType": "Base", //policy type
"policyComponent": "PAP", //component name
"deleteCondition": "ALL" //versions (ALL or CURRENT)
} |
Code Block | ||||
---|---|---|---|---|
| ||||
// Deleting from PDP will delete the policy from the PDP Group. The policy is still available in Policy System.
// When the policy is needed again, the policy should be pushed to the PDP.
// PayLoad:
{ "policyName": "com.testpolicy", //scope.policyName
"policyType": "Base", //policy type
"policyComponent": "PDP", //component name
"pdpGroup": "Default" //group name
} |
POLICY ENGINE API DETAILS
...