NEW POLICY TYPES

Threshold Policy Type
{
  "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
  "policy_types": {
    "onap.policies.optimization.resource.ThresholdPolicy": {
      "derived_from": "onap.policies.optimization.Resource",
      "version": "1.0.0",
      "properties": {
        "applicableResources": {
          "type": "list",
          "required": true,
          "entry_schema": {
            "type": "string",
            "constraints": [
              {
                "valid_values": [
                  "any",
                  "all"
                ]
              }
            ]
          }
        },
        "thresholdProperties": {
          "type": "list",
          "required": true,
          "entry_schema": {
            "type": "policy.data.thresholdProperties_properties"
          }
        }
      }
    }
  },
  "data_types": {
    "policy.data.thresholdProperties_properties": {
      "derived_from": "tosca.nodes.Root",
      "properties": {
        "attribute": {
          "type": "string",
          "required": true
        },
        "operator": {
          "type": "string",
          "required": true
        },
        "threshold": {
          "type": "float",
          "required": true
        },
        "unit": {
          "type": "string",
          "required": false
        }
      }
    }
  }
}
Aggregation Policy Type
{
  "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
  "policy_types": {
    "onap.policies.optimization.resource.AggregationPolicy": {
      "derived_from": "onap.policies.optimization.Resource",
      "version": "1.0.0",
      "properties": {
        "applicableResources": {
          "type": "list",
          "required": true,
          "entry_schema": {
            "type": "string",
            "constraints": [
              {
                "valid_values": [
                  "any",
                  "all"
                ]
              }
            ]
          }
        },
        "aggregationProperties": {
          "type": "list",
          "required": true,
          "entry_schema": {
            "type": "policy.data.aggregationProperties_properties"
          }
        }
      }
    }
  },
  "data_types": {
    "policy.data.aggregationProperties_properties": {
      "derived_from": "tosca.nodes.Root",
      "properties": {
        "attribute": {
          "type": "string",
          "required": true
        },
        "operator": {
          "type": "string",
          "required": true
        },
        "threshold": {
          "type": "policy.data.thresh_properties",
          "required": true
        },
        "unit": {
          "type": "string",
          "required": false
        },
        "function": {
          "type": "string",
          "required": true
        }
      }
    },
    "policy.data.thresh_properties":{
    	"derived_from": "tosca.nodes.Root"
    }
  }
}

SAMPLE POLICIES

Sample Threshold Policy
{
   "OSDF_FRANKFURT.Threshold_URLLC_Core_1":{
      "type":"onap.policies.optimization.resource.ThresholdPolicy",
      "version":"1.0.0",
      "type_version":"1.0.0",
      "metadata":{
         "policy-id":"OSDF_FRANKFURT.Threshold_URLLC_Core_1",
         "policy-version":1
      },
      "properties":{
         "scope":[
            "OSDF_FRANKFURT",
            "EmbbNst",
            "EmbbCn"
         ],
         "resources":[
            "EmbbCn"
         ],
         "services":[
            "EmbbNst"
         ],
         "geography":[

         ],
         "identity":"Threshold_URLLC_Core_1",
         "thresholdProperties":[
            {
               "attribute":"latency",
               "operator":"lte",
               "threshold":50,
               "unit":"ms"
            }
         ]
      }
   }
}
Sample Subscriber Policy
{
   "OSDF_FRANKFURT.SubscriberPolicy_URLLC_1":{
      "type":"onap.policies.optimization.service.SubscriberPolicy",
      "version":"1.0.0",
      "type_version":"1.0.0",
      "metadata":{
         "policy-id":"OSDF_FRANKFURT.SubscriberPolicy_URLLC_1",
         "policy-version":1
      },
      "properties":{
         "scope":[
            "OSDF_FRANKFURT",
            "EmbbNst"
         ],
         "services":[
            "EmbbNst"
         ],
         "identity":"subscriber_URLLC_1",
         "properties":{
            "subscriberName":[
               "EmbbCn"
            ]
         }
      }
   }
}
Sample Vnf Policy
{
   "OSDF_FRANKFURT.vnfPolicy_URLLC_Core_1":{
      "type":"onap.policies.optimization.resource.VnfPolicy",
      "version":"1.0.0",
      "type_version":"1.0.0",
      "metadata":{
         "policy-id":"OSDF_FRANKFURT.vnfPolicy_URLLC_Core_1",
         "policy-version":1
      },
      "properties":{
         "scope":[
            "OSDF_FRANKFURT",
            "EmbbNst",
            "EmbbCn"
         ],
         "resources":[
            "EmbbCn"
         ],
         "services":[
            "EmbbNst"
         ],
         "identity":"vnf_URLLC_Core_1",
         "applicableResources":"any",
         "vnfProperties":[
            {
               "inventoryProvider":"aai",
               "inventoryType":"nssi",
               "region":"RegionOne",
               "attributes":{
                  "orchestrationStatus":"active",
                  "service-role":"nssi",
                  "modelInvariantId":"c0eeaa3b-625c-4518-bd1f-f01cc784813c",
                  "modelVersionId":"836eb219-346d-4b8b-8376-b0c4d17954a9"
               }
            }
         ]
      }
   }
}
Sample Query Policy
{
  "OSDF_FRANKFURT.queryPolicy_URLLC_1": {
    "type": "onap.policies.optimization.service.QueryPolicy",
    "version": "1.0.0",
    "type_version": "1.0.0",
    "metadata": {
      "policy-id": "OSDF_FRANKFURT.queryPolicy_URLLC_1",
      "policy-version": 1
    },
    "properties": {
      "scope": [
        "OSDF_FRANKFURT"
      ],
      "services": [
        "URLLC_1"
      ],
      "geography": [
        "US"
      ],
      "identity": "queryPolicy_URLLC_1",
      "queryProperties": [
        {
          "attribute": "latency",
          "attribute_location": "latency"
        }
      ]
    }
  }
}

Sample Aggregation Policy
{
   "OSDF_FRANKFURT.Aggregation_URLLC_1":{
      "type":"onap.policies.optimization.resource.AggregationPolicy",
      "version":"1.0.0",
      "type_version":"1.0.0",
      "metadata":{
         "policy-id":"OSDF_FRANKFURT.Aggregation_URLLC_1",
         "policy-version":1
      },
      "properties":{
         "scope":[
            "OSDF_FRANKFURT",
            "URLLC_1"
         ],
         "geography": [],
         "resources":[
            "URLLC_Core_1"
         ],
         "services":[
            "URLLC_1"
         ],
         "identity":"Aggregation_URLLC_1",
         "applicableResources":"any",
         "aggregationProperties":[
            {
               "attribute":"latency",
               "function":"sum",
               "operator":"lte",
               "threshold":{
                "get_param": "latency"
               },
               "unit":"ms"
            }
         ]
      }
   }
}

  • No labels

3 Comments

  1. The policy types are out-of-date. A couple of easy fixes:

    1) Do not pass onap.policies.Optimization policy type in creating the Policy Type - we have that already pre-loaded. The Preloaded onap.policies.Optimization already has some of the common properties defined, so you do not have to define them in your policy type.

    https://gerrit.onap.org/r/gitweb?p=policy/models.git;a=blob;f=models-examples/src/main/resources/policytypes/onap.policies.Optimization.yaml;h=9d91685e3936caca500b5803845c70744b2d7013;hb=refs/heads/master

    2) You should inherit from a onap.policies.optimization.Service or onap.policies.optimization.Resource Policy Type, which then further defines the common properties, chose which one is appropriate:

    Service:

    https://gerrit.onap.org/r/gitweb?p=policy/models.git;a=blob;f=models-examples/src/main/resources/policytypes/onap.policies.optimization.Service.yaml;h=67f7dd6e25a016de15a1685cd12ea3c170af4655;hb=refs/heads/master

    Resource:

    https://gerrit.onap.org/r/gitweb?p=policy/models.git;a=blob;f=models-examples/src/main/resources/policytypes/onap.policies.optimization.Resource.yaml;h=3aaa6075c0fe431005b079e0160a257e12b4c56a;hb=refs/heads/master

    See these examples of policy types that you should model after:

    https://gerrit.onap.org/r/gitweb?p=policy/models.git;a=blob;f=models-examples/src/main/resources/policytypes/onap.policies.optimization.resource.AffinityPolicy.yaml;h=3fb8525f70acb43ca050d6a2dd10f74f875c4512;hb=refs/heads/master

    There are example policies located here:

    https://gerrit.onap.org/r/gitweb?p=policy/models.git;a=blob;f=models-examples/src/main/resources/policies/vCPE.policies.optimization.input.tosca.json;h=406d12e1316d66f7170129b2250edce56c01114e;hb=refs/heads/master

  2. dhebeha mj  - fyi we needed to make sure all policy types and policies use "tosca_simple_yaml_1_1_0" since we need to abide by that spec version.

  3. Thanks for pointing out Pam Pamela Dragosh