Versions Compared

Key

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

...

2.1 Mapping of existing (through El Alto) Policy YAML Operational Definition


Code Block
languagejsyml
titleMapping of existing Operational policy to TOSCA Policy TypeExample Policy - one-2-one mapping of the El Alto YAML operation definition
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policytopology_typestemplate:
    type: onap.policies.controlloop.operational.Simple
    version: 1.0.0
    description: Operational Policy for Control Loop execution
    properties: -
        controlLoopNameoperational.scaleout:
            type: Stringonap.policies.controlloop.Operational
            descriptionversion: The unique control loop id
1.0.0
           metadata:
     required: true
        timeout:policy-id: operational.scaleout
            typeproperties: Integer
            description: Overall timeout for executing all the operations in the policy. controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
             triggerOperation: unique-policy-id-1-scale-up
            required timeout: true1200
             abatement: false
             typeoperations: Boolean
            description: Whether an abatement- will be expected for the control loop.
id: unique-policy-id-1-scale-up
                 requiredname: true
Create a new VF Module
        default: false
        triggerOperationIddescription:
                 typeactor: StringSO
            description:  Id of the operation: toVF beModule triggeredCreate
 when receiving an Onset event
            requiredtarget: true
        operations:
            typetarget: listVNF
            description: List of operations executed uponpayload:
 receiving an Onset event for the Control Loop.
            required: truerequestParameters: '{"usePreload":true,"userParams":[]}'
            entry_schema:
                type: onap.datatype.controlloop.operation.directiveconfigurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[9]","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[16]","enabled":"$.vf-module-topology.vf-module-parameters.param[23]"}]'
                
data_types:
    onap.datatype.controlloop.targettype: retry: 0
        derived_from: tosca.datatypes.Root
        versiontimeout: 1.0.01200
        description: Definition of the target type for operations during control loopssuccess: final_success
        properties:
         failure: final_failure
  target:
                typefailure_timeout: Stringfinal_failure_timeout
                description: The type target the operation is performed against. failure_retries: final_failure_retries
                required: true
                constraints:
                    valid_values: [VNF, VM, VNFC, VFMODULE, PNF] failure_exception: final_failure_exception
            resources:
     failure_guard: final_failure_guard



2.2 Use of NodeTypes and CapabilityTypes to support Actor/Operation definition - Nested approach (Agreed not to use - will retain flat structure)

Code Block
languagejs
titleMapping of existing Operational policy to TOSCA Policy Type
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.controlloop.operational.Common:
           type: String
                descriptionderived_from: |tosca.policies.Root
        version: 2.0.0
        description: Operational Policy Thefor resourceControl inLoop whichexecution
 the operation is be performed against. By default,properties:
            id:
        an onset event will contain resource identification which should be usedtype: String
                description: The unique control forloop theid
 operation (if applicable) if this field is missing.
           required: true
        
    onap.datatype.controlloop.operationtimeout:
        derived_from: tosca.datatypes.Root
        versiontype: 1.0.0Integer
         description: An operation supported by an actor
 description: Overall timeout for executing all the properties:operations.
            id:
    required: true
            typeonset: String
                description: UniqueThe identifierdatatype forof the operation expected ONSET Control Loop Event
                required: true
            targettype:
    entry_schema:
            description: The target type supported by the operation
 type: onap.datatype.controlloop.Event
              requiredabatement: true
                entry_schematype: Boolean
                description: Whether an abatement type: onap.datatype.controlloop.targettype
     will be expected for the control loop.
       parameters:
         required: true
      type: Map
         default: false
      description: Optional parameters required by the operation:
                requireddescription: false
Initial operation to execute upon receiving an Onset event for the Control payload:Loop.
                typerequired: Maptrue
                description: Optional payload that is passed from the policy to the actor for operation execution.
    entry_schema:
                    type: onap.datatype.controlloop.operation.Directive

    onap.datatypepolicies.controlloop.actoroperational.common.Apex:
        derived_from: tosca.datatypes.Rootonap.policies.controlloop.operational.Common
        version: 1.0.0
        description: ActorOperational involvedpolicies infor executing operations in a control loopApex PDP
        properties:

    onap.policies.controlloop.operational.common.Drools:
        id:derived_from: onap.policies.controlloop.operational.Common
        version: 1.0.0
        typedescription: String
Operational policies for Drools PDP
        properties:
    description:    Unique identifier for the actorcontroller:
                requireddescription: Drools true
controller properties
               description required: true
                typeentry_schema: String
                description: Optional description of the actortype: onap.datatype:controlloop.controller.Drools
                required: false
            operations:
   
data_types:
    onap.datatype.controlloop.Event:
         typederived_from: Listtosca.datatypes.Root
        version: 1.0.0
        description: ListDefinition of the operationstarget availabletype for operations theduring control actorloops
        properties:
        required: true
   event_type:
             entry_schema:
   type: String
                typerequired: onap.datatype.controlloop.operationtrue
            
            default: "Legacy"
             
    constraints:
    onap.datatype.controlloop.operation.directive:
        derived_from: tosca.datatypes.Root
       - version: 1.0.0valid_values: ["Legacy", "VES"]
        description: Policy definitions for taking actions during a Control Loop eventevent_version:
        properties:
            id:type: String
                typerequired: Stringtrue
                descriptiondefault: ID for the policy. Used by triggerPolicy and final_* events to indicate next policy to enforce."1.0.0"

    onap.datatype:controlloop.controller.Drools:
        derived_from: tosca.datatypes.Root
        version: 1.0.0
        requireddescription: true
Definition of the target type for operations during control    description:loops
        properties:
        type: String
   # TBD
        
    description: A user-friendly description of the policy
   onap.datatype.controlloop.TargetType:
        derived_from: tosca.datatypes.Root
             requiredversion: false1.0.0
        description: Definition of the actor:
target type for operations during control loops
        properties:
     description: The actor that will perform the operationtarget:
                requiredtype: trueString
                entry_schema:
     description: The type target the operation is performed against.
               type required: onap.datatype.controlloop.actor
true
                operationconstraints:
                    description: The operation the actor should perform on the targetvalid_values: [VNF, VM, VNFC, VFMODULE, PNF]
            resources:
                requiredtype: trueString
                entry_schemadescription: |
                    type: onap.datatype.controlloop.operation
      The resource in which the operation is be performed against. By default,
      target:
              an onset description: The target this operation is performed againstevent will contain resource identification which should be used
                required: true
   for the operation (if applicable) if this field is  missing.
   entry_schema:
                 
   type: onap.datatype.controlloop.targettypeOperation:
        derived_from: tosca.datatypes.Root
   timeout:
     version: 1.0.0
        description: An operation supported by type:an Integeractor
        properties:
        description: The amount of timeid:
 for the actor to perform the operation.
         type: String
      required: true
         description: Unique  retries:identifier for the operation
                typerequired: Integertrue
            targettype:
           description: The number of retries thedescription: actorThe shouldtarget attempttype tosupported performby the operation.
                required: true
                defaultentry_schema: 0
            success: 
       type: onap.datatype.controlloop.TargetType
        description:  Points to theparameters:
 operation to invoke on success.
           type: Map
    required: false
           description: Optional parameters required by default: final_successthe operation
                entry_schemarequired: false
            payload:
        type: onap.datatype.controlloop.operation.directive
       type: Map
    failure:
            description: Optional payload that description:is Pointspassed tofrom the operationpolicy to invokethe onactor Actorfor operation failureexecution.
    
    onap.datatype.controlloop.operation.Directive:
        requiredderived_from: falsetosca.datatypes.Root
        version: 1.0.0
        defaultdescription: final_failure
Policy definitions for taking actions during a Control Loop event
        entry_schemaproperties:
            id:
        type: onap.datatype.controlloop.operation.directive
       type: String
    failure_timeout:
                description: Unique PointsID tofor the operation
 to invoke when the time out for the operation occurs.
      required: true
            requireddescription: false
                defaulttype: final_failure_timeoutString
                entry_schema:
    description: A user-friendly description of the directive
                typerequired: onap.datatype.controlloop.operation.directivefalse
            failure_retriesactor:
                description: PointsThe toactor thethat operationwill toperform invoke when the current operation has exceeded its max retries.
                required: falsetrue
                defaultentry_schema: final_failure_retries

                  entry_schema:
                    type: onap.datatypenodetype.controlloop.operation.directiveActor
            failure_exceptionoperation: 
                description: PointsThe tooperation the operationactor toshould invokeperform whenon the current operation causes an exception.target
                required: false
                default: final_failure_exceptiontrue
                entry_schema:
                    type: onap.datatype.controlloop.operation.directive
            failure_guardtarget: 
                description: PointsThe to the operation to invoke when the currenttarget this operation is blocked due to guard policy enforcement.performed against
                required: falsetrue
                default: final_failure_guard     
                entry_schema:
                    type: onap.datatype.controlloop.operation.directive


Code Block
languageyml
titleExample Policy - one-2-one mapping of the El Alto YAML operation definition
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
topology_template:
   policies:
targettype
         -
   timeout:
     operational.scaleout:
           type: onap.policies.controlloop.OperationalInteger
           version     description: 1.0.0
           metadata:
The amount of time for the actor to perform the operation.
                policy-idrequired: operational.scaleouttrue
            propertiesretries:
                controlLoopNametype: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3Integer
             triggerOperation: unique-policy-id-1-scale-up
             timeout: 1200
   description: The number of retries the actor should attempt to perform the operation.
                abatementrequired: falsetrue
             operations:
   default: 0
           - idsuccess: unique-policy-id-1-scale-up
                 namedescription: CreatePoints a new VF Moduleto the operation to invoke on success.
                required: description:false
                 actordefault: SOfinal_success
                 operationentry_schema:
 VF Module Create
                 target:
type: onap.datatype.controlloop.operation.directive
            failure:
            target: VNF    description: Points to the operation to invoke on Actor operation failure.
                required: payload:false
                default: final_failure
  requestParameters: '{"usePreload":true,"userParams":[]}'
              entry_schema:
       configurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[9]","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[16]","enabled":"$.vf-module-topology.vf-module-parameters.param[23]"}]'
            type: onap.datatype.controlloop.operation.directive
    retry: 0
       failure_timeout:
          timeout: 1200
     description: Points to the operation to invoke when the time out for success: final_successthe operation occurs.
                 failurerequired: final_failurefalse
                 failure_timeoutdefault: final_failure_timeout
                 failureentry_retries: final_failure_retriesschema:
                 failure_exception: final_failure_exception
     type: onap.datatype.controlloop.operation.directive
            failure_guard: final_failure_guard

2.2 Mapping using TOSCA Triggers

Code Block
languageyml
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
retries:
     onap.policies.controlloop.operational.TriggerStylePolicyType:
        derived_from: tosca.policies.Root
  description: Points to the operation to version: 1.0.0
        description: Operational Policy for Control Loop execution using Triggers
invoke when the current operation has exceeded its max retries.
                metadatarequired: false
        properties:
            controlLoopName:default: final_failure_retries
                typeentry_schema: string
                description: The unique control loop idtype: onap.datatype.controlloop.operation.directive
                requiredfailure_exception: true
            timeout:
    description: Points to the operation to invoke when the current operation causes type:an integerexception.
                descriptionrequired: Overallfalse
 timeout for executing all the operations in the policy.
       default: final_failure_exception
        required: true
        targetsentry_schema:
 [] # optional must be Node Types or Group Types applied to
        triggerstype: # ?onap.datatype.controlloop.operation.directive
            failure_guard: 
       
topology_template:
   policies:
      -
description: Points to the operation to invoke when the firewall_restart:
current operation is blocked due to guard policy enforcement.
    type: onap.policies.controlloop.operational.TriggerStylePolicyType
            descriptionrequired: vFirewallfalse
 use case - APPC restart
            metadatadefault:
 final_failure_guard     
      properties:
          entry_schema:
     controlLoopName: ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
               timeout: 1200stype: onap.datatype.controlloop.operation.directive

node_types:
    onap.nodetype.controlloop.Actor:
        targetsderived_from: [] # optional must be Node Templates or Groups applied totosca.nodes.Root
        version: 1.0.0
        description: Actor involved in triggers:
executing operations in a control loop
         -properties:
            id:
    on_onset:
            type: String
           description: When the ONSET event isdescription: received
Unique identifier for the actor
                event_typerequired: ControlLoopEventtrue
        capabilities:
            scheduleoperation:
                type: onap.controlloop.capability.Operation
      start_time: T06:00:00Z
     capabilities:
                  end_timetype: T23:59:59ZList
                    target_filter:
       description: List of operations available for the actor
                noderequired: true
                       requiremententry_schema:
                       capabilitytype: onap.datatype.controlloop.Operation
capability_types:
     onap.controlloop.capability.appc.ModifyConfig:
        derived_from: tosca.nodes.Capabilities
        conditionproperties:

topology_template:
    node_templates:
        onap.nodetype.controlloop.actor.Appc:
            action: # scripts?
type: onap.nodetype.controlloop.Actor
            id: APPC
            primarydescription: #APPC Thecontrol optionalloop implementationactor
 artifact (i.e., the primary script file within a TOSCA CSAR file). capabilities:
                ModifyConfig:
       dependencies: # The optional ordered list of one or more dependent or secondary implementation artifacts which are referenced by the primary implementation artifact type: onap.controlloop.capability.appc.ModifyConfig
        onap.nodetype.controlloop.actor.AppcLcm:
            type: onap.nodetype.controlloop.Actor
          timeout: # timeout in seconds
  id: APPCLCM
            description: APPC LCM control loop actor
           operation_host capabilities:
 # node executed on
            Restart:
        constraint: # seems the same as condition above
     type: onap.controlloop.capability.appclcm.Restart
                periodRebuild: 300s
                    evaluationstype: 3 # is this retries? The optional number of evaluations that must be performed over the period to assert the condition exists.
onap.controlloop.capability.appclcm.Rebuild
                Migrate:
                    type: onap.controlloop.capability.appclcm.Migrate
                ConfigModify:
         method: # optional statistical method name to use to perform evaluation of condition

 

Issue: The "policies" property can be confusing with the TOSCA Topology Template value "policies".

  • Pamela Dragosh  - use "operations" instead since it really is a set of operations that are really being enforced.

Issue: How to ensure that CLAMP does not have to hard-code the meaning of properties. Specifically, success, failure, failure_timeout etc. - need to point to other actor/recipe's to be triggered/executed.

Issue: How to ensure that CLAMP does not have to hard-code where CSAR details need to be populated in the policy. Eg. Target Type

  • Need to use defaults, descriptions, constraints, required fields

  - Pam and Liam will work on Operational policies to look like Seb's JSON schema so Seb can test it out. Then identify next problem to solve.

Seb's JSON schema from El Alto:

https://gerrit.onap.org/r/gitweb?p=clamp.git;a=blob;f=src/main/resources/clds/json-schema/operational_policies/operational_policy.json;h=93738c80923be027781b9c2bf0fe72cfa82d7fec;hb=HEAD

 

Issue: TOSCA Constraints would be nice to have something with suggested values, so the policy isn't locked into a set of values. Example is "actors" - ONAP has a set of actors, but it would be nice to be able to extend to other internal actors companies support.

Code Block
# REST of policy ommitted for brevity

    onap.datatype.controlloop.operationalpolicies:
        derived_from: tosca.datatypes.Root
        version: 1.0.0
        description: Policy definitions for taking actions during a Control Loop event
        properties:
            # other properties ommitted for brevity
            actor:
                type: String
                description: The actor that will perform the operation
                required: true
				constraints:
					possible_values: [SO, SDNC, APPC, VFC, SNDR, CDS]

Issue: TOSCA does NOT have a way to relate properties together. For example, if the actor property is selected as APPC, then the contraints (eg possible values) for the operation property SHOULD be "restart", "reboot", "modifyConfig". How can that be specified?

type: onap.controlloop.capability.appclcm.ConfigModify
        onap.nodetype.controlloop.actor.Cds:
            type: onap.nodetype.controlloop.Actor
            id: CDS
            description: CDS control loop actor
            capabilities:
                ModifyConfig:
                    type: onap.controlloop.capability.cds.ModifyConfig
        onap.nodetype.controlloop.actor.Sdnc:
            type: onap.nodetype.controlloop.Actor
            id: SDNC
            description: SDNC control loop actor
            capabilities:
                reroute:
                    type: onap.controlloop.capability.sdnc.reroute
                BandwidthOnDemand:
                    type: onap.controlloop.capability.sdnc.BandwidthOnDemand
        onap.nodetype.controlloop.actor.Sdnr:
            type: onap.nodetype.controlloop.Actor
            id: SDNR
            description: SDNR control loop actor
            capabilities:
                ModifyConfig:
                    type: onap.controlloop.capability.sdnr.ModifyConfig
        onap.nodetype.controlloop.actor.So:
            type: onap.nodetype.controlloop.Actor
            id: SO
            description: SO control loop actor
            capabilities:
                VFModuleCreate:
                    type: onap.controlloop.capability.so.VFModuleCreate
                VFModuleDelete:
                    type: onap.controlloop.capability.so.VFModuleDelete
        onap.nodetype.controlloop.actor.Vfc:
            type: onap.nodetype.controlloop.Actor
            id: VFC
            description: VFC control loop actor
            capabilities:
                Restart:
                    type: onap.controlloop.capability.vfc.Restart
                    



2.2 Mapping using TOSCA Triggers - WIP unable to replicate requirements that were met by previous YAML structure

Code Block
languageyml
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.controlloop.operational.TriggerStylePolicyType:
        derived_from: tosca.policies.Root
        version: 1.0.0
        description: Operational Policy for Control Loop execution using Triggers
        metadata:
        properties:
            controlLoopName:
                type: string
                description: The unique control loop id
                required: true
            timeout:
                type: integer
                description: Overall timeout for executing all the operations in the policy.
                required: true
        targets: [] # optional must be Node Types or Group Types applied to
        triggers: # ?
                    
topology_template:
   policies:
      -
         firewall_restart:
            type: onap.policies.controlloop.operational.TriggerStylePolicyType
            description: vFirewall use case - APPC restart
            metadata:
            properties:
               controlLoopName: ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
               timeout: 1200s
            targets: [] # optional must be Node Templates or Groups applied to
            triggers:
              -
                on_onset:
                    description: When the ONSET event is received
                    event_type: ControlLoopEvent
                    schedule:
                       start_time: T06:00:00Z
                       end_time: T23:59:59Z
                    target_filter:
                       node:
                       requirement:
                       capability:
                    condition:
                    action: # scripts?
                       primary: # The optional implementation artifact (i.e., the primary script file within a TOSCA CSAR file). 
                       dependencies: # The optional ordered list of one or more dependent or secondary implementation artifacts which are referenced by the primary implementation artifact 
                       timeout: # timeout in seconds
                       operation_host: # node executed on
                    constraint: # seems the same as condition above
                    period: 300s
                    evaluations: 3 # is this retries? The optional number of evaluations that must be performed over the period to assert the condition exists.
                    method: # optional statistical method name to use to perform evaluation of condition


2.3 Flat Structure - v1


Code Block
titleFlat structure
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.controlloop.operational.Common:
        derived_from: tosca.policies.Root
        version: 2.0.0
        description: Operational Policy for Control Loop execution
        properties:
            id:
                type: String
                description: The unique control loop id
                required: true
            timeout:
                type: Integer
                description: Overall timeout for executing all the operations.
                required: true
            abatement:
                type: Boolean
                description: Whether an abatement event message will be expected for the control loop.
                required: true
                default: false
            operation:
                description: List of operations to be performed when Control Loop is triggered.
                required: true
                entry_schema:
                    type: onap.datatype.controlloop.Operation
            trigger:
                type: String
                description: Initial operation to execute upon receiving an Onset event message for the Control Loop.
                required: true

    onap.policies.controlloop.operational.Apex:
        derived_from: onap.policies.controlloop.operational.Common
        version: 1.0.0
        description: Operational policies for Apex PDP
        properties:

    onap.policies.controlloop.operational.Drools:
        derived_from: onap.policies.controlloop.operational.Common
        version: 1.0.0
        description: Operational policies for Drools PDP
        properties:
            controller:
                description: Drools controller properties
                required: true
                entry_schema:
                    type: onap.datatype:controlloop.controller.Drools
                                
data_types:
    onap.datatype.controlloop.controller.Drools:
        derived_from: tosca.datatypes.Root
        version: 1.0.0
        description: Definition of the target type for operations during control loops
        properties:
                                    
    onap.datatype.controlloop.Operation:
        derived_from: tosca.datatypes.Root
        version: 1.0.0
        description: An operation supported by an actor
        properties:
            id:
                type: String
                description: Unique identifier for the operation
                required: true
            description:
                type: String
                description: A user-friendly description of the intent for the operation
                required: false
            actor:
                type: String
                description: The actor that will perform the operation
                required: true
            operation:
                type: String
                description: The operation the actor should perform on the target
                required: true
            target:
                type: String
                description: The target the operation is to be performed on.
                required: true
            payload:
                type: Map
                description: Optional payload that is passed from the policy to the actor for operation execution.
                required: false
            timeout:
                type: Integer
                description: The amount of time for the actor to perform the operation.
                required: true
            retries:
                type: Integer
                description: The number of retries the actor should attempt to perform the operation.
                required: true
                default: 0
            success:
                type: String
                description: Points to the operation to invoke on success. A value of "final_success" indicates and end to the operation.
                required: false
                default: final_success
            failure:
                type: String
                description: Points to the operation to invoke on Actor operation failure.
                required: false
                default: final_failure
            failure_timeout:
                description: Points to the operation to invoke when the time out for the operation occurs.
                required: false
                default: final_failure_timeout
            failure_retries:
                description: Points to the operation to invoke when the current operation has exceeded its max retries.
                required: false
                default: final_failure_retries
            failure_exception: 
                description: Points to the operation to invoke when the current operation causes an exception.
                required: false
                default: final_failure_exception
            failure_guard: 
                description: Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.
                required: false
                default: final_failure_guard     


                    


2.3 Flat Structure - v2

Flat Structure vs - use of metadata and actor as a datatype

Code Block
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
    onap.policies.controlloop.operational.Common:
        derived_from: tosca.policies.Root
        version: 1.0.0
        description: Operational Policy for Control Loop execution
        properties:
            id:
                type: String
                description: The unique control loop id.
                required: true
            timeout:
                type: Integer
                description: |
                    Overall timeout for executing all the operations. This timeout should equal or exceed the total
                    timeout for each operation listed.
                required: true
            abatement:
                type: Boolean
                description: Whether an abatement event message will be expected for the control loop from DCAE.
                required: true
                default: false
            trigger:
                type: String
                description: Initial operation to execute upon receiving an Onset event message for the Control Loop.
                required: true
            operations:
                description: List of operations to be performed when Control Loop is triggered.
                required: true
                entry_schema:
                    type: onap.datatype.controlloop.Operation

    onap.policies.controlloop.operational.common.Apex:
        derived_from: onap.policies.controlloop.operational.Common
        type_version: 1.0.0
        version: 1.0.0
        description: Operational policies for Apex PDP
        properties:

    onap.policies.controlloop.operational.common.Drools:
        derived_from: onap.policies.controlloop.operational.Common
        type_version: 1.0.0
        version: 1.0.0
        description: Operational policies for Drools PDP
        properties:
            controller:
                description: Drools controller properties
                required: true
                entry_schema:
                    type: onap.datatype.controlloop.controller.Drools

data_types:
    onap.datatype.controlloop.controller.Drools:
        derived_from: tosca.datatypes.Root
        description: Definition of the target type for operations during control loops
        properties:
            controllerName:
                type: String
                description: The id of the Drools controller the policy should be loaded in.
                required: false

    onap.datatype.controlloop.operation.Failure:
        derived_from: tosca.datatypes.Root
        description: Captures information of an operational failure performed for control loop
        properties:
            messages:
                type: String
                description: error message
                required: true
            category:
                type: String
                description: |
                    The category the error occurred in. Whether this is a general error from the actor, or the operation
                    timed out, retries were exhausted in trying to execute the operation, a guard policy prevented the
                    operation from occuring, or an exception in the system caused the failure.
                constraints:
                - valid_values: [error, timeout, retries, guard, exception]

    onap.datatype.controlloop.Target:
        derived_from: tosca.datatypes.Root
        description: Definition for a entity in A&AI to perform a control loop operation on
        properties:
            targetType:
                type: String
                description: Category for the target type
                required: true
                constraints:
                - valid_values: [VNF, VM, VFMODULE, PNF]
            entityIds:
                type: Map
                description: |
                    Map of values that identify the resource. If none are provided, it is assumed that the
                    entity that generated the ONSET event will be the target.
                required: false

    onap.datatype.controlloop.Actor:
        derived_from: tosca.datatypes.Root
        description: An actor/operation/target definition
        properties:
            actor:
                type: String
                description: The actor performing the operation.
                required: true
            operation:
                type: String
                description: The operation the actor is performing.
                required: true
            target:
                type: String
                description: The resource the operation should be performed on.
                required: true
                metadata:
                    clamp_csar_lookup: csar_plugin
            payload:
                type: Map
                description: Name/value pairs of payload information passed by Policy to the actor
                required: false

    onap.datatype.controlloop.Operation:
        derived_from: tosca.datatypes.Root
        description: An operation supported by an actor
        properties:
            id:
                type: String
                description: Unique identifier for the operation
                required: true
            description:
                type: String
                description: A user-friendly description of the intent for the operation
                required: false
            operation:
                description: The definition of the operation to be performed.
                required: true
                metadata:
                    clamp_catalog: get_operations
                entry_schema:
                    type: onap.datatype.controlloop.Actor
            timeout:
                type: Integer
                description: The amount of time for the actor to perform the operation.
                required: true
            retries:
                type: Integer
                description: The number of retries the actor should attempt to perform the operation.
                required: true
                default: 0
            success:
                type: String
                description: Points to the operation to invoke on success. A value of "final_success" indicates and end to the operation.
                required: false
                default: final_success
            failure:
                type: String
                description: Points to the operation to invoke on Actor operation failure.
                required: false
                default: final_failure
            failure_timeout:
                description: Points to the operation to invoke when the time out for the operation occurs.
                required: false
                default: final_failure_timeout
            failure_retries:
                description: Points to the operation to invoke when the current operation has exceeded its max retries.
                required: false
                default: final_failure_retries
            failure_exception:
                description: Points to the operation to invoke when the current operation causes an exception.
                required: false
                default: final_failure_exception
            failure_guard:
                description: Points to the operation to invoke when the current operation is blocked due to guard policy enforcement.
                required: false
                default: final_failure_guard     




Code Block
titleExamples of policies
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
topology_template:
    policies:
    -   operational.modifyconfig:
            type: onap.policies.controlloop.operational.common.Drools
            type_version: 1.0.0
            version: 1.0.0
            metadata:
                policy-id: operational.modifyconfig
            properties:
                id: ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
                timeout: 1200
                abatement: false
                trigger: unique-policy-id-1-modifyConfig
                operations:
                -   id: unique-policy-id-1-modifyConfig
                    description: Modify the packet generator
                    operation:
                        actor: APPC
                        operation: ModifyConfig
                        target:
                            targetType: VNF
                            entityId:
                                resourceID: bbb3cefd-01c8-413c-9bdd-2b92f9ca3d38
                    timeout: 300
                    retries: 0
                    success: final_success
                    failure: final_failure
                    failure_timeout: final_failure_timeout
                    failure_retries: final_failure_retries
                    failure_exception: final_failure_exception
                    failure_guard: final_failure_guard
                controllerName: usecases

    -   operational.restart:
            type: onap.policies.controlloop.operational.common.Drools
            type_version: 1.0.0
            version: 1.0.0
            metadata:
                policy-id: operational.restart
            properties:
                id: ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
                timeout: 3600
                abatement: true
                trigger: unique-policy-id-1-restart
                operations:
                -   id: unique-policy-id-1-restart
                    description: Restart the VM
                    operation:
                        actor: APPC
                        recipe: Restart
                        target:
                            type: VNF
                    timeout: 1200
                    retries: 3
                    success: final_success
                    failure: final_failure
                    failure_timeout: final_failure_timeout
                    failure_retries: final_failure_retries
                    failure_exception: final_failure_exception
                    failure_guard: final_failure_guard
                controllerName: usecases

    -   operational.scaleout:
            type: onap.policies.controlloop.operational.common.Drools
            type_version: 1.0.0
            version: 1.0.0
            metadata:
                policy-id: operational.scaleout
            properties:
                id: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
                timeout: 1200
                abatement: false
                trigger: unique-policy-id-1-scale-up
                operations:
                -   id: unique-policy-id-1-scale-up
                    description: Create a new VF Module
                    operation:
                        actor: SO
                        operation: VF Module Create
                        target:
                            type: VFMODULE
                            entityIds:
                                modelInvariantId: e6130d03-56f1-4b0a-9a1d-e1b2ebc30e0e
                                modelVersionId: 94b18b1d-cc91-4f43-911a-e6348665f292
                                modelName: VfwclVfwsnkBbefb8ce2bde..base_vfw..module-0
                                modelVersion: 1
                                modelCustomizationId: 47958575-138f-452a-8c8d-d89b595f8164
                        payload:
                            requestParameters: '{"usePreload":true,"userParams":[]}'
                            configurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[9]","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[16]","enabled":"$.vf-module-topology.vf-module-parameters.param[23]"}]'
                    timeout: 1200
                    retries: 0
                    success: final_success
                    failure: final_failure
                    failure_timeout: final_failure_timeout
                    failure_retries: final_failure_retries
                    failure_exception: final_failure_exception
                    failure_guard: final_failure_guard
                controllerName: usecases

    -   operational.modifyconfig.cds:
            type: onap.policies.controlloop.operational.common.Drools
            type_version: 1.0.0
            version: 1.0.0
            metadata:
                policy-id: operational.modifyconfig.cds
            properties:
                id: ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
                timeout: 1200
                abatement: false
                trigger: unique-policy-id-1-modifyConfig
                operations:
                -   id: unique-policy-id-1-modifyConfig
                    description: Modify the packet generator
                    operation:
                        actor: APPC
                        operation: ModifyConfig
                        target:
                            targetType: VNF
                            entityId:
                                resourceID: bbb3cefd-01c8-413c-9bdd-2b92f9ca3d38
                        payload:
                            artifact_name: vfw-cds
                            artifact_version: 1.0.0
                            mode: async
                            data: '{"mapInfo":{"key":"val"},"arrayInfo":["one","two"],"paramInfo":"val"}'
                    timeout: 300
                    retries: 0
                    success: final_success
                    failure: final_failure
                    failure_timeout: final_failure_timeout
                    failure_retries: final_failure_retries
                    failure_exception: final_failure_exception
                    failure_guard: final_failure_guard
                controllerName: usecases




 

Issue: The "policies" property can be confusing with the TOSCA Topology Template value "policies".

  • Pamela Dragosh  - use "operations" instead since it really is a set of operations that are really being enforced.

Issue: How to ensure that CLAMP does not have to hard-code the meaning of properties. Specifically, success, failure, failure_timeout etc. - need to point to other actor/recipe's to be triggered/executed.

Issue: How to ensure that CLAMP does not have to hard-code where CSAR details need to be populated in the policy. Eg. Target Type

  • Need to use defaults, descriptions, constraints, required fields

  - Pam and Liam will work on Operational policies to look like Seb's JSON schema so Seb can test it out. Then identify next problem to solve.

Seb's JSON schema from El Alto:

https://gerrit.onap.org/r/gitweb?p=clamp.git;a=blob;f=src/main/resources/clds/json-schema/operational_policies/operational_policy.json;h=93738c80923be027781b9c2bf0fe72cfa82d7fec;hb=HEAD

 

Issue: TOSCA Constraints would be nice to have something with suggested values, so the policy isn't locked into a set of values. Example is "actors" - ONAP has a set of actors, but it would be nice to be able to extend to other internal actors companies support.

Code Block
# REST of policy ommitted for brevity

    onap.datatype.controlloop.operationalpolicies:
        derived_from: tosca.datatypes.Root
        version: 1.0.0
        description: Policy definitions for taking actions during a Control Loop event
        properties:
            # other properties ommitted for brevity
            actor:
                type: String
                description: The actor that will perform the operation
                required: true
				constraints:
					possible_values: [SO, SDNC, APPC, VFC, SNDR, CDS]

Issue: TOSCA does NOT have a way to relate properties together. For example, if the actor property is selected as APPC, then the contraints (eg possible values) for the operation property SHOULD be "restart", "reboot", "modifyConfig". How can that be specified?

Issue: Can/Should we consolidate onap.policies.Operational into a common policy type and then allow Drools and Apex (or be extendable to companies ingesting ONAP) to be derived_from that policy.

Question: Should the actor be a capability? If its a datatype, then you cannot pre-define them. A capability type would allow us to predefine actors as well as allow companies that ingest ONAP to create their own.

 

Question: How does CLAMP call CDS API for blueprint information? to be filled in

TODO: Pam add examples.

Question: If CSAR is prepopulated with datatypes and policytypes, how would one design a PNF control loop? Do we need a PNF service distributed to it to "kick off"?


 

  • Possible to have re-usable Operations?
  • Issue: Flat structure vs Nested structure
  • Issue: We should define the incoming event that triggers the Control Loop Pamela Dragosh will add this definition
    • Current ControlLoopEvent structure
    • Future possible VES Events
    • Possible that status of a policy execution may need to be an event for reusable operations
  • Issue: Should it be capability_type or relationship for the Actor operations??
  • Liam Fallon  and Ram Krishna Verma will look into Apex Operational Policy. 
  • Issue: Can we specify the guard policies into the operational policies? Do we make guard optional in policy operational directive executive? How to make it available to all PDP engines?
  • Issue: Other policies needed such as is-closed-loop-disable=true and prov_status=in-maint: 
    Jira
    serverONAP JIRA
    serverId425b2b0a-557c-3c0c-b515-579789cceedb
    keyPOLICY-1071
  • Issue: A&AI how to specify which VNF to take directive on. What about PNF?


 

  • Could switch to where a selection of the operation constrains the actor.
    • Instead of specify BOTH actor and operation, select an operation and then the actor supported by the operation.


 Issue: Policies and Reusable Operations Action Item Follow up - Jorge Hernandez

A nested policy approach has the following issues:

  1. Number of hierarchical layers, which must be bounded.   The CLAMP GUI driven by an open ended "recursive" schema would have to be bounded.    One could argue that after N hierarchical layers, the information would be hard to be tracked by a human operator.
  2. Associated with the number of hierarchical layers, and the most important issue is the duplication of operations, as duplicated operations would be repeated at multiple levels, and branches. 
  3. Associated with (2), there are issues of conciseness and human readability of policies. 
  4. A smaller issue relates to the storage space in the policy repository as it would likely require more space due to dups operations across levels.
  5. A smaller issue relates to come up with canonical representation of policies and operations, policies will have to be flattened out and put in a canonical representation to support static analysis on the policy repo, for example for conflict detection.

The main benefits for nested operations over a flat structure are:

  1. Clearly drive the GUI display and the user input (may be more intuitive), and
  2. if the operations are fairly simple (policies mono-operational) which is the high runner case at this time (minimum duplication).


 

  • Recommendation is to stay with the flat structure previously used vs nested. Not ideal but use description field as a way of instructing the user on what values to put in the fields.
  • Determined that we need a catalog for actors/operations and what target they work on

 

Actor Catalog needs to capture this information:

Code Block
catalog:
    appc:
        ModifyConfig: [VNF]
    appclcm:
        ModifyConfig: [VNF]
        Restart: [VNF]
        Rebuild: [VNF]
        Migrate: [VNF]
    so:
        VF Module Create: [VFModule]
        VF Module Delete: [VFModule]
    cds:
        ModifyConfig: [VNF, PNF]
    sdnc:
        reroute: [VNF]
        BandwidthOnDemand: [VNF]
    sdnr:
        ModifyConfig: [PNF]
    vfc:
        Restart: [VNF]


Proposal is to use "metadata" field in order to instruct CLAMP on where to lookup actor information and how to apply logic around looking up information in the CSAR for actor/operationIssue: Can/Should we consolidate onap.policies.Operational into a common policy type and then allow Drools and Apex (or be extendable to companies ingesting ONAP) to be derived_from that policy.