Versions Compared

Key

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

...

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:
    type: onap.policies.controlloop.Operational
    version: 1.0.0
    description: Operational Policy for Control Loop execution



    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
        abatement:
            type: boolean
            description: Whether an abatement will be expected for the control loop.
            required: true
            default: false
        triggerOperation:
            type: string
            description: Id of the operation to be triggered when receiving an Onset event
            required: true
        operations:
            type: list
            description: List of operations executed upon receiving an Onset event for the Control Loop.
            required: true
            entry_schema:
                type: onap.datatype.controlloop.operational policies
data_types:
    onap.datatype.controlloop.targettypes:
        derived_from: tosca.datatypes.Root
        version: 1.0.0
        description: Definition of the target type for operations during control loops
        properties:
            target:
                type: String
                description: The type target the operation is performed against.
                required: true
                constraints:
                    valid_values: [VNF, VM, VNFC, VFMODULE]
            resources:
                type: String
                description: |
                    The resource in which the operation is be performed against. By default,
                    an onset event will contain resource identification which should be used
                    for the operation (if applicable) if this field is missing.
    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:
            id:
                type: String
                description: ID for the policy. Used by triggerPolicy and final_* events to indicate next policy to enforce.
                required: true
            description:
                type: String
                description: A user-friendly description of the policy
                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:
                description: The target this operation is performed against
                required: true
                entry_schema:
                    type: onap.datatype.controlloop.targettypes
            payload:
                type: Map
                description:
                required: false
                entry_schema:
                    type: String
            timeout:
                type: Integer
                description: The amount of time for the actor to perform the operation.
                required: true
            success: 
                type: String
                description: Points to the operation to invoke on success.
                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:
                type: String
                description: Points to the operation to invoke when the time out for the operation occurs.
                required: false
                default: final_failure_timeout
            failure_retries:
                type: String
                description: Points to the operation to invoke when the current operation has exceeded its max retries.
                required: false
                default: final_failure_retries
            failure_exception: 
                type: String
                description: Points to the operation to invoke when the current operation causes an exception.
                required: false
                default: final_failure_exception
            failure_guard: 
                type: String
                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
languageyml
titleExample Policy
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_0_0
topology_template:
   policies:
      -
        operational.scaleout:
           type: onap.policies.controlloop.Operational
           version: 1.0.0
           metadata:
             policy-id: operational.scaleout
           properties:
             controlLoop:
               version: 2.0.0
               controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
               trigger_policytriggerOperation: unique-policy-id-1-scale-up
               timeout: 1200
               abatement: false
             policiesoperations:
               - id: unique-policy-id-1-scale-up
                 name: Create a new VF Module
                 description:
                 actor: SO
                 recipeoperation: VF Module Create
                 target:
                   typetarget: VNF
                 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]"}]'
                 retry: 0
                 timeout: 1200
                 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

...