1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
3 .. _controlloop-participant-protocol-label:
5 The CLAMP Control Loop Participant Protocol
6 ###########################################
8 The CLAMP Control Loop Participant protocol is an asynchronous protocol that is used by the
9 CLAMP runtime to coordinate life cycle management of Control Loop instances. The protocol
10 supports the functions described in the sections below.
16 The protocol supports the dialogues described below.
18 Participant Registration and De-Registration
19 --------------------------------------------
21 Registration when a participant comes up and update of participant with control loop type
22 information and common parameter values for its control loop types.
24 .. image:: ../images/clamp-cl-participants/participant-registering.png
27 De-registration is executed as a participant goes down.
29 .. image:: ../images/clamp-cl-participants/participant-deregistration.png
32 Control Loop Priming and De-Priming
33 -----------------------------------
35 When a control loop is primed, the portion of the Control Loop Type Definition and Common
36 Property values for the participants of each participant type mentioned in the Control Loop
37 Definition are sent to the participants.
39 .. image:: ../images/clamp-cl-participants/controlloop-priming.png
41 When a control loop is de-primed, the portion of the Control Loop Type Definition and Common
42 Property values for the participants of each participant type mentioned in the Control Loop
43 Definition are deleted on participants.
45 .. image:: ../images/clamp-cl-participants/controlloop-depriming.png
51 Control Loop Update handles creation, change, and deletion of control loops on participants.
52 Change of control loops uses a semantic versioning approach and follow the semantics described
53 on the page `4.1 Management of Control Loop Instance Configurations <management-cl-instance-configs>`.
55 .. image:: ../images/clamp-cl-participants/controlloop-update.png
57 The handling of a ControlLoopUpdate message in each participant is as shown below.
59 .. image:: ../images/clamp-cl-participants/controlloop-update-msg.png
61 Control Loop State Change
62 -------------------------
64 This dialogue is used to change the state of Control Loops and their Control Loop Elements. The
65 CLAMP Runtime sends a Control Loop State Change message on the control loop to all participants.
66 Participants that have Control Loop Elements in that Control Loop attempt an update on the state
67 of the control loop elements they have for that control loop, and report the result back.
69 The *startPhase* in the `Definition of TOSCA fundamental Control Loop Types
70 <https://github.com/onap/policy-clamp/blob/master/common/src/main/resources/tosca/ControlLoopTOSCAServiceTemplateTypes.yaml>`_
71 is particularly important in control loop state changes because sometime the user wishes to control
72 the order in which the state changes in Control Loop Elements in a control loop. In state changes
73 from *UNITITIALISED* → *PASSIVE* and from *PASSIVE* → *RUNNING*, control loop elements are started in
74 increasing order of their *startPhase*. In state changes from *RUNNING* → *PASSIVE* and from *PASSIVE*
75 → *UNITITIALISED*, control loop elements are started in decreasing order of their *startPhase*.
77 The CLAMP runtime controls the state change process described in the diagram below. The CLAMP runtime
78 sends a Control Loop State Change message on DMaaP to all participants in a particular Start Phase so,
79 in each state change multiple Control Loop State Change messages are sent, one for each Start Phase in
80 the control loop. If more than one Control Loop Element has the same Start Phase, those Control Loop
81 Elements receive the same Control Loop State Change message from DMaaP and start in parallel.
83 The Participant reads each State Change Message it sees on DMaaP. If the Start Phase on the Control
84 Loop State Change message matches the Start Phase of the Control Loop Element, the participant processes
85 the State Change message. Otherwise the participant ignores the message.
87 .. image:: ../images/clamp-cl-participants/controlloop-state-change.png
89 The handling of a ControlLoopStateChange message in each participant is as shown below.
91 .. image:: ../images/clamp-cl-participants/controlloop-state-change-msg.png
93 Control Loop Monitoring and Reporting
94 -------------------------------------
96 This dialogue is used as a heartbeat mechanism for participants, to monitor the status of Control Loop
97 Elements, and to gather statistics on control loops. The ParticipantStatus message is sent periodically
98 by each participant. The reporting interval for sending the message is configurable.
100 .. image:: ../images/clamp-cl-participants/controlloop-monitoring.png
106 The CLAMP Control Loop Participant Protocol uses the following messages. The descriptions below give
107 an overview of each message. For the precise definition of the messages, see the `CLAMP code at Github
108 <https://github.com/onap/policy-clamp/tree/master/models/src/main/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant>`_
109 . All messages are carried on DMaaP.
113 :widths: 15 10 10 15 15 35
122 * - ParticipantRegister
125 - Participant registers with the CLAMP runtime
127 - The ID of this participant
133 - The type of the participant, maps to the capabilities of the participant in Control Loop Type
135 * - ParticipantRegisterAck
138 - Acknowledgement of Participant Registration
140 - The ID of this participant
146 - The type of the participant, maps to the capabilities of the participant in Control Loop Type
159 - Message indicating reason for failure
160 * - ParticipantUpdate
163 - CLAMP Runtime sends Control Loop Element Definitions and Common Parameter Values to Participants
164 - ParticipantDefinitionUpdateMap
165 - Map with Participant ID as its key, each value on the map is a ControlLoopElementDefintionMap
170 - ControlLoopElementDefintionMap
171 - List of ControlLoopElementDefinition values for a particular participant, keyed by its Control
172 Loop Element Definition ID
177 - ControlLoopElementDefinition
178 - A ControlLoopElementToscaServiceTemplate containing the definition of the Control Loop Element
179 and a CommonPropertiesMap with the values of the common property values for Control Loop Elements
185 - ControlLoopElementToscaServiceTemplate
186 - The definition of the Control Loop Element in TOSCA
191 - CommonPropertiesMap
192 - A <String, String> map indexed by the property name. Each map entry is the serialized value of
193 the property, which can be deserialized into an instance of the type of the property.
194 * - ParticipantUpdateAck
197 - Acknowledgement of Participant Update
199 - The ID of this participant
205 - The type of the participant, maps to the capabilities of the participant in Control Loop Type
218 - Message indicating reason for failure
219 * - ParticipantDeregister
222 - Participant deregisters with the CLAMP runtime
224 - The ID of this participant
230 - The type of the participant, maps to the capabilities of the participant in Control Loop Type
232 * - ParticipantDeregisterAck
235 - Acknowledgement of Participant Deegistration
237 - The ID of this participant
243 - The type of the participant, maps to the capabilities of the participant in Control Loop Type
256 - Message indicating reason for failure
257 * - ControlLoopUpdate
260 - CLAMP Runtime sends Control Loop Element instances and Instance Specific Parameter Values for
261 a Control Loop Instance to Participants
263 - The name and version of the Control Loop
268 - ParticipantUpdateMap
269 - Map with Participant ID as its key, each value on the map is a ControlLoopElementList
274 - ControlLoopElementList
275 - List of ControlLoopElement values for the Control Loop
281 - A ControlLoopElement, which contains among other things a PropertiesMap with the values of the
282 property values for this Control Loop Element instance and a ToscaServiceTemplateFragment with
283 extra concept definitions and instances that a participant may need.
289 - A <String, String> map indexed by the property name. Each map entry is the serialized value of
290 the property, which can be deserialized into an instance of the type of the property.
295 - ToscaServiceTemplateFragment
296 - A well-formed TOSCA service template containing extra concept definitions and instances that a
297 participant may need. For example, the Policy Participant may need policy type definitions or
298 policy instances to be provided if they are not already stored in the Policy Framework.
299 * - ControlLoopUpdateAck
302 - Acknowledgement of Control Loop Update
304 - The ID of this participant
310 - The type of the participant, maps to the capabilities of the participant in Control Loop Type
317 - The name and version of the Control Loop
323 - Holds a Result and Message for the overall operation on the participant and a map of Result
324 and Message fields for each Control Loop Element of the control loop on this participant
336 - Message indicating reason for failure
337 * - ControlLoopStateChange
340 - CLAMP Runtime asks Participants to change the state of a Control Loop
342 - The name and version of the Control Loop
348 - The current state of the Control Loop
354 - The state that the Control Loop should transition to
360 - The start phase to which this ControLoopStateChange message applies
361 * - ControlLoopStateChangeAck
364 - Acknowledgement of Control Loop State Change
366 - The ID of this participant
372 - The type of the participant, maps to the capabilities of the participant in Control Loop Type
379 - The name and version of the Control Loop
385 - The start phase to which this ControLoopStateChangeAck message applies
391 - Holds a Result and Message for the overall operation on the participant and a map of Result and
392 Message fields for each Control Loop Element of the control loop on this participant
404 - Message indicating reason for failure
405 * - ParticipantStatusReq
408 - Request that the specified participants return a ParticipantStatus message immediately
410 - The ID of this participant, if not specified, all participants respond.
411 * - ParticipantStatus
414 - Periodic or on-demand report for heartbeat, Participant Status, Control Loop Status, and Control
417 - The ID of this participant
423 - The type of the participant, maps to the capabilities of the participant in Control Loop
429 - ParticipantDefinitionUpdateMap (returned in repsonse to ParticipantStatusReq only)
430 - See ParticipantUpdate message above for definition of this field
436 - The current status of the participant for monitoring
441 - ParticipantStatistics
442 - Statistics on the participant such as up time, or messages processed. Can include participant
443 specific data in a string blob that is opaque to CLAMP
449 - A map of ControlLoopInfo types indexed by ControlLoopId, one entry for each control loop
450 running on the participant
456 - The ControlLoopStatus and ControlLoopStatistics for a given control loop
462 - The current status of the control loop for monitoring
467 - ControlLoopStatistics
468 - Statistics on the control loop such as up time, or messages processed. Can include participant
469 specific data in a string blob that is opaque to CLAMP