Versions Compared

Key

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

...

Code Block
width50%
languagebash
titleCurl 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
width50%
languageyml
titleAffinity 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.

  1. 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.
  2. Policy filtering through 'PolicyScope'( the 'secondary_scope' in our code) used to support OR filtering, but now it just support AND filtering.
  3. There's no filter for 'policyType' in the previous API. But now, it is a mandatory filter that we need to enter.
  4. There's difference in the format of policies, hence we need to change the process of parsing these policies.