Versions Compared

Key

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

...


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

Code Block
languageyml
titleExample Policy You Would Expect To Be 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_RANKPIvFirewallBroadcastPackets
                    controlLoopSchemaType: VNF
                    policyScope: "resource=vFirewall;type=configurationDCAE"
                    policyName: "configuration.dcae.microservice.tca.xmlDCAE.Config_tca-hi-lo"
                    policyVersion: "v0.0.1"
                    thresholds: 
                        - 
                            closedLoopControlName: "CLControlLoop-FRWLvFirewall-LOWd0a1dfc6-TRAFFIC94f5-SIG4fd4-d925ed73-8231-4d02-9545-db4e101f88f8a5b5-4630b438850a"
                            closedLoopEventStatus: ONSET
                            version: "1.0.2"
                            fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArrayvNicUsageArray[*].receivedBroadcastPacketsAccumulatedreceivedTotalPacketsDelta"
                            thresholdValue: 4000300
                            direction: LESS_OR_EQUAL
                            severity: MAJOR
                        - 
                            closedLoopControlName: "CLControlLoop-FRWLvFirewall-HIGHd0a1dfc6-TRAFFIC94f5-SIG4fd4-EA36FE84-9342-5E13-A656-EC5F21309A09a5b5-4630b438850a"
                            closedLoopEventStatus: ONSET
                            version: "1.0.2"
                            fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArrayvNicUsageArray[*].receivedBroadcastPacketsAccumulatedreceivedTotalPacketsDelta"
                            thresholdValue: 20000700
                            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

Actual Input expected by the API does not match the above YAML, but instead is JSON. The JSON excludes the domain property value and metricsPerEventName property layers.


Actual Input expected by the API does not match the above YAML, but instead is JSON.

Code Block
languagebash
titleExample API Call using CURL (CLAMP uses Java API)
linenumberstrue
curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{

    "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevFirewall\", \"description\": \"MicroService vFirewall Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"vFirewallBroadcastPackets\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 300, \"direction\": \"LESS_OR_EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ONSET\" }, { \"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \"thresholdValue\": 700, \"direction\": \"GREATER_OR_EQUAL\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" } ] }] } } }",

    "policyConfigType": "MicroService",

    "policyName": "com.MicroServicevFirewall",

    "onapName": "DCAE"

}' 'https://pdp:8081/pdp/api/createPolicy'


Code Block
languagejs
titleFrom the example API call, this is the configBody JSON contents UNStringified and Pretty Printed
linenumberstrue
{
	"service": "tca_policy",
	"location": "SampleServiceLocation",
	"uuid": "test",
	"policyName": "MicroServicevFirewall", ## WHOA - THIS DOES NOT MATCH policyName in the top-level API call JSON payload
	"description": "MicroService vFirewall Policy",
	"configName": "SampleConfigName", ### ?????
	"templateVersion": "OpenSource.version.1",
	"version": "1.1.0",
	"priority": "1",
	"policyScope": 
Code Block
languagebash
titleExample API Call
curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{

    "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevFirewall\", \"description\": \"MicroService vFirewall Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \
	"riskType\": \"SampleRiskType\", \
	"riskLevel\": \"1\", \
	"guard\": \"False\", \
	"content\": { \
		"tca_policy\": { \
			"domain\": \"measurementsForVfScaling\", \
			"metricsPerEventName\": [{ \
				{
					"eventName\": \"vFirewallBroadcastPackets\", \
					"controlLoopSchemaType\": \"VNF\", \
					"policyScope\": \"DCAE\", \
					"policyName\": \"DCAE.Config_tca-hi-lo\", \
					"policyVersion\": \"v0.0.1\", \
					"thresholds\": [{ \
						{
							"closedLoopControlName\": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \
							"version\": \"1.0.2\", \
							"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \
							"thresholdValue\": 300, \
							"direction\": \"LESS_OR_EQUAL\", \
							"severity\": \"MAJOR\", \
							"closedLoopEventStatus\": \"ONSET\" }, { \"closedLoopControlName\"
						},
						{
							"closedLoopControlName": \"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\", \
							"version\": \"1.0.2\", \
							"fieldPath\": \"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\", \
							"thresholdValue\": 700, \"direction\
							"direction": \"GREATER_OR_EQUAL\", \
							"severity\": \"CRITICAL\", \
							"closedLoopEventStatus\": \"ONSET\" } ] }] } } }",

    "policyConfigType": "MicroService",

    "policyName": "com.MicroServicevFirewall",

    "onapName": "DCAE"

}' 'https://pdp:8081/pdp/api/createPolicy'

Code Block
titleFrom the example API call, this is the configBody JSON contents UNStringified and Pretty Printed
linenumberstrue
{
	"service": "tca_policy",
	"location": "SampleServiceLocation",
	"uuid": "test",
	"policyName": "MicroServicevFirewall",
	"description": "MicroService vFirewall Policy",
	"configName": "SampleConfigName",
	"templateVersion": "OpenSource.version.1",
	"version": "1.1.0",
	"priority": "1",
	"policyScope": "resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
	"riskType": "SampleRiskType",
	"riskLevel": "1",
	"guard": "False",
	"content": {
		"tca_policy": {
			"domain": "measurementsForVfScaling",
			"metricsPerEventName": [
				{
					"eventName": "vFirewallBroadcastPackets",
					"controlLoopSchemaType": "VNF",
					"policyScope": "DCAE",
					"policyName": "DCAE.Config_tca-hi-lo",
					"policyVersion": "v0.0.1",
					"thresholds": [
						{
							"closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
							"version": "1.0.2",
							"fieldPath": "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta",
							"thresholdValue": 300,
							"direction": "LESS_OR_EQUAL",
							"severity": "MAJOR",
							"closedLoopEventStatus": "ONSET"
						},
						{
							"closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
							"version": "1.0.2",
							"fieldPath": "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta",
							"thresholdValue": 700,
							"direction": "GREATER_OR_EQUAL",
							"severity": "CRITICAL",
							"closedLoopEventStatus": "ONSET"
						}
					]
				}
			]
		}
	}
}

Basically, the model is broken as values are spread throughout the payload for the API call. CLAMP has to hardcode this "breakage" to fit the DCAE Policy into the API call. The exact details on what DCAE Policy Handler has to do be able to retrieve the policy are way to numerous and are documented in this PDF:

DCAEGEN2 architecture of policy-handling by DCAE-controller

Policy Lifecycle API (DRAFT Beta version for M2)

Dublin TCA DCAE mS Policy Model Schema

"
						}
					]
				}
			]
		}
	}
}

The exact details on what DCAE Policy Handler has to do be able to retrieve the policy are way to numerous and are documented in this PDF:

DCAEGEN2 architecture of policy-handling by DCAE-controller


Code Block
languagebash
titleCLAMP Push API call
linenumberstrue
curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{

  "pdpGroup": "default",

  "policyName": "com.MicroServicevFirewall",

  "policyType": "MicroService"

}' 'https://pdp:8081/pdp/api/pushPolicy'




DCAE Policy Handler

Code Block
languagejs
https://pdp:8081/pdp/api/getConfig POST
Content-Type: application/json

{"configAttributes": {}, "unique": false, "ecompName": "DCAE", "configName": ".*", "policyName": ".*vFirewall*"}


#
# Returns
#

{
  "policyConfigMessage": "Config Retrieved! ",
  "policyConfigStatus": "CONFIG_RETRIEVED",
  "type": "JSON",
  "config": "{\"service\":\"tca_policy\",\"location\":\"SampleServiceLocation\",\"uuid\":\"test\",\"policyName\":\"MicroServicevFirewall\",\"description\":\"MicroService vFirewall Policy\",\"configName\":\"SampleConfigName\",\"templateVersion\":\"OpenSource.version.1\",\"version\":\"1.1.0\",\"priority\":\"1\",\"policyScope\":\"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"riskType\":\"SampleRiskType\",\"riskLevel\":\"1\",\"guard\":\"False\",\"content\":{\"policyVersion\":\"v0.0.1\",\"threshholds\":[{\"severity\":\"MAJOR\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":\"300\",\"closedLoopEventStatus\":\"ONSET\",\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"direction\":\"LESS_OR_EQUAL\"},{\"severity\":\"CRITICAL\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":\"700\",\"closedLoopEventStatus\":\"ONSET\",\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"direction\":\"GREATER_OR_EQUAL\"}],\"policyName\":\"DCAE.Config_tca-hi-lo\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"eventName\":\"vFirewallBroadcastPackets\"}}",
  "policyName": "com.Config_MS_CSIT_kf0zc9b9olvs2gm_vFirewall.1.xml", ### Where did this come from?? Why isn't this com.MicroServicevFirewall??
  "policyType": "MicroService",
  "policyVersion": "1",
  "matchingConditions": {
    "ECOMPName": "DCAE",
    "ONAPName": "DCAE",
    "ConfigName": "SampleConfigName",
    "service": "tca_policy",
    "uuid": "test",
    "Location": "SampleServiceLocation"
  },
  "responseAttributes": {},
  "property": null
}


#
# The contents of the config UNESCAPED and PRETTY PRINTED
#
# MISSING under content:
#		"tca_policy": {
#			"domain": "measurementsForVfScaling",
#			"metricsPerEventName": [
#
#
{
  "service": "tca_policy",
  "location": "SampleServiceLocation",
  "uuid": "test",
  "policyName": "MicroServicevFirewall",
  "description": "MicroService vFirewall Policy",
  "configName": "SampleConfigName",
  "templateVersion": "OpenSource.version.1",
  "version": "1.1.0",
  "priority": "1",
  "policyScope": "resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
  "riskType": "SampleRiskType",
  "riskLevel": "1",
  "guard": "False",
  "content": {
    "policyVersion": "v0.0.1",
    "threshholds": [
      {
        "severity": "MAJOR",
        "fieldPath": "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta",
        "thresholdValue": "300",
        "closedLoopEventStatus": "ONSET",
        "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
        "version": "1.0.2",
        "direction": "LESS_OR_EQUAL"
      },
      {
        "severity": "CRITICAL",
        "fieldPath": "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta",
        "thresholdValue": "700",
        "closedLoopEventStatus": "ONSET",
        "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
        "version": "1.0.2",
        "direction": "GREATER_OR_EQUAL"
      }
    ],
    "policyName": "DCAE.Config_tca-hi-lo",
    "controlLoopSchemaType": "VNF",
    "policyScope": "DCAE",
    "eventName": "vFirewallBroadcastPackets"
  }
}


Policy Lifecycle API (DRAFT Beta version for M2)

Dublin TCA DCAE mS Policy Model Schema

Code Block
languageyml
titleDublin DCAE TCA Model Schema
linenumberstrue


tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.Monitoring:
        derived_from: tosca.policies
Code Block
languageyml
titleDublin DCAE TCA Model Schema
linenumberstrue


tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.Monitoring:
        derived_from: tosca.policies.Root
        description: a base policy type for all policies that govern monitoring provision
    onap.policy.monitoring.cdap.tca.hi.lo.app:
        derived_from: onap.policies.Monitoring
        properties:
            tca_policy:
                type: map
                description: TCA Policy JSON
                default: '{"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"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VNF","policyScope":"resource=vLoadBalancer;type=configuration","policyName":"configuration.dcae.microservice.tca.xml","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"}]}]}'
                entry_schema:
                    type: onap.datatypes.monitoring.tca_policy
data_types:
    onap.datatypes.monitoring.metricsPerEventName:
        derived_from: tosca.datatypes.Root
        propertiesdescription:
 a base policy type for all policies that govern monitoring  controlLoopSchemaType:provision
    onap.policy.monitoring.cdap.tca.hi.lo.app:
            typederived_from: stringonap.policies.Monitoring
        properties:
        description: Specifies Control Loop Schema Type for the tca_policy:
                    event Name e.g. VNF, VMtype: map
                constraintsdescription:
 TCA Policy JSON
               - valid_valuesdefault:
                      - 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: onap.datatypes.monitoring.thresholds
    onap.datatypes.monitoring.tca_policy:
        derived_from: tosca.datatypes.Root
        properties:
            domain:
                type: string
                description: Domain name to which TCA needs to be applied
                default: measurementsForVfScaling
                constraints:
                  - equal: measurementsForVfScaling
            metricsPerEventName:
                type: list
                description: Contains eventName and threshold details
            '{"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"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VNF","policyScope":"resource=vLoadBalancer;type=configuration","policyName":"configuration.dcae.microservice.tca.xml","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"}]}]}'
         that need to be applied to given eventName
                entry_schema:
                    type: onap.datatypes.monitoring.metricsPerEventNametca_policy
data_types:
    onap.datatypes.monitoring.thresholdsmetricsPerEventName:
        derived_from: tosca.datatypes.Root
        properties:
            closedLoopControlNamecontrolLoopSchemaType:
                type: string
                description: Specifies ClosedControl Loop ControlSchema NameType associatedfor withthe
                    the threshold
event Name e.g. VNF, VM
               closedLoopEventStatus constraints:
                  - typevalid_values: string
                description: Closed Loop Event Status of the- thresholdVM
                constraints:
      - VNF
           - valid_valueseventName:
                type: string
     - ONSET
          description: Event name to which thresholds need to be
    - ABATED
            direction:
    applied
            typepolicyName: string
                descriptiontype: Direction of the thresholdstring
                constraintsdescription:
 TCA Policy Scope Name
              - valid_valuespolicyScope:
                type: string
     - LESS
          description: TCA Policy Scope
         - LESS_OR_EQUAL
  policyVersion:
                type: string
   - GREATER
            description: TCA Policy        - GREATER_OR_EQUALScope Version
            fieldPaththresholds:
                type: stringlist
                description: JsonThresholds fieldassociated Pathwith aseventName
 per CEF message which
            entry_schema:
        needs to be analyzed for TCA
       type: onap.datatypes.monitoring.thresholds
    severityonap.datatypes.monitoring.tca_policy:
        derived_from: tosca.datatypes.Root
        typeproperties:
 string
           domain:
     description: Threshold Event Severity
        type: string
       constraints:
         description: Domain name to which TCA needs to be - valid_values:
applied
                default: measurementsForVfScaling
      - CRITICAL
         constraints:
             - MAJOR
    - equal: measurementsForVfScaling
            metricsPerEventName:
    - MINOR
           type: list
          -   WARNING
   description: Contains eventName and threshold details
              - NORMAL
     that need to be applied to given thresholdValue:eventName
                typeentry_schema: integer
                description: Threshold value for the field Path insidetype: onap.datatypes.monitoring.metricsPerEventName
    onap.datatypes.monitoring.thresholds:
        derived_from: tosca.datatypes.Root
       CEF messageproperties:
            versionclosedLoopControlName:
                type: string
                description: Closed Loop VersionControl numberName associated with
    the threshold



Code Block
languageyml
titleExpected Policy to be Created by CLAMP
linenumberstrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
imports:
    -
      tca_policy_model_dublin.yml
policies:
    the -threshold
      onap.vfirewall.tca:
        type: onap.policy.monitoring.cdap.tca.hi.lo.appclosedLoopEventStatus:
        properties:
        type: string
   domain: measurementsForVfScaling
            metricsPerEventNamedescription: 
Closed Loop Event Status of the threshold
      - 
         constraints:
       eventName: vLoadBalancer
          - valid_values:
     controlLoopSchemaType: VNF
                policyScope: "resource=vLoadBalancer;type=configuration"- ONSET
                policyName: "onap.vfirewall.tca" # Do we need a name? The unique node name should be enough?      - ABATED
            direction:
                policyVersion: "v0.0.1" # This field should be removed as Policy Create/Update API will return the versiontype: string
                description: Direction of the threshold
                thresholdsconstraints:
  
                - valid_values:
                     closedLoopControlName: "CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A"
- LESS
                      closedLoopEventStatus: ONSET- LESS_OR_EQUAL
                    version: "1.0.2"
   - GREATER
                  fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
   - GREATER_OR_EQUAL
            fieldPath:
    thresholdValue: 500
           type: string
        direction: LESS_OR_EQUAL
       description: Json field Path as per CEF message which
     severity: MAJOR
              needs to be analyzed -for TCA
            severity:
        closedLoopControlName: "CL-LBAL-LOW-TRAFFIC-SIG-0C5920A6-B564-8035-C878-0E814352BC2B"
       type: string
            closedLoopEventStatus: ONSET
   description: Threshold Event Severity
                version: "1.0.2"constraints:
                  - valid_values:
 fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
                    thresholdValue:- 5000CRITICAL
                    direction: GREATER_OR_EQUAL
  - MAJOR
                      - MINOR
                      - WARNING
                      - NORMAL
         severity: CRITICAL
   thresholdValue:
                type: integer
                description: Threshold value for the field Path inside
                    CEF message
            version:
                type: string
                description: Version number associated with the threshold




Code Block
languageyml
titleExpected Policy to be Created by CLAMP
linenumberstrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
imports:
    -
      tca_policy_model_dublin.yml
policies:
    -
      onap.vfirewall.tca:
        type: onap.policy.monitoring.cdap.tca.hi.lo.app
        properties:
            domain: measurementsForVfScaling
            metricsPerEventName: 
            - 
                eventName: vLoadBalancer
                controlLoopSchemaType: VNF
                policyScope: "resource=vLoadBalancer;type=configuration"
                policyName: "onap.vfirewall.tca" # Do we need a name? The unique node name should be enough?
                policyVersion: "v0.0.1" # This field should be removed as Policy Create/Update API will return the version
                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


Equivalency Table: Casablanca and Dublin APIs

(Comments pasted from API page)

In an equivalency table, this would be the same as the legacy - createPolicy and updatePolicy.   Probably worth to mention for the benefit of other teams.   The result would support the JSON format, so clients should expect little or no change.

This URL for POST should create a resource that we need to identify

POST
https://{url}:{port}/api/v1/policytypes/
{policy type id}/versions/{version}/policies/

One proposal is to use the closedLoopControlName field:

CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A

and the version in this case:

1.0.2.

The GET for this specific one would be then

GET
https://{url}:{port}/api/v1/policytypes/
{policy type id}/versions/{version}/policies/CL-LBAL-LOW-TRAFFIC-SIG-FB480F95-A453-6F24-B767-FD703241AB1A/versions/1.0.2

They can name the policies however they want. If they want to use Closed Loop Control Name go ahead. The problem with the TCA model is they shove all that detail inside the model and use arrays of Control Loops. But its up to them on how they want their model to look.