The CLAMP Control Loop Automation Composition Participant protocol is an asynchronous protocol that is used by the CLAMP runtime to coordinate life cycle lifecycle management of Control Loop Automation Composition instances. The protocol supports the functions described in the sections below.
Table of Contents |
---|
Protocol Dialogues
The protocol supports the dialogues described below.
Participant Registration and De-Registration
Registration when a participant comes up and update of participant with control loop Automation Composition type information and common parameter values for its control loop Automation Composition types.
PlantUML Macro |
---|
@startuml activate Participant Participant -> Participant: Start Participant deactivate Participant Participant -> CLAMP_Runtime: Participant Registration Participant <- CLAMP_Runtime: Participant Registration Ack activate CLAMP_Runtime loop over ControlAutomation LoopComposition Type Definitions CLAMP_Runtime -> CLAMP_Runtime: Collect ControlAutomation LoopComposition Element Type Definitions and\nCommon Property Values for\nParticipant Type of this Participant end deactivate CLAMP_Runtime Participant <- CLAMP_Runtime: Participant Update\n[ControlAutomation LoopComposition Element Type Definitions and\nCommon Property Values for\nParticipant Type of Participant] activate Participant Participant -> Participant: Store ControlAutomation LoopComposition Element Type Definitions and\nCommon Property Values Participant -> CLAMP_Runtime: Participant Update Ack deactivate Participant |
...
PlantUML Macro |
---|
@startuml Participant -> CLAMP_Runtime: Participant Deregistration Participant <- CLAMP_Runtime: Participant Deregistration Ack Participant -> Participant: Shutdown Participant |
Control Loop Commissioning and Decommissioning
Automation Composition Priming and De-Priming
When an Automation Composition is primedWhen a control loop is commissioned, the portion of the Control Loop Automation Composition Type Definition and Common Property values for the participants of each participant type mentioned in the Control Loop Automation Composition Definition are sent to the participants.
...
PlantUML Macro |
---|
@startuml Commissioning_REST -> CLAMP_Runtime: CommissionPrime ControlAutomation LoopComposition Type DefintionDefintions and\nset values of Common Properties activate CLAMP_Runtime loop over Participant Types in ControlAutomation LoopComposition Type Definition CLAMP_Runtime -> CLAMP_Runtime: Collect ControlAutomation LoopComposition Element Type Definitions and\nCommon Property Values for Participant Type end Participant <- CLAMP_Runtime: Participant Update\n[ControlAutomation LoopComposition Element Type Definitions and\nCommon Property Values for Participant Types] deactivate CLAMP_Runtime activate Participant Participant -> Participant: Store ControlAutomation LoopComposition Element Type Definitions and\nCommon Property Values Participant -> CLAMP_Runtime: Participant Update Ack\n[from each Participant mentioned in Participant Update message] deactivate Participant |
When a control loop an Automation Composition is de-commissionedprimed, the portion of the Control Loop Automation Composition Type Definition and Common Property values for the participants of each participant type mentioned in the Control Loop Automation Composition Definition are deleted on participants.
PlantUML Macro |
---|
@startuml Commissioning_REST -> CLAMP_Runtime: DecommissionDe-Prime ControlAutomation LoopComposition Type Definition alt ControlAutomation LoopComposition Instances exist for ControlAutomation LoopComposition Type Commissioning_REST <- CLAMP_Runtime: Cannot decommission ControlAutomation LoopComposition Type Definition else No ControlAutomation LoopComposition Instances exist for ControlAutomation LoopComposition Type Participant <- CLAMP_Runtime: Participant Update\n[Remove ControlAutomation LoopComposition Element Definitions\nfrom Participants in ControlAutomation LoopComposition] activate Participant Participant -> Participant: Delete ControlAutomation LoopComposition Element\nType Definitions and\nCommon Property Values Participant -> CLAMP_Runtime: Participant Update Ack [from each Participant mentioned in Participant Update message] deactivate Participant end |
...
Automation Composition Update
Control Loop Automation Composition Update handles creation, change, and deletion of control loops Automation Compositions on participants. Change of control loops Automation Compositions uses a semantic versioning approach and follow follows the semantics described on the page TOSCA Defined Control LoopAutomation Compositions: Architecture and DesignDesign#4.1ACMVersionManagement.
PlantUML Macro |
---|
@startuml Participant <- CLAMP_Runtime: ControlAutomation LoopComposition Update\n[to all Participants in ControlAutomation LoopComposition] Participant -> CLAMP_Runtime: ControlAutomation LoopComposition Update Ack [from each Participant in ControlAutomation LoopComposition] |
The handling of a ControlLoopUpdate an ACMUpdate message in each participant is as shown below.
...
PlantUML Macro |
---|
@startuml (*) --> "Process Update Message" if "All ControlAutomation LoopComposition Elements with my Participant ID processed?" then --> [yes] "Send Update Ack Message" --> (*) else --> [no] "Process next ControlAutomation LoopComposition Element with my ID" if "New ControlAutomation LoopComposition Element?" then --> [yes] "Create ControlAutomation LoopComposition Element" --> "Set ControlAutomation LoopComposition Element to state UNINITIALISED" --> "Order Initiation of ControlAutomation LoopComposition Element" --> "Pass Parameters to ControlAutomation LoopComposition Element" --> "Wait for Initiation to complete" if "ControlAutomation LoopComposition Element Initiation?" then --> [success] "Record Success for Update Ack message" --> "Process Update Message" else --> [fail] "Delete ControlAutomation LoopComposition Element" --> "Record Error for Update Ack message" --> "Process Update Message" endif else --> [no] "Check ControlAutomation LoopComposition Element State" endif if "RUNNING and ControlAutomation LoopComposition Version change != patch?" then --> [true] "Record Error for Update Ack message" --> "Process Update Message" else [false] if "PASSIVE and ControlAutomation LoopComposition Version change == major?" then --> [true] "Record Error for Update Ack message" --> "Process Update Message" else --> [false] "Pass Changed Parameters to ControlAutomation LoopComposition Element" --> "Wait for reconfiguration to complete" if "ControlAutomation LoopComposition Element Reconfiguration?" then --> [success] "Record Success for Update Ack message" --> "Process Update Message" else --> [fail] "Roll back reconfiguration" --> "Record Error for Update Ack message" --> "Process Update Message" endif endif endif @enduml |
...
Automation Composition State Change
This dialogue is used to change the state of Control Loops Automation Compositions and their Control Loop Automation Composition Elements. the CLAMP Runtime sends a Control Loop an Automation Composition State Change message on the control loop Automation Composition to all participants. Participants that have Control Loop Automation Composition Elements in that Control Loop Automation Composition attempt an update on the state of the control loop Automation Composition elements they have for that control loopAutomation Composition, and report the result back.
PlantUML Macro |
---|
@startuml
Participant <- CLAMP_Runtime: Control Loop State Change\n[to all Participants in Control Loop]
Participant -> CLAMP_Runtime: Control Loop State Change Ack [from each Participant in Control Loop]
|
The handling of a ControlLoopStateChange message in each participant is as shown below.
The startPhase in the Definition of TOSCA fundamental Automation Composition Types is particularly important in Automation Composition state changes because sometimes the user wishes to control the order in which the state changes in Automation Composition Elements in an Automation Composition. In-state changes from UNITITIALISED → PASSIVE and from PASSIVE → RUNNING, Automation Composition elements are started in increasing order of their startPhase. In-state changes from RUNNING → PASSIVE and from PASSIVE → UNITITIALISED, Automation Composition elements are started in decreasing order of their startPhase.
The CLAMP runtime controls the state change process described in the diagram below. The CLAMP runtime sends an Automation Composition State Change message on DMaaP to all participants in a particular Start Phase so, in each state change multiple Automation Composition State Change messages are sent, one for each Start Phase in the Automation Composition. If more than one Automation Composition Element has the same Start Phase, those Automation Composition Elements receive the same Automation Composition State Change message from DMaaP and start in parallel.
The Participant reads each State Change Message it sees on DMaaP. If the Start Phase on the Automation Composition State Change message matches the Start Phase of the Automation Composition Element, the participant processes the State Change message. Otherwise, the participant ignores the message.
PlantUML Macro |
---|
@startuml
activate CLAMP_Runtime
CLAMP_Runtime -> CLAMP_Runtime: Build an ordered list of the Start Phases in the Automation Composition Instance
deactivate CLAMP_Runtime
alt "State Change UNITIALISED_to_PASSIVE or PASSIVE_to_RUNNING"
loop over Start Phases list in increasing order
CLAMP_Runtime -> Participant: Automation Composition State Change\n[to all Participants in Automation Composition with this Start Phase]
CLAMP_Runtime -> CLAMP_Runtime: Asynchronously wait for answers from Participants
CLAMP_Runtime <- Participant: Automation Composition State Change Ack [from each Participant in this Start Phase of Automation Composition]
alt "State Change Ack reports success |
PlantUML Macro |
@startuml (*) --> "Process State Change Message" if "All Control Loop Elements with my Participant ID processed?" then --> [yes] "Send State Change Ack Message" --> (*) else --> [no] "Process next Control Loop Element with my ID" if "Current State is RUNNING?" then [true] if "Change to PASSIVE?" then --> [true] "Change Control Loop Element to state PASSIVE" --> "Wait for RUNNING->PASSIVE State Change to complete" if "State Change?" then --> [success] "Record Success for Update Ack message" --> "Process State Change Message" else --> [fail] "Record Error for Update Ack message" CLAMP_Runtime --> "Process State Change Message"CLAMP_Runtime: Log success else "State endif Change Ack reports an elseerror" CLAMP_Runtime --> [false] "Record Error for Update Ack message" --> "ProcessCLAMP_Runtime: Log error CLAMP_Runtime -> CLAMP_Runtime: Reset state of Automation Composition CLAMP_Runtime -> CLAMP_Runtime: Abort State Change Message"operation end endif end else "State Change [false] if "Current State is PASSIVE?" then [true] if "Change to RUNNING?" thenRUNNING_to_PASSIVE or PASSIVE_to_UNITIALISED" loop over Start Phases list in decreasing order CLAMP_Runtime -> Participant: Automation --> [true] "Change Control Loop Element to state RUNNING" Composition State Change\n[to all Participants in Automation Composition with this Start Phase] CLAMP_Runtime --> "Wait for PASSIVE->RUNNING State Change to complete"CLAMP_Runtime: Asynchronously wait for answers from Participants CLAMP_Runtime <- Participant: Automation ifComposition "State Change?" then Ack [from each Participant in this Start Phase of --> [success] "Record Success for Update Ack messageAutomation Composition] alt "State Change Ack reports success" -CLAMP_Runtime -> "Process State Change Message"CLAMP_Runtime: Log success else "State Change Ack else reports an error" CLAMP_Runtime --> [fail] "Record Error for Update Ack message"CLAMP_Runtime: Log error -CLAMP_Runtime -> "Process State Change Message" endif elseCLAMP_Runtime: Reset state of Automation Composition CLAMP_Runtime -> CLAMP_Runtime: Abort State Change operation end -end end CLAMP_Runtime -> [CLAMP_Runtime: Set overall state of Automation Composition @enduml |
The handling of an ACMStateChange message in each participant is as shown below.
PlantUML Macro |
---|
@startuml (*)false] "Record Error for Update Ack message" --> "Process State Change Message" if "All Automation Composition Elements with endif my Participant ID processed?" elsethen --> [falseyes] "RecordSend ErrorState for UpdateChange Ack messageMessage" --> (*) else --> [no] "Process State Change Message next Automation Composition Element with my ID" if "State endif Change endif endif @enduml |
Control Loop Monitoring and Reporting
This dialogue is used as a heartbeat mechanism for participants, to monitor the status of Control Loop Elements, and to gather statistics on control loops. The ParticipantStatus message is sent periodically by each participant. The reporting interval for sending the message is configurable.
PlantUML Macro |
---|
@startuml
Participant -> CLAMP_Runtime: Participant Status [periodically from each Participant in all Control Loops]
|
Messages
The CLAMP Control Loop Participant Protocol uses the following messages. The descriptions below give an overview of each message. For the precise definition of the messages, see the CLAMP code at: https://github.com/onap/policy-clamp/tree/master/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant. All messages are carried on DMaaP.
Message Start Phase equals Automation Composition Element start phase" then
[true] if "Current State is RUNNING?" then
[true] if "Change to PASSIVE?" then
--> [true] "Change Automation Composition Element to state PASSIVE"
--> "Wait for RUNNING->PASSIVE State Change to complete"
if "State Change?" then
--> [success] "Record Success for State Change Ack message"
--> "Process State Change Message"
else
--> [fail] "Record Error for State Change Ack message"
--> "Process State Change Message"
endif
else
--> [false] "Record Error for State Change Ack message"
--> "Process State Change Message"
endif
else
[false] if "Current State is PASSIVE?" then
[true] if "Change to RUNNING?" then
--> [true] "Change Automation Composition Element to state RUNNING"
--> "Wait for PASSIVE->RUNNING State Change to complete"
if "State Change?" then
--> [success] "Record Success for State Change Ack message"
--> "Process State Change Message"
else
--> [fail] "Record Error for State Change Ack message"
--> "Process State Change Message"
endif
else
--> [false] "Record Error for State Change Ack message"
--> "Process State Change Message"
endif
else
--> [false] "Record Error for State Change Ack message"
--> "Process State Change Message"
endif
endif
else
--> [false] "Skip Automation Composition Element"
--> "Process State Change Message"
endif
@enduml
|
Automation Composition Monitoring and Reporting
This dialogue is used as a heartbeat mechanism for participants, to monitor the status of Automation Composition Elements, and to gather statistics on Automation Compositions. The ParticipantStatus message is sent periodically by each participant. The reporting interval for sending the message is configurable.
PlantUML Macro |
---|
@startuml
Participant -> CLAMP_Runtime: Participant Status [periodically from each Participant in all Automation Compositions]
|
Messages
The CLAMP Automation Composition Participant Protocol uses the following messages. The descriptions below give an overview of each message. For the precise definition of the messages, see the CLAMP code at: https://github.com/onap/policy-clamp/tree/master/models/src/main/java/org/onap/policy/clamp/ACM/models/messages/dmaap/participant. All messages are carried on DMaaP.
Message | Source | Target | Purpose | Important Fields | Field Descriptions | |
---|---|---|---|---|---|---|
ParticipantRegister | Participant | CLAMP Runtime | Participant registers with the CLAMP runtime | ParticipantId | The ID of this participant | |
ParticipantType | The type of the participant; maps to the capabilities of the participant in Automation Composition Type Definitions | |||||
ParticipantRegisterAck | CLAMP Runtime | Participant | Acknowledgment of Participant Registration | ParticipantId | The ID of this participant | |
ParticipantType | The type of the participant; maps to the capabilities of the participant in Automation Composition Type Definitions | |||||
Result | Success/Fail | |||||
Message | A message indicating the reason for failure | |||||
ParticipantUpdate | CLAMP Runtime | Participant | CLAMP Runtime sends Automation Composition Element Definitions and Common Parameter Values to Participants | ParticipantDefinitionUpdateMap | Map with Participant ID as its key, each value on the map is an ACMElementDefintionMap | |
ACMElementDefintionMap | List of ACMElementDefinition values for a particular participant, keyed by its Automation Composition Element Definition ID | |||||
ACMElementDefinition | An ACMElementToscaServiceTemplate containing the definition of the Automation Composition Element and a CommonPropertiesMap with the values of the common property values for Automation Composition Elements of this type | |||||
ACMElementToscaServiceTemplate | The definition of the Automation Composition Element in TOSCA | |||||
CommonPropertiesMap | A <String, String> map indexed by the property name. Each map entry is the serialized value of the property, which can be deserialized into an instance of the type of the property. | |||||
ParticipantUpdateAck | Participant | CLAMP Runtime | Acknowledgment of Participant Update | ParticipantId | The ID of this participant | |
ParticipantType | The type of the participant; maps to the capabilities of the participant in Automation Composition Type Definitions | |||||
Result | Success/Fail | |||||
Message | A message indicating the reason for failure | |||||
ParticipantDeregister | Participant | CLAMP Runtime | Participant deregisters with the CLAMP runtime | ParticipantId | The ID of this participant | |
ParticipantType | The type of the participant; maps to the capabilities of the participant in Automation Composition Type Definitions | |||||
ParticipantDeregisterAck | CLAMP Runtime | Participant | Acknowledgment of Participant Deregistration | ParticipantId | The ID of this participant | |
ParticipantType | The type of the participant; maps to the capabilities of the participant in Automation Composition Type Definitions | |||||
Result | Success/Fail | |||||
Message | A message indicating the reason for failure | |||||
ACMUpdate | CLAMP Runtime | Participant | CLAMP Runtime sends Automation Composition Element instances and Instance Specific Parameter Values for an Automation Composition Instance to Participants | ACMId | The name and version of the Automation Composition | |
ParticipantUpdateMap | Map with Participant ID as its key, each value on the map is an ACMElementList | |||||
ACMElementList | List of ACMElement values for the Automation Composition | |||||
ACMElement | An ACMElement, which contains among other things a PropertiesMap with the values of property values for this Automation Composition Element instance and a ToscaServiceTemplateFragment with extra concept definitions and instances that a participant may need. | |||||
PropertiesMap | A <String, String> map indexed by the property name. Each map entry is the serialized value of the property, which can be deserialized into an instance of the type of the property. | |||||
ToscaServiceTemplateFragment | A well-formed TOSCA service template containing extra concept definitions and instances that a participant may need. For example, the Policy Participant may need policy type definitions or policy instances to be provided if they are not already stored in the Policy Framework. | |||||
ACMUpdateAck | Participant | CLAMP Runtime | Acknowledgment of Automation Composition Update | ParticipantId | The ID of this participant | |
ParticipantType | The type of the participant; maps to the capabilities of the participant in Automation Composition Type Definitions | |||||
ACMId | The name and version of the Automation Composition | |||||
ACMResult | Holds a Result and Message for the overall operation on the participant and a map of Result and Message fields for each Automation Composition Element of the Automation Composition on this participant | |||||
Result | Success/Fail | |||||
Message | A message indicating the reason for failure | |||||
ACMStateChange | CLAMP Runtime | Participant | CLAMP Runtime asks Participants to change the state of an Automation Composition | ACMId | The name and version of the Automation Composition | |
currentState | The current state of the Automation Composition | |||||
orderedState | The state that the Automation Composition should transition to | |||||
startPhase | The start phase to which this ACMStateChange message applies | |||||
ACMStateChangeAck | Participant | CLAMP Runtime | ||||
Message | Source | Target | Purpose | Important Fields | Field Descriptions | |
ParticipantRegister | Participant | CLAMP Runtime | Participant registers with the CLAMP runtime | ParticipantId | The ID of this participant | ParticipantType | The type of the participant, maps to the capabilities of the participant in Control Loop Type Definitions | ParticipantRegisterAckCLAMP Runtime | Participant | Acknowledgement of Participant RegistrationParticipantId | The ID of this participant |
ParticipantType | The type of the participant, maps to the capabilities of the participant in Control Loop Type Definitions | |||||
Result | Success/Fail | |||||
Message | Message indicating reason for failure | ParticipantUpdate | CLAMP Runtime | Participant | CLAMP Runtime sends Control Loop Element Definitions and Common Parameter Values to Participants | ParticipantDefinitionUpdateMap |
ControlLoopElementDefintionList | List of ControlLoopElementDefinition values for a particular participant | |||||
ControlLoopElementDefinition | A ControlLoopElementToscaServiceTemplate containing the definition of the Control Loop Element and a CommonPropertiesMap with the values of the common property values for Control Loop Elements of this type | |||||
ControlLoopElementToscaServiceTemplate | The definition of the Control Loop Element in TOSCA | |||||
CommonPropertiesMap | A <String, String> map indexed by the property name. Each map entry is the serialized value of the property, which can be deserialized into an instance of the type of the property. | ParticipantId | The ID of this participant | |||
ParticipantType | The type of the participant, maps to the capabilities of the participant in Control Loop Type Definitions | |||||
Result | Success/Fail | |||||
Message | Message indicating reason for failure | |||||
ParticipantDeregister | Participant | CLAMP Runtime | Participant deregisters with the CLAMP runtimeAcknowledgment of Automation Composition State Change | ParticipantId | The ID of this participant | |
ParticipantType | The type of the participant, ; maps to the capabilities of the participant in Control Loop Automation Composition Type Definitions | ParticipantDeregisterAckCLAMP Runtime | ||||
ACMId | The name and version of the Automation Composition | |||||
startPhase | The start phase to which this ACMStateChangeAck message applies | |||||
ACMResult | Holds a Result and Message for the overall operation on the participant and a map of Result and Message fields for each Automation Composition Element of the Automation Composition on this participant | Participant | Acknowledgement of Participant DeegistrationParticipantId | The ID of this participant | ParticipantType | The type of the participant, maps to the capabilities of the participant in Control Loop Type Definitions |
Result | Success/Fail | |||||
Message | Message A message indicating the reason for failure | ControlLoopUpdate|||||
ParticipantStatusReq | CLAMP Runtime | Participant | CLAMP Runtime sends Control Loop Element instances and Instance Specific Parameter Values to Participants | ParticipantUpdateMap | ||
ControlLoopElementList | List of ControlLoopElement values for a particular participant | |||||
ControlLoopElement | A ControlLoopElement, which contains among other things a PropertiesMap with the values of the the property values for this Control Loop Element instance | |||||
PropertiesMap | A <String, String> map indexed by the property name. Each map entry is the serialized value of the property, which can be deserialized into an instance of the type of the property. | Participant | CLAMP Runtime | Acknowledgement of Participant UpdateParticipantId | The ID of this participant | |
ParticipantType | The type of the participant, maps to the capabilities of the participant in Control Loop Type Definitions | |||||
Result | Success/Fail | |||||
Message | Message indicating reason for failure |
Control Loop Update
Control Loop Update Ack
Control Loop State Change
Control Loop State Change
...
Request that the specified participants return a ParticipantStatus message immediately | ParticipantId | The ID of this participant, if not specified, all participants respond. | |||
ParticipantStatus | Participant | CLAMP Runtime | Periodic or on-demand report for heartbeat, Participant Status, Automation Composition Status, and Automation Composition Statistics | ParticipantId | The ID of this participant |
ParticipantType | The type of the participant; maps to the capabilities of the participant in Automation Composition Type Definitions | ||||
ParticipantDefinitionUpdateMap (returned in repsonse to ParticipantStatusReq only) | See ParticipantUpdate message above for the definition of this field | ||||
ParticipantStatus | The current status of the participant for monitoring | ||||
ParticipantStatistics | Statistics on the participant such as uptime, or messages processed. Can include participant specific data in a string blob that is opaque to CLAMP | ||||
ACMInfoMap | A map of ACMInfo types indexed by ACMId, one entry for each Automation Composition running on the participant | ||||
ACMInfo | The ACMStatus and ACMStatistics for a given Automation Composition | ||||
ACMStatus | The current status of the Automation Composition for monitoring | ||||
ACMStatistics | Statistics on the Automation Composition such as uptime, or messages processed. Can include participant specific data in a string blob that is opaque to CLAMP |