Versions Compared

Key

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

This page is intended to establish how the Policy Design and API Flow to/from the PAP and PDP's will work to support Model Driven Control Loops in Dublin.

Table of Contents

1 Policy Design

The following Policy Models will be developed to support ONAP Model Driven Control Loops in Dublin: onap.policies.Monitoring, onap.policies.controlloop.Operational, onap.policies.controlloop.Guard and onap.policies.controlloop.Coordination. The models will be defined as TOSCA models. The schemas for the TOSCA models will ultimately be defined by the modeling team but for now are defined by the Policy Framework project.

...

Code Block
languageyml
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
imports:
    -
      tca_policy_model.yml
policies:
    -
      onap.scaleout.tca_policy:
        type: policy_nodes.tcaonap.policy.monitoring.cdap.tca.hi.lo.app
        properties:
            domain: measurementsForVfScaling
            metricsPerEventName: 
            - 
                eventName: vLoadBalancer
                controlLoopSchemaType: VNF
                policyScope: "type=configuration"
                policyName: "configurationonap.dcaescaleout.microservice.tca.xml"
                policyVersion: "v0.0.1" # THIS MAKES NO SENSE
                thresholds: 
                - 
                    closedLoopControlName: "CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A"
                    closedLoopEventStatus: ONSET
                    version: "1.0.2"
                    fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
                    thresholdValue: 500
                    direction: LESS_OR_EQUAL
                    severity: MAJOR
                - 
                    closedLoopControlName: "CL-LBAL-LOW-TRAFFIC-SIG-0C5920A6-B564-8035-C878-0E814352BC2B"
                    closedLoopEventStatus: ONSET
                    version: "1.0.2"
                    fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
                    thresholdValue: 5000
                    direction: GREATER_OR_EQUAL
                    severity: CRITICAL


Code Block
languagebash
titleExample PUT to create TCA policy for scale out
linenumberstrue
collapsetrue
#
# Supports both YAML and JSON payloads. Using the policy defined in the previous code block
#


http:{url}:{port}/api/v1/models?model=onap.policy.monitoring.cdap.tca.hi.lo.app PUT

Content-Type: application/yaml
Accepts: application/json (??)

#
# Return payload:Output
#


PolicyId: UniqueId_1
PolicyVersion: 1




Should be able to GET


http:{url}:{port}/api/v1/domains/HTTP/1.1 200 OK
Content-Type: application/json
{
	"policy_id": "onap.scaleout.tca",
	"policy_version": 1,
	"policy_metadata": {
		"model": "onap.policy.monitoring.cdap.tca.hi.lo.app/dublin.tca?PolicyId=UniqueId_1&PolicyVersion=1







6 Policy Lifecycle API - Creating Operational Policies

7 Policy Lifecycle API - Creating Guard Policies

8 Policy Lifecycle API - Creating Coordination Policies

9 PAP API - Deploying Policies

10 Policy Decision API - Getting Policy Decisions

Policy decisions are required by ONAP components to support the policy-driven ONAP architecture. Currently implemented using the XACML PDP.

"
		# HOW CAN WE GET THE closedLoopControlName as metadata?
	}
}






GET are used by CLAMP/Integration to query an existing policy.

NOTE: This call is NOT used by DCAE for a decision on what policy the DCAE PolicyHandler should retrieve and enforce (next section)


Code Block
languageyml
titleRetrieving Policies that have been Created (NOT a policy decision)
linenumberstrue

http:{url}:{port}/api/v1/domains/
Code Block
http:{url}:{port}/decision/v1/ POST


domain=onap.policy.monitoring.cdap.tca.hi.lo.app/policies/ GET

Content-Type: application/yaml

#
# Return Output
#
Pam Notes
HTTP/1.1 PolicyId200 OK
Content-> appending .* inside PolicyName to get any version, getConfig
2. PolicyFilter -> copy/paste of the getConfig API. Generates JSON. Had to replicate the matching of the filters
3. 

every property is stringified - must "know" which need to be parsed.






https://gerrit.onap.org/r/gitweb?p=dcaegen2/platform/policy-handler.git;a=blob;f=policyhandler/policy_rest.py;h=85dd914d5969529d28c2d365e392abe4ac174cf0;hb=HEAD

from ALEXANDER V SHATOV to Everyone:

https://gerrit.onap.org/r/gitweb?p=dcaegen2/platform/policy-handler.git;a=blob;f=policyhandler/policy_receiver.py;h=249c1f742ec19eaba46051344506d312c345ae73;hb=HEAD






Type: application/yaml

policies:
    -
        policy_id: onap.scaleout.tca
        policy_metadata:
            model: onap.policy.monitoring.cdap.tca.hi.lo.app
        status:
            latest:
                version: 1
                status: Undeployed



6 Policy Lifecycle API - Creating Operational Policies



7 Policy Lifecycle API - Creating Guard Policies



8 Policy Lifecycle API - Creating Coordination Policies



9 PAP API - Deploying Policies

For CLAMP to deploy policies, we need to make sure there is a simple default way for this to support Dublin.

Code Block
http:{url}:{port}/pap/v1/pdps PUT


Content-Type: application/yaml

#
# Return Output
#

HTTP/1.1 200 OK
Content-Type: application/yaml

policies:
    - policy_id: onap.scaleout.tca


# TODO add the other operational and guard policies





10 Policy Decision API - Getting Policy Decisions

Policy decisions are required by ONAP components to support the policy-driven ONAP architecture. Currently implemented using the XACML PDP.


Code Block
languagejs
titleDecision API for getting single TCA policy
linenumberstrue
collapsetrue
http:{url}:{port}/decision/v1/ POST

Content-Type: application/yaml
Accepts: application/json
subject: DCAE
action: configure
resource:
    policy_id: onap.scaleout.tca

#
# Return Output
#

HTTP/1.1 200 OK
Content-Type: application/json
{
	"domain": "measurementsForVfScaling",
	"metricsPerEventName": [
		{
			"eventName": "vLoadBalancer",
			"controlLoopSchemaType": "VNF",
			"policyScope": "type=configuration",
			"policyName": "onap.scaleout.tca",
			"policyVersion": "v0.0.1",
			"thresholds": [
				{
					"closedLoopControlName": "CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A",
					"closedLoopEventStatus": "ONSET",
					"version": "1.0.2",
					"fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
					"thresholdValue": 500,
					"direction": "LESS_OR_EQUAL",
					"severity": "MAJOR"
				},
				{
					"closedLoopControlName": "CL-LBAL-LOW-TRAFFIC-SIG-0C5920A6-B564-8035-C878-0E814352BC2B",
					"closedLoopEventStatus": "ONSET",
					"version": "1.0.2",
					"fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
					"thresholdValue": 5000,
					"direction": "GREATER_OR_EQUAL",
					"severity": "CRITICAL"
				}
			]
		}
	]
}