Warning |
---|
This page is no longer updated or kept current. For Istanbul, please see the ONAP documentation For Jakarta, please see Defining Control Loops in TOSCA for CLAMP (Jakarta) |
...
...
The TOSCA concepts above may be declared in the TOSCA Service Template of a control loop. If the concepts already exist in the Design Time Catalogue or the Runtime Inventory, they may be omitted from a TOSCA service template that defines a control loop type.
...
1.2.1 Policy Control Loop Element
The Policy Participant runs Policy Control Loop Elements. Each Policy Control Loop Element manages the deployment of the policy specified in the Policy Control Loop Element definition. The Yaml file that holds the <INSERT LINK HERE WHEN IT IS MERGED> Policy Control Loop Element Type definition is available in Github and is the canonical definition of the Policy Control Loop Element type. For a description of the Policy Control Loop Element and Policy Participant, please see The CLAMP Policy Framework Participant page.
...
The HTTP Participant runs HTTP Control Loop Elements. Each HTTP Control Loop Element manages REST communication towards a REST endpoint using the REST calls a user has specified in the configuration of the HTTP Control Loop Element. The Yaml file that holds the <INSERT LINK HERE WHEN IT IS MERGED> HTTP Control Loop Element Type definition is available in Github and is the canonical definition of the HTTP Control Loop Element type. For a description of the HTTP Control Loop Element and HTTP Participant, please see The CLAMP HTTP Participant page.
...
The Kubernetes Participant runs Kubernetes Control Loop Elements. Each Kubernetes Control Loop Element manages a Kubernetes microservice using Helm. The user defines the Helm chart for the Kubernetes microservice as well as other properties that the microservice requires in order to execute. The Yaml file that holds the <INSERT LINK HERE WHEN IT IS MERGED> Kubernetes Control Loop Element Type defintion is available in Github and is the canonical definition of the Kubernetes Control Loop Element type. For a description of the Kubernetes Control Loop Element and Kubernetes Participant, please see The CLAMP Kubernetes Participant page.
1.2.4 CDS Control Loop Element
...
2 Common and Instance Specific Properties
Properties are used to define the configuration for Control Loops and Control Loop Elements. Each CDS Control Loop Element manages the deployment of the CDS blueprint specified in the CDS Control Loop Element definition. The Yaml file that holds the <INSERT LINK HERE WHEN IT IS MERGED> is available in Github and is the canonical definition of the CDS Control Loop Element type. For a description of the CDS Control Loop Element and CDS Participant, please see The CLAMP CDS Participant page.
1.2.5 DCAE Participant
The DCAE Participant runs DCAE Control Loop Elements. Each DCAE Control Loop Element manages a DCAE microservice on DCAE. The user defines the DCAE blueprint for the DCAE microservice as well as other properties that the microservice requires in order to execute. The Yaml file that holds the <INSERT LINK HERE WHEN IT IS MERGED> is available in Github and is the canonical definition of the DCAE Control Loop Element type. For a description of the DCAE Control Loop Element and DCAE Participant, please see The CLAMP DCAE Participant page.
2 Common and Instance Specific Properties
Properties are used to define the configuration for Control Loops and Control Loop Elements. At design time, the types, constraints, and descriptions of the properties are specified. The values for properties are specified in the CLAMP GUI at runtime. TOSCA provides support fir defining properties, see Section 3.6.10: TOSCA Property Definition in the TOSCA documentation.
2.1 Terminology for Properties
Property: Metadata defined in TOSCA that is associated with a Control Loop, a Control Loop Element, or a Participant.
TOSCA Property Type: The TOSCA definition of the type of a property. A property can have a generic type such as string or integer or can have a user defined TOSCA data type.
TOSCA Property Value: The value of a Property Type. Property values are assigned at run time in CLAMP.
Common Property Type: Property Types that apply to all instances of a Control Loop Type.
Common Property Value: The value of a Property Type. It is assigned at run time once for all instances of a Control Loop Type.
Instance Specific Property Type: Property Types that apply to an individual instance of a Control Loop Type.
Instance Specific Property Value: The value of a Property Type that applies to an individual instance of a Control Loop Type. The value is assigned at run time for each control loop instance.
...
language | yml |
---|
...
At design time, the types, constraints, and descriptions of the properties are specified. The values for properties are specified in the CLAMP GUI at runtime. TOSCA provides support for defining properties, see Section 3.6.10: TOSCA Property Definition in the TOSCA documentation.
2.1 Terminology for Properties
Property: Metadata defined in TOSCA that is associated with a Control Loop, a Control Loop Element, or a Participant.
TOSCA Property Type: The TOSCA definition of the type of a property. A property can have a generic type such as string or integer or can have a user defined TOSCA data type.
TOSCA Property Value: The value of a Property Type. Property values are assigned at run time in CLAMP.
Common Property Type: Property Types that apply to all instances of a Control Loop Type.
Common Property Value: The value of a Property Type. It is assigned at run time once for all instances of a Control Loop Type.
Instance Specific Property Type: Property Types that apply to an individual instance of a Control Loop Type.
Instance Specific Property Value: The value of a Property Type that applies to an individual instance of a Control Loop Type. The value is assigned at run time for each control loop instance.
Code Block | ||
---|---|---|
| ||
startPhase: type: integer required: false constraints: - greater-or-equal: 0 description: A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and first start phase is zero. Control Loopstopped Elementssimultaneously are started inmetadata: their start_phase order and stoppedcommon: in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously metadata: common: true |
The "common: true" value in the metadata of the startPhase property identifies that property as being a common property. This property will be set on the CLAMP GUI during control loop commissioning.
Code Block | ||
---|---|---|
| ||
# Definition that omits the common flag metadata
policyType:
type: onap.datatypes.ToscaConceptIdentifier
required: true
# Definition that specifies the common flag metadata
policyType:
type: onap.datatypes.ToscaConceptIdentifier
required: true
metadata:
common: false |
...
true
|
The "common: true" value in the metadata of the startPhase property identifies that property as being a common property. This property will be set on the CLAMP GUI during control loop commissioning.
Code Block | ||
---|---|---|
| ||
# Definition that omits the common flag metadata
chart:
type: org.onap.datatypes.policy.clamp.controlloop.kubernetesControlLoopElement.Chart
typeVersion: 1.0.0
description: The helm chart for the microservice
required: true
# Definition that specifies the common flag metadata
chart:
type: org.onap.datatypes.policy.clamp.controlloop.kubernetesControlLoopElement.Chart
typeVersion: 1.0.0
description: The helm chart for the microservice
required: true
metadata:
common: false |
The "common: false" value in the metadata of the chart property identifies that property as being an instance specific property. This property will be set on the CLAMP GUI during control loop instantiation.A
3. Writing a Control Loop
...
Applications can be a DCAE microservice, an operational policy, or any other application as long as it can be modeled, and the targeted ecosystem to has a participant client waiting for the event distributions from CLAMP via DMaaP Message Router.
Warning |
---|
Updated for Istanbul to this point, the material below may or may not be correct. |
1. Control Loop TOSCA file definition
1.1 Control Loop Component Definition
A Control Loop Component that can be part of a control loop, it defines the components that partake in a control loop, and are implemented at run time by participants. The control loop component definition is truly dynamic and, as long as the participant that the control loop component definition relates to understands its definition, it can be anything. However, we have designed a base control loop component attribute that's generic and that can act as a good starting point.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
node_types:
org.onap.CL_Component:
properties:
component_name:
type: string
description: Human readable name for the component.
required: true
provider:
type: string
description: Provider of the component and of the descriptor.
required: true
component_version:
type: string
description: Software version of the component.
required: true
resource_id:
type: string
description: >The ID of the resource,
should be provided if the resource was uploaded to the entity's inventory already.
required: false
resource_content:
type: string
description: the contents of the component resource, to be uploaded during commssioning phase of loop.
required: false
monitoring_policy:
type: string
description: A reference to the monitoring policy if applicable.
required: false
version: 0.0.1
derived_from: tosca.nodes.Root |
1.2 Loop Definition
The loop definition is explicit in the node_templates
within the topology_template
, a Control Loop node template is specified and any node template specified in the Control Loop node template is part of the control loop managed by CLAMP.
...
Type Definition
The TOSCA definition of a control loop contains a TOSCA Node Template for the control loop itself, which contains TOSCA Node Templates for each Control Loop Element that makes up the Control Loop.
Drawio | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
To create a control loop, a user creates a TOSCA Topology Template. In the Topology Template, the user creates a TOSCA Node Template for each Control Loop Element that will be in the Control Loop Definition. Finally, the user creates the Node Template that defines the Control Loop itself, and references the Control Loop Element definitions that make up the Control Loop Definition.
3.1 The Gentle Guidance Control Loop
The best way to explain how to create a Control Loop Definition is by example.
Drawio | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The example Gentle Guidance control loop is illustrated in the diagram above. The domain logic for the control loop is implemented in a microservice running in Kubernetes, a policy, and some configuration that is passed to the microservice over a REST endpoint. We want to manage the life cycle of the domain logic for our Gentle Guidance control loop using our TOSCA based Control Loop Life Cycle Management approach. To do this we create four Control Loop Element definitions, one for the Kubernetes microservice, one for the policy and one or the REST configuration.
3.2 The TOSCA Control Loop Definition
We use a TOSCA Topology Template to specify a Control Loop definition and the definitions of its Control Loop Elements. Optionally, we can specify default parameter values in the TOSCA Topology Template. The actual values of Control Loop common and instance specific parameters are set at run time in the CLAMP GUI.
In the case of the Gentle Guidance control loop, we define a Control Loop Element Node Template for each part of the domain logic we are managing. We then define the Control Loop Node Template for the control loop itself.
The code fragment below shows the TOSCA Topology Template for the Gentle Guidance domain when no parameters are defined. Please refer to the Yaml file in Github for the definitive Yaml specification.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
node_templates:
org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition:
version: 1.0.0
type: org.onap.policy.clamp.controlloop.KubernetesControlLoopElement
type_version: 1.0.1
description: Control loop element for the Gentle Guidance Kubernetes Microservice
org.onap.domain.gentleguidance.RestControlLoopElementDefinition:
version: 1.0.0
type: org.onap.policy.clamp.controlloop.HttpControlLoopElement
type_version: 1.0.1
description: Control loop element for the Gentle Guidance Microservice REST configuration
org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:
version: 1.0.0
type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement
type_version: 1.0.1
description: Control loop element for the Gentle Guidance Operational Policy
blueprint
org.onap.domain.gentleguidance.ControlLoopDefinition:
version: 1.0.0
type: org.onap.policy.clamp.controlloop.ControlLoop
type_version: 1.0.1
description: Control loop definition for the Gentle Guidance domain
properties:
elements:
- org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition:1.0.0
- org.onap.domain.gentleguidance.RestControlLoopElementDefinition:1.0.0
- org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:1.0.0
|
The code fragment below shows the TOSCA Topology Template for the Gentle Guidance domain when the default values of parameters are defined. Please refer to the Yaml file in Github for the definitive Yaml specification.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
tosca_definitions_version: tosca_simple_yaml_1_3 datatopology_typestemplate: onap.datatypes.ToscaConceptIdentifiernode_templates: derived_from: tosca.datatypes.Root propertiesorg.onap.domain.gentleguidance.KubernetesControlLoopElementDefinition: nameversion: 1.0.0 type: stringorg.onap.policy.clamp.controlloop.KubernetesControlLoopElement requiredtype_version: true1.0.1 versiondescription: Control loop element for the Gentle Guidance Kubernetes type:Microservice string properties: required provider: true node_types:Ericsson participantType: org.onap.policy.clampcontrolloop.controlloop.Participant: version: participant.Kubernetes:1.0.10 derived_from: tosca.nodetypes.Root startPhase: 2 properties: provideruninitializedToPassiveTimeout: 180 type chart: string requred: false chartId: orgGentleGuidance:1.onap.policy.clamp.controlloop.ControlLoopElement:0.0 version: 1.0.1 derived_from: tosca.nodetypes.Root releaseName: Istanbul properties: provider: namespace: org.onap.policy.controlloop.gentleguidance typeorg.onap.domain.gentleguidance.RestControlLoopElementDefinition: string requredversion: false1.0.0 participant_id: type: onap.datatypes.ToscaConceptIdentifier requred: true type: org.onap.policy.clamp.controlloop.ControlLoop:HttpControlLoopElement type_version: 1.0.1 derived_fromdescription: tosca.nodetypes.RootControl loop element for the properties:Gentle Guidance Microservice REST configuration provider: properties: type: string provider: Ericsson requred: falseparticipantType: org.onap.policy.controlloop.participant.Http:1.0.0 elementsstartPhase: 1 typebaseUrl: listhttps://10.10.10.10:12345/gentleguidancemicroservice requiredhttpHeaders: true entry_schema:"Content-Type": "application/json" type: onap.datatypes.ToscaConceptIdentifier org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement:"Accept": "application/json" versionconfigurationEntities: 1.0.1 derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement properties.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0: dcae_blueprint_id: type: onap.datatypes.ToscaConceptIdentifierconfigurationEntityId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0 requred: true org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElement:restSequence: version: 1.0.1 - derived_fromrestRequestId: org.onap.policy.clamp.controlloop.ControlLoopElementcontrolloop.gentleguidance.setGentleGuidanceConfig.CreateGentle:1.0.0 properties: policy_type_idhttpMethd: POST type: onap.datatypes.ToscaConceptIdentifier path: "gentle/create" requred: true org.onap.policy.clamp.controlloop.CDSControlLoopElement: version: 1.0.1 body: derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement properties: cds_blueprint_id:gentleLevel: veryGentle type: onap.datatypes.ToscaConceptIdentifier gentleType: softAndFurry requred: true topology_template: node_templates: org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipantexpectedResponse: 200 version: 2.3.4 - typerestRequestId: org.onap.policy.clamp.controlloop.Participantcontrolloop.gentleguidance.setGentleGuidanceConfig.CreateGuidance:1.0.0 type_version: 1.0.1 descriptionhttpMethd: ParticipantPOST for DCAE microservices properties: path: "guidance/create" provider: ONAP org.onap.policy.controlloop.MonitoringPolicyControlLoopParticipant: body: version: 2.3.1 type: org.onap.policy.clamp.controlloop.Participant type_versionguidanceLevel: 1.0.1high description: Participant for DCAE microservices propertiesguidanceType: subtle provider: ONAP expectedResponse: 200 org.onap.policy.controlloop.OperationalPolicyControlLoopParticipantgentleguidance.updateGentleGuidanceConfig:1.0.0: version: 3.2.1 typeconfigurationEntityId: org.onap.policy.clampcontrolloop.controlloop.Participant type_version: gentleguidance.updateGentleGuidanceConfig:1.0.10 description: Participant for DCAE microservices restSequence: properties: - providerrestRequestId: ONAP org.onap.policy.ccsdkcontrolloop.cdsgentleguidance.controlloopupdateGentleGuidanceConfig.CdsControlLoopParticipantCreateGentle:1.0.0 version: 2.2.1 typehttpMethd: org.onap.policy.clamp.controlloop.ParticipantPUT type_version: 1.0.1 descriptionpath: Participant for DCAE microservices"gentle/update]" properties: body: provider: ONAP org.onap.domain.pmsh.PMSH_DCAEMicroservice: versiongentleLevel: 1.2.3robust type: org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement type_version: 1.0.0 gentleType: hardAndGritty description: Control loop element for the DCAE microservice for Performance Management Subscription Handling expectedResponse: 200 properties: - providerrestRequestId: Ericssonorg.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGuidance:1.0.0 participant_id: httpMethd: PUT name: org.onap.dcae.controlloop.DCAEMicroserviceControlLoopParticipant versionpath: 2.3.4"guidance/update" dcae_blueprint_id: body: name: org.onap.dcae.blueprints.PMSHBlueprint version: 1.0.0guidanceLevel: low guidanceType: terse expectedResponse: 200 org.onap.domain.pmshgentleguidance.PMSH_MonitoringPolicyControlLoopElementPolicyControlLoopElementDefinition: version: 1.20.30 type: org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElementPolicyControlLoopElement type_version: 1.0.01 description: Control loop element for the monitoringGentle policyGuidance forOperational PerformancePolicy Management Subscription Handling properties: provider: Ericsson participant_idparticipantType: name: org.onap.policy.controlloop.PolicyControlLoopParticipantparticipant.Policy:1.0.0 versionstartPhase: 2.3.10 policy_type_id: policyType: onap.policies.controlloop.operational.common.Apex:1.0.0 namepolicyId: org.onap.policiesdomain.gentleguidance.monitoring.pm-subscription-handler version: policy.GentleGuidanceAssertive:1.0.0 org.onap.domain.pmshgentleguidance.PMSH_OperationalPolicyControlLoopElementControlLoopDefinition: version: 1.20.30 type: org.onap.policy.clamp.controlloop.PolicyTypeControlLoopElementControlLoop type_version: 1.0.01 description: Control loop elementdefinition for the operationalGentle policyGuidance fordomain Performance Management Subscription Handling properties: provider: Ericsson participant_idelements: - name: org.onap.policydomain.controlloop.PolicyControlLoopParticipant version: 2.3.1gentleguidance.KubernetesControlLoopElementDefinition:1.0.0 policy_type_id: name: onap.policies.operational.pm-subscription-handler- org.onap.domain.gentleguidance.RestControlLoopElementDefinition:1.0.0 version: 1.0.0 org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement: version: 1.2.3 type: org.onap.policy.clamp.controlloop.ControlLoopElement type_version: 1.0.0 description: Control loop element for CDS for Performance Management Subscription Handling properties: provider: Ericsson participant_Id: name: org.onap.ccsdk.cds.controlloop.CdsControlLoopParticipant version: 3.2.1 cds_blueprint_id: name: org.onap.ccsdk.cds.PMSHCdsBlueprint version: 1.0.0 org.onap.domain.pmsh.PMSHControlLoopDefinition: version: 1.2.3 type: org.onap.policy.clamp.controlloop.ControlLoop type_version: 1.0.0 description: Control loop for Performance Management Subscription Handling properties: provider: Ericsson elements: - name: org.onap.domain.pmsh.PMSH_DCAEMicroservice version: 1.2.3 - name: org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement version: 1.2.3 - name: org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement version: 1.2.3 - name: org.onap.domain.pmsh.PMSH_CDS_ControlLoopElement version: 1.2.3 |
2.2: Modelling from TOSCA to Commissioned Data in Run Time Inventory
...
- org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:1.0.0
|
4. Creating Custom Control Loop Elements
Any organization can include their own component in the framework and use the framework and have the Policy Framework CLAMP manage the lifecycle of domain logic in their component as part of a Control Loop. To do this, a participant for the component must be developed that allows Control Loop Elements for that component to be run. To develop a participant, the participant must comply with the CLAMP Participants framework and in particular comply with The CLAMP Automation Composition Participant Protocol. The organization must also specify a new Control Loop Element type definition in TOSCA similar to those supplied in ONAP and described in Section 1.2. This Control Loop Element type tells the CLAMP Control Loop Lifecycle management that the Control Loop Element exists and can be included in control loops. It also specifies the properties that can be specified for the Control Loop Element.
An organization can supply the code for the Participant (for example as a Java jar file) and a TOSCA artifact with the Control Loop Element definition and it can be added to the platform. In future releases, support will be provided to include participants and their Control Loop Element definitions as packaged plugins that can be installed on the platform.