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 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 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
The CDS Participant runs CDS 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 CDS Control Loop Element Type definition 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.
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 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.
...
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 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 all instances an individual instance of a Control Loop Type.
Common Instance Specific 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 that applies to an individual instance of a Control Loop Type. The value is assigned at run time for each control loop instance.
...
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.
...
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, a CDS blueprint, 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 , one for the CDS blueprint and one or the REST configuration.
...
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.CdsControlLoopElementDefinitionControlLoopDefinition: version: 1.0.0 type: org.onap.policy.clamp.controlloop.CDSControlLoopElementControlLoop type_version: 1.0.1 description: Control loop elementdefinition for the Gentle Guidance CDSdomain blueprint org.onap.domain.gentleguidance.ControlLoopDefinitionproperties: version elements: 1.0.0 type:- org.onap.domain.policygentleguidance.clampKubernetesControlLoopElementDefinition:1.controlloop.ControlLoop0.0 type_version: - org.onap.domain.gentleguidance.RestControlLoopElementDefinition:1.0.10 description: Control loop definition for the Gentle Guidance domain properties: elements: - org.- org.onap.domain.gentleguidance.KubernetesControlLoopElementDefinitionPolicyControlLoopElementDefinition:1.0.0 - org.onap.domain.gentleguidance.RestControlLoopElementDefinition:1.0.0 - org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition:1.0.0 - org.onap.domain.gentleguidance.CdsControlLoopElementDefinition: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
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
properties:
provider: Ericsson
participantType: org.onap.policy.controlloop.participant.Kubernetes:1.0.0
startPhase: 2
uninitializedToPassiveTimeout: 180
chart:
chartId: GentleGuidance:1.0.0
releaseName: Istanbul
namespace: org.onap.policy.controlloop.gentleguidance
|
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 topology_template: node_templates: org.onap.domain.gentleguidance.RestControlLoopElementDefinitionKubernetesControlLoopElementDefinition: version: 1.0.0 type: org.onap.policy.clamp.controlloop.HttpControlLoopElementKubernetesControlLoopElement type_version: 1.0.1 description: Control loop element for the Gentle Guidance Kubernetes Microservice REST configuration properties: provider: Ericsson participantType: org.onap.policy.controlloop.participant.HttpKubernetes:1.0.00 startPhase: 2 uninitializedToPassiveTimeout: 180 startPhasechart: 1 baseUrlchartId: httpsGentleGuidance://101.10.10.10:12345/gentleguidancemicroservice0.0 httpHeaders: releaseName: Istanbul "Content-Type": "application/json" namespace: org.onap.policy.controlloop.gentleguidance "Accept": "application/json" org.onap.domain.gentleguidance.RestControlLoopElementDefinition: configurationEntitiesversion: 1.0.0 type: org.onap.policy.clamp.controlloop.gentleguidance.setGentleGuidanceConfig:HttpControlLoopElement type_version: 1.0.0:1 description: Control loop element for the Gentle Guidance Microservice configurationEntityId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0REST configuration properties: restSequence: provider: Ericsson - restRequestIdparticipantType: org.onap.policy.controlloop.gentleguidanceparticipant.setGentleGuidanceConfig.CreateGentleHttp:1.0.0 startPhase: 1 httpMethd: POST baseUrl: https://10.10.10.10:12345/gentleguidancemicroservice httpHeaders: path"Content-Type": "gentleapplication/createjson" body:"Accept": "application/json" configurationEntities: gentleLevel: veryGentle org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0: gentleType: softAndFurryconfigurationEntityId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0 expectedResponse: 200restSequence: - restRequestId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig.CreateGuidanceCreateGentle:1.0.0 httpMethd: POST path: "guidancegentle/create" body: guidanceLevel: high gentleLevel: veryGentle guidanceType: subtle gentleType: softAndFurry expectedResponse: 200 org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0:expectedResponse: 200 - configurationEntityIdrestRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfigsetGentleGuidanceConfig.CreateGuidance:1.0.0 restSequencehttpMethd: POST - restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGentle:1.0.0path: "guidance/create" httpMethdbody: PUT pathguidanceLevel: "gentle/update]"high bodyguidanceType: subtle gentleLevel: robustexpectedResponse: 200 org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0: gentleTypeconfigurationEntityId: hardAndGrittyorg.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0 expectedResponserestSequence: 200 - restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGuidanceCreateGentle:1.0.0 httpMethd: PUT path: "guidancegentle/update]" body: guidanceLevelgentleLevel: lowrobust guidanceTypegentleType: tersehardAndGritty expectedResponse: 200 org.onap.domain.gentleguidance.PolicyControlLoopElementDefinition: - versionrestRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGuidance:1.0.0 type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement type_version: 1.0.1 httpMethd: PUT description: Control loop element for the Gentle Guidance Operational Policy path: "guidance/update" properties: providerbody: Ericsson participantType: org.onap.policy.controlloop.participant.Policy:1.0.0 guidanceLevel: low startPhase: 0 policyType: onap.policies.controlloop.operational.common.Apex:1.0.0 guidanceType: terse policyIdexpectedResponse: org.onap.domain.gentleguidance.policy.GentleGuidanceAssertive:1.0.0200 org.onap.domain.gentleguidance.CdsControlLoopElementDefinitionPolicyControlLoopElementDefinition: version: 1.0.0 type: org.onap.policy.clamp.controlloop.CDSControlLoopElementPolicyControlLoopElement type_version: 1.0.1 description: Control loop element for the Gentle Guidance CDSOperational blueprintPolicy properties: provider: Ericsson participantType: org.onap.policy.controlloop.participant.CdsPolicy:1.0.0 startPhase: startPhase: 0 policyType: onap.policies.controlloop.operational.common.Apex:1.0.0 cdsBlueprint: "Placeholder for the CDS blueprint"policyId: org.onap.domain.gentleguidance.policy.GentleGuidanceAssertive:1.0.0 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: provider: Ericsson 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 - org.onap.domain.gentleguidance.CdsControlLoopElementDefinition: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 Control Loop 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.
...