Versions Compared

Key

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

The current API for creating and subsequently retrieving decisions surrounding DCAE mS configuration policies has many problems and limitations. We are capturing these limitations here so that they can be addressed in Dublin for the new Policy Lifecycle API.

Casablanca TCA DCAE mS Policy Model Schema

Code Block
languageyml
titleCasablanca DCAE mS Policy Model (filename=tca_policy_model_casablanca.yml)
tosca_definitions_version: tosca_simple_yaml_1_0_0
data_types:
  policy.data.metricsPerEventName:
    properties:
      controlLoopSchemaType:
        type: string
        description: Specifies Control Loop Schema Type for the event Name e.g. VNF, VM
        constraints:
        - valid_values:
          - VM
          - VNF
      eventName:
        type: string
        description: Event name to which thresholds need to be applied
      policyName:
        type: string
        description: TCA Policy Scope Name
      policyScope:
        type: string
        description: TCA Policy Scope
      policyVersion:
        type: string
        description: TCA Policy Scope Version
      thresholds:
        type: list
        description: Thresholds associated with eventName
        entry_schema:
          type: policy.data.thresholds
  policy.data.tca_policy:
    properties:
      domain:
        type: string
        description: Domain name to which TCA needs to be applied
        constraints:
        - equal: measurementsForVfScaling
      metricsPerEventName:
        type: list
        description: Contains eventName and threshold details that need to be applied to given eventName
        entry_schema:
          type: policy.data.metricsPerEventName
  policy.data.thresholds:
    properties:
      closedLoopControlName:
        type: string
        description: Closed Loop Control Name associated with the threshold
      closedLoopEventStatus:
        type: string
        description: Closed Loop Event Status of the threshold
        constraints:
        - valid_values:
          - ONSET
          - ABATED
      direction:
        type: string
        description: Direction of the threshold
        constraints:
        - valid_values:
          - LESS
          - LESS_OR_EQUAL
          - GREATER
          - GREATER_OR_EQUAL
          - EQUAL
      fieldPath:
        type: string
        description: Json field Path as per CEF message which needs to be analyzed for TCA
      severity:
        type: string
        description: Threshold Event Severity
        constraints:
        - valid_values:
          - CRITICAL
          - MAJOR
          - MINOR
          - WARNING
          - NORMAL
      thresholdValue:
        type: integer
        description: Threshold value for the field Path inside CEF message
      version:
        type: string
        description: Version number associated with the threshold
node_types:
  policy.nodes.Root:
    derived_from: tosca.nodes.Root
    properties:
      policyDescription:
        required: false
        type: string
      policyName:
        required: true
        type: string
      policyScope:
        required: true
        type: string
      policyVersion:
        required: true
        type: string
  policy.nodes.tca:
    derived_from: policy.nodes.Root
    properties:
      tca_policy:
        type: map
        description: TCA Policy JSON
        entry_schema:
          type: policy.data.tca_policy


Based on the model schema, one would expect to be able to generate a TCA mS policy in YAML:

Code Block
titleExample Policy Data You Would Expect To GenerateBe Able to Create
linenumberstrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
imports:
    -
      tca_policy_model_casablanca.yml
policies:
    -
      onap.vfirewall.tca_policy:
        type: policy_nodes.tca
        properties:
            domain: measurementsForVfScaling
            metricsPerEventName: 
                - 
                    eventName: Mfvs_eNodeB_RANKPI
                    controlLoopSchemaType: VNF
                    policyScope: "resource=vFirewall;type=configuration"
                    policyName: "configuration.dcae.microservice.tca.xml"
                    policyVersion: "v0.0.1"
                    thresholds: 
                        - 
                            closedLoopControlName: "CL-FRWL-LOW-TRAFFIC-SIG-d925ed73-8231-4d02-9545-db4e101f88f8"
                            closedLoopEventStatus: ONSET
                            version: "1.0.2"
                            fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
                            thresholdValue: 4000
                            direction: LESS_OR_EQUAL
                            severity: MAJOR
                        - 
                            closedLoopControlName: "CL-FRWL-HIGH-TRAFFIC-SIG-EA36FE84-9342-5E13-A656-EC5F21309A09"
                            closedLoopEventStatus: ONSET
                            version: "1.0.2"
                            fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
                            thresholdValue: 20000
                            direction: GREATER_OR_EQUAL
                            severity: CRITICAL
                        - 
                            closedLoopControlName: "CL-FRWL-HIGH-TRAFFIC-SIG-EA36FE84-9342-5E13-A656-EC5F21309A09"
                            closedLoopEventStatus: ABATED
                            version: "1.0.2"
                            fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
                            thresholdValue: 0
                            direction: EQUAL
                            severity: CRITICAL

Input expected by the API excludes the domain property value and metricsPerEventName property

Code Block
languagebash
titleExample API Call
#
# Example CURL contents taken from Policy CSIT Tests
#
{

"configBody": "{\"service\": \"policy_tosca_tca\",\"location\": \"Ravi\",\"uuid\": \"/services/cdap-tca-hi-lo/instances/dfw1/configuration/metricsPerFunctionalRole/vFireWall\",\"policyName\": \"vFireWall\",\"description\": \"vFireWall\",\"configName\": \"TestConfigName\",\"templateVersion\": \"1607\",\"version\": \"8.7.6.5\",\"priority\": \"1\",\"policyScope\": \"resource=TestResource,service=TestService,type=TestType,closedLoopControlName=TestClosedLoop\",\"riskType\": \"test\",\"riskLevel\": \"2\",\"guard\": \"False\",\"content\": {\"policyVersion\": \"v0.0.1\",\"threshholds\": [{\"severity\": \"MAJOR\",\"fieldPath\": \"$$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\",\"thresholdValue\": \"4000\",\"closedLoopControlName\": \{
	"domain": "measurementsForVfScaling",
	"metricsPerEventName": [
		{
			"eventName": "Mfvs_eNodeB_RANKPI",
			"controlLoopSchemaType": "VNF",
			"policyScope": "resource=vFirewall;type=configuration",
			"policyName": "configuration.dcae.microservice.tca.xml",
			"policyVersion": "v0.0.1",
			"thresholds": [
				{
					"closedLoopControlName": "CL-FRWL-LOW-TRAFFIC-SIG-d925ed73-8231-4d02-9545-db4e101f88f8",
					"closedLoopEventStatusdb4e101f88f8\",\"version\": \"1.0.2\",\"direction\": "ONSET",
					"version\"LESS_OR_EQUAL\"}, {\"severity\": "1.0.2",
					"fieldPath\"CRITICAL\",\"fieldPath\": \"$$$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\",
					\"thresholdValue\": 4000,
					"direction": "LESS_OR_EQUAL",
					"severity": "MAJOR"
				},
				{
					"closedLoopControlName": \"20000\",\"closedLoopControlName\": \"CL-FRWL-HIGH-TRAFFIC-SIG-EA36FE84-9342-5E13-A656-EC5F21309A09",
					"closedLoopEventStatus": "ONSET",
					"version": "1.0.2",
					"fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
					"thresholdValue": 20000,
					"direction": "GREATER_OR_EQUAL",
					"severity": "CRITICAL"
				},
				{
					"closedLoopControlName": "CL-FRWL-HIGH-TRAFFIC-SIG-EA36FE84-9342-5E13-A656-EC5F21309A09",
					"closedLoopEventStatus": "ABATED",
					"version": "1.0.2",
					"fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
					"thresholdValue": 0,
					"direction": "EQUAL",
					"severity": "CRITICAL"
				}
			]
		},
		{
			"eventName": "vLoadBalancer",
			"controlLoopSchemaType": "VNF",
			\",\"version\": \"1.0.2\",\"direction\": \"GREATER_OR_EQUAL\"}],\"policyName\": \"configuration.ae.microservice.tca.xml\",\"functionalRole\": \"ClosedLoop_F5-d925ed73-8231-4d02-9545-db4e101f88f8\"}}",

"policyConfigType": "MicroService",

"policyName": "${policy_name}",

"ecompName": "DCAE"

}


Code Block
titleThe configBody UNStringified and Pretty Printed
linenumberstrue
{
	"service": "policy_tosca_tca",
	"location": "Ravi",
	"uuid": "/services/cdap-tca-hi-lo/instances/dfw1/configuration/metricsPerFunctionalRole/vFireWall",
	"policyName": "vFireWall",
	"description": "vFireWall",
	"configName": "TestConfigName",
	"templateVersion": "1607",
	"version": "8.7.6.5",
	"priority": "1",
	"policyScope": "resource=vLoadBalancer;TestResource,service=TestService,type=configuration",
			"policyName": "configuration.dcae.microservice.tca.xmlTestType,closedLoopControlName=TestClosedLoop",
			"policyVersionriskType": "v0.0.1test",
			"thresholdsriskLevel": [
				{
					"closedLoopControlName"2",
	"guard": "CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1AFalse",
			"content": {
		"closedLoopEventStatuspolicyVersion": "ONSETv0.0.1",
		"threshholds": [{
			"versionseverity": "1.0.2MAJOR",
					"fieldPath": "$$$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
			"thresholdValue": "4000",
			"thresholdValueclosedLoopControlName": 500"CL-FRWL-LOW-TRAFFIC-SIG-d925ed73-8231-4d02-9545-db4e101f88f8",
					"directionversion": "LESS_OR_EQUAL1.0.2",
					"severitydirection": "MAJORLESS_OR_EQUAL"
				},
				 {
					"closedLoopControlNameseverity": "CL-LBAL-LOW-TRAFFIC-SIG-0C5920A6-B564-8035-C878-0E814352BC2BCRITICAL",
					"closedLoopEventStatusfieldPath": "ONSET$$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
					"versionthresholdValue": "1.0.220000",
					"fieldPathclosedLoopControlName": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulatedCL-FRWL-HIGH-TRAFFIC-SIG-EA36FE84-9342-5E13-A656-EC5F21309A09",
					"thresholdValueversion": 5000"1.0.2",
					"direction": "GREATER_OR_EQUAL"
		}],
		"policyName": "configuration.ae.microservice.tca.xml",
			"severityfunctionalRole": "CRITICALClosedLoop_F5-d925ed73-8231-4d02-9545-db4e101f88f8"
				}
			]
		}
	]
}







}

Basically, the model is broken as values are spread throughout the payload for the API call. CLAMP has to hardcode this "breakage" to fit it into the API.