...
Code Block |
---|
width | 50% |
---|
language | bash |
---|
title | Curl command use for new API |
---|
|
curl -x POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--user 'healthcheck:zb!XztG34' \
-d '{
"ONAPName": "OOF",
"ONAPComponent": "OOF-component",
"ONAPInstance": "OOF-component-instance",
"action": "optimize",
"resource": {
"policyScope": ["vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
"policyType": "zone" }}' https://xacml-pdp:6969/policy/pdpx/v1/decision
} |
Difference in functionality
...
Code Block |
---|
width | 50% |
---|
language | yml |
---|
title | Affinity Policy with new format |
---|
|
{
"tosca_definitions_version": "tosca_simple_yaml_1_0_0",
"topology_template": {
"policies": [
{
"OSDF_CASABLANCA.Affinity_vCPE_1": {
"type": "onap.policies.optimization.AffinityPolicy",
"version": "1.0.0",
"metadata": {
"policy-id": "OSDF_CASABLANCA.Affinity_vCPE_1",
"policy-version": 1
},
"properties": {
"identity": "affinity_vCPE",
"policyScope": [ "vCPE", "US", "INTERNATIONAL", "ip", "vGMuxInfra", "vG"],
"affinityProperties": {
"qualifier": "same",
"category": "complex"
},
"policyType": "zone",
"resources": [ "vGMuxInfra", "vG"] }
}
}
]
}
}
|
Several changes needed for OSDF
Also, according to the payload we showed in last sector, we could find that there's a few changes in the ways of filtering.
- In the past, OSDF first uses the 'policy_scope' to filter the policies, which is the prefix of the policy name, for example 'OSDF_DUBLIN'. Now, no such filter is provided.
- Policy filtering through 'PolicyScope'( the 'secondary_scope' in our code) used to support OR filtering, but now it just support AND filtering.
- There's no filter for 'policyType' in the previous API. But now, it is a mandatory filter that we need to enter.
- There's difference in the format of policies, hence we need to change the process of parsing these policies.