...
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.ControlLoopDefinition:properties: version elements: 1.0.0 type:- org.onap.policydomain.clamp.controlloop.ControlLoop type_version: gentleguidance.KubernetesControlLoopElementDefinition:1.0.10 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 - 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.gentleguidancenode_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.0 startPhase: 12 uninitializedToPassiveTimeout: 180 chart: baseUrlchartId: httpsGentleGuidance://101.10.10.10:12345/gentleguidancemicroservice 0.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 configurationEntityId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0 Guidance Microservice REST configuration properties: restSequence: provider: Ericsson - restRequestIdparticipantType: org.onap.policy.controlloop.gentleguidanceparticipant.setGentleGuidanceConfig.CreateGentleHttp:1.0.0 0 startPhase: 1 baseUrl: https://10.10.10.10:12345/gentleguidancemicroservice httpMethd: POST httpHeaders: path"Content-Type": "gentleapplication/createjson" "Accept": "application/json" body: configurationEntities: gentleLevel: veryGentle org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0: gentleType: softAndFurryconfigurationEntityId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig:1.0.0 expectedResponserestSequence: 200 - restRequestId: org.onap.policy.controlloop.gentleguidance.setGentleGuidanceConfig.CreateGuidanceCreateGentle:1.0.0 httpMethd: POST path: "guidancegentle/create" body: guidanceLevelgentleLevel: highveryGentle guidanceTypegentleType: subtlesoftAndFurry expectedResponse: 200 org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig:1.0.0: configurationEntityId- restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfigsetGentleGuidanceConfig.CreateGuidance:1.0.0 restSequence httpMethd: POST - restRequestId: org.onap.policy.controlloop.gentleguidance.updateGentleGuidanceConfig.CreateGentle:1.0.0path: "guidance/create" httpMethdbody: PUT pathguidanceLevel: "gentle/update]" high bodyguidanceType: subtle expectedResponse: 200 gentleLevel: robust 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 gentleType: hardAndGritty guidanceType: terse expectedResponse: 200 expectedResponse: 200 - restRequestId: org.onap.domainpolicy.controlloop.gentleguidance.PolicyControlLoopElementDefinition:updateGentleGuidanceConfig.CreateGuidance:1.0.0 version httpMethd: 1.0.0PUT type: org.onap.policy.clamp.controlloop.PolicyControlLoopElement type_versionpath: 1.0.1"guidance/update" description: Control loop element for the Gentle Guidance Operationalbody: Policy properties: providerguidanceLevel: Ericssonlow participantType: org.onap.policy.controlloop.participant.Policy:1.0.0 startPhaseguidanceType: 0terse policyType: onap.policies.controlloop.operational.common.Apex:1.0.0 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: 0 policyType: onap.policies.controlloop.operational.common.Apex:1.0.0 startPhasepolicyId: org.onap.domain.gentleguidance.policy.GentleGuidanceAssertive:1.0.0 cdsBlueprint: "Placeholder for the CDS 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: 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
...