449e20967c587785e036dd8f8a7f8f272c44b4c6
[policy/parent.git] / docs / clamp / acm / api-protocol / acm-participant-protocol.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2
3 .. _acm-participant-protocol-label:
4
5 The ACM Automation Composition Participant Protocol
6 ###################################################
7
8 The CLAMP Automation Composition protocol is an asynchronous protocol that is used by the CLAMP
9 runtime to coordinate lifecycle management of Automation Composition instances. The protocol
10 supports the functions described in the sections below.
11
12
13 Protocol Dialogues
14 ==================
15
16 The protocol supports the dialogues described below.
17
18 Participant Registration and De-Registration
19 --------------------------------------------
20
21 Registration when a participant comes up and update of participant with Automation Composition type
22 information and common parameter values for its Automation Composition types.
23
24 .. image:: ../images/acm-participants-protocol/participant-registering.png
25
26
27 De-registration is executed as a participant goes down.
28
29 .. image:: ../images/acm-participants-protocol/participant-deregistration.png
30
31
32 Automation Composition Priming and De-Priming
33 ---------------------------------------------
34
35 When an Automation Composition is primed, the portion of the Automation Composition Type Definition
36 and Common Property values for the participants of each participant type mentioned in the
37 Automation Composition Definition are sent to the participants.
38
39 .. image:: ../images/acm-participants-protocol/acm-priming.png
40
41 When an Automation Composition is de-primed, the portion of the Automation Composition Type
42 Definition and Common Property values for the participants of each participant type mentioned in
43 the Automation Composition Definition are deleted on participants.
44
45 .. image:: ../images/acm-participants-protocol/acm-depriming.png
46
47
48 Automation Composition Update
49 -----------------------------
50
51 Automation Composition Update handles creation, change, and deletion of Automation Compositions on
52 participants. Change of Automation Compositions uses a semantic versioning approach and follows the
53 semantics described on the page :ref:`4.1 Management of Automation Composition Instance
54 Configurations <management-acm-instance-configs>`.
55
56 .. image:: ../images/acm-participants-protocol/acm-update.png
57
58 The handling of an *ACMUpdate* message in each participant is as shown below.
59
60 .. image:: ../images/acm-participants-protocol/acm-update-msg.png
61
62 Automation Composition State Change
63 -----------------------------------
64
65 This dialogue is used to change the state of Automation Compositions and their Automation
66 Composition Elements. The CLAMP Runtime sends an Automation Composition State Change message on the
67 Automation Composition to all participants. Participants that have Automation Composition Elements
68 in that Automation Composition attempt an update on the state of the Automation Composition
69 elements they have for that Automation Composition, and report the result back.
70
71 The *startPhase* in the `Definition of TOSCA fundamental Automation Composition Types
72 <https://github.com/onap/policy-clamp/blob/master/common/src/main/resources/tosca/AutomationCompositionTOSCAServiceTemplateTypes.yaml>`_
73 is particularly important in Automation Composition state changes because sometimes the user wishes
74 to control the order in which the state changes in Automation Composition Elements in an Automation
75 Composition. In-state changes from *UNITITIALISED → PASSIVE* and from *PASSIVE → RUNNING*,
76 Automation Composition elements are started in increasing order of their startPhase. In-state
77 changes from *RUNNING → PASSIVE* and from *PASSIVE → UNITITIALISED*, Automation Composition
78 elements are started in decreasing order of their *startPhase*.
79
80 The CLAMP runtime controls the state change process described in the diagram below. The CLAMP
81 runtime sends an Automation Composition state change message on DMaaP to all participants in a
82 particular start phase so, in each state change multiple Automation Composition State Change
83 messages are sent, one for each start phase in the Automation Composition. If more than one
84 Automation Composition Element has the same start phase, those Automation Composition Elements
85 receive the same Automation Composition State Change message from DMaaP and start in parallel.
86
87 The Participant reads each State Change Message it sees on DMaaP. If the start phase on the
88 Automation Composition State Change message matches the Start Phase of the Automation Composition
89 Element, the participant processes the state change message. Otherwise, the participant ignores the
90 message.
91
92 .. image:: ../images/acm-participants-protocol/acm-state-change.png
93
94 The handling of an ACMStateChange message in each participant is as shown below.
95
96 .. image:: ../images/acm-participants-protocol/acm-state-change-msg.png
97
98 Automation Composition Monitoring and Reporting
99 -----------------------------------------------
100
101 This dialogue is used as a heartbeat mechanism for participants, to monitor the status of
102 Automation Composition Elements, and to gather statistics on Automation Compositions. The
103 *ParticipantStatus* message is sent periodically by each participant. The reporting interval for
104 sending the message is configurable.
105
106 .. image:: ../images/acm-participants-protocol/acm-monitoring.png
107
108
109 Messages
110 ========
111
112 The CLAMP Automation Composition Participant Protocol uses the following messages. The
113 descriptions below give an overview of each message. For the precise definition of the messages,
114 see the `CLAMP code at Github
115 <https://github.com/onap/policy-clamp/tree/master/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant>`_
116 . All messages are carried on DMaaP.
117
118
119 .. list-table::
120    :widths: 15 10 10 15 15 35
121    :header-rows: 1
122
123    * - Message
124      - Source
125      - Target
126      - Purpose
127      - Important Fields
128      - Field Descriptions
129    * - ParticipantRegister
130      - Participant
131      - CLAMP Runtime
132      - Participant registers with the CLAMP runtime
133      - ParticipantId
134      - The ID of this participant
135    * -
136      -
137      -
138      -
139      - ParticipantType
140      - The type of the participant; maps to the capabilities of the participant in Automation
141        Composition Type Definitions
142    * - ParticipantRegisterAck
143      - CLAMP Runtime
144      - Participant
145      - Acknowledgment of Participant Registration
146      - ParticipantId
147      - The ID of this participant
148    * -
149      -
150      -
151      -
152      - ParticipantType
153      - The type of the participant; maps to the capabilities of the participant in Automation
154        Composition Type Definitions
155    * -
156      -
157      -
158      -
159      - Result
160      - Success/Fail
161    * -
162      -
163      -
164      -
165      - Message
166      - A message indicating the reason for failure
167    * - ParticipantUpdate
168      - CLAMP Runtime
169      - Participant
170      - CLAMP Runtime sends Automation Composition Element Definitions and Common Parameter Values
171        to Participants
172      - ParticipantDefinitionUpdateMap
173      - Map with Participant ID as its key, each value on the map is an ACMElementDefintionMap
174    * -
175      -
176      -
177      -
178      - ACMElementDefintionMap
179      - List of ACMElementDefinition values for a particular participant, keyed by its Automation
180        Composition Element Definition ID
181    * -
182      -
183      -
184      -
185      - ACMElementDefinition
186      - An ACMElementToscaServiceTemplate containing the definition of the Automation Composition
187        Element and a CommonPropertiesMap with the values of the common property values for
188        Automation Composition Elements of this type
189    * -
190      -
191      -
192      -
193      - ACMElementToscaServiceTemplate
194      - The definition of the Automation Composition Element in TOSCA
195    * -
196      -
197      -
198      -
199      - CommonPropertiesMap
200      - A <String, String> map indexed by the property name. Each map entry is the serialized value
201        of the property, which can be deserialized into an instance of the type of the property.
202    * - ParticipantUpdateAck
203      - Participant
204      - CLAMP Runtime
205      - Acknowledgment of Participant Update
206      - ParticipantId
207      - The ID of this participant
208    * -
209      -
210      -
211      -
212      - ParticipantType
213      - The type of the participant; maps to the capabilities of the participant in Automation
214        Composition Type Definitions
215    * -
216      -
217      -
218      -
219      - Result
220      - Success/Fail
221    * -
222      -
223      -
224      -
225      - Message
226      - A message indicating the reason for failure
227    * - ParticipantDeregister
228      - Participant
229      - CLAMP Runtime
230      - Participant deregisters with the CLAMP runtime
231      - ParticipantId
232      - The ID of this participant
233    * -
234      -
235      -
236      -
237      - ParticipantType
238      - The type of the participant; maps to the capabilities of the participant in Automation
239        Composition Type Definitions
240    * - ParticipantDeregisterAck
241      - CLAMP Runtime
242      - Participant
243      - Acknowledgment of Participant Deegistration
244      - ParticipantId
245      - The ID of this participant
246    * -
247      -
248      -
249      -
250      - ParticipantType
251      - The type of the participant; maps to the capabilities of the participant in Automation
252        Composition Type Definitions
253    * -
254      -
255      -
256      -
257      - Result
258      - Success/Fail
259    * -
260      -
261      -
262      -
263      - Message
264      - A message indicating the reason for failure
265    * - ACMUpdate
266      - CLAMP Runtime
267      - Participant
268      - CLAMP Runtime sends Automation Composition Element instances and Instance Specific Parameter
269        Values for an Automation Composition Instance to Participants
270      - ACMId
271      - The name and version of the Automation Composition
272    * -
273      -
274      -
275      -
276      - ParticipantUpdateMap
277      - Map with Participant ID as its key, each value on the map is an ACMElementList
278    * -
279      -
280      -
281      -
282      - ACMElementList
283      - List of ACMElement values for the Automation Composition
284    * -
285      -
286      -
287      -
288      - ACMElement
289      - An ACMElement, which contains among other things a PropertiesMap with the values of the
290        property values for this Automation Composition Element instance and a
291        ToscaServiceTemplateFragment with extra concept definitions and instances that a participant
292        may need.
293    * -
294      -
295      -
296      -
297      - PropertiesMap
298      - A <String, String> map indexed by the property name. Each map entry is the serialized value
299        of the property, which can be deserialized into an instance of the type of the property.
300    * -
301      -
302      -
303      -
304      - ToscaServiceTemplateFragment
305      - A well-formed TOSCA service template containing extra concept definitions and instances that
306        a participant may need. For example, the Policy Participant may need policy type definitions
307        or policy instances to be provided if they are not already stored in the Policy Framework.
308    * - ACMUpdateAck
309      - Participant
310      - CLAMP Runtime
311      - Acknowledgment of Automation Composition Update
312      - ParticipantId
313      - The ID of this participant
314    * -
315      -
316      -
317      -
318      - ParticipantType
319      - The type of the participant; maps to the capabilities of the participant in Automation
320        Composition Type Definitions
321    * -
322      -
323      -
324      -
325      - ACMId
326      - The name and version of the Automation Composition
327    * -
328      -
329      -
330      -
331      - ACMResult
332      - Holds a Result and Message for the overall operation on the participant and a map of Result
333        and Message fields for each Automation Composition Element of the Automation Composition on
334        this participant
335    * -
336      -
337      -
338      -
339      - Result
340      - Success/Fail
341    * -
342      -
343      -
344      -
345      - Message
346      - A message indicating the reason for failure
347    * - ACMStateChange
348      - CLAMP Runtime
349      - Participant
350      - CLAMP Runtime asks Participants to change the state of an Automation Composition
351      - ACMId
352      - The name and version of the Automation Composition
353    * -
354      -
355      -
356      -
357      - currentState
358      - The current state of the Automation Composition
359    * -
360      -
361      -
362      -
363      - orderedState
364      - The state that the Automation Composition should transition to
365    * -
366      -
367      -
368      -
369      - startPhase
370      - The start phase to which this ACMStateChange message applies
371    * - ACMStateChangeAck
372      - Participant
373      - CLAMP Runtime
374      - Acknowledgment of Automation Composition State Change
375      - ParticipantId
376      - The ID of this participant
377    * -
378      -
379      -
380      -
381      - ParticipantType
382      - The type of the participant; maps to the capabilities of the participant in Automation
383        Composition Type Definitions
384    * -
385      -
386      -
387      -
388      - ACMId
389      - The name and version of the Automation Composition
390    * -
391      -
392      -
393      -
394      - startPhase
395      - The start phase to which this ACMStateChangeAck message applies
396    * -
397      -
398      -
399      -
400      - ACMResult
401      - Holds a Result and Message for the overall operation on the participant and a map of Result
402        and Message fields for each Automation Composition Element of the Automation Composition on
403        this participant
404    * -
405      -
406      -
407      -
408      - Result
409      - Success/Fail
410    * -
411      -
412      -
413      -
414      - Message
415      - A message indicating the reason for failure
416    * - ParticipantStatusReq
417      - CLAMP Runtime
418      - Participant
419      - Request that the specified participants return a ParticipantStatus message immediately
420      - ParticipantId
421      - The ID of this participant, if not specified, all participants respond.
422    * - ParticipantStatus
423      - Participant
424      - CLAMP Runtime
425      - Periodic or on-demand report for heartbeat, Participant Status, Automation Composition
426        Status, and Automation Composition Statistics
427      - ParticipantId
428      - The ID of this participant
429    * -
430      -
431      -
432      -
433      - ParticipantType
434      - The type of the participant; maps to the capabilities of the participant in Automation
435        Composition Type Definitions
436    * -
437      -
438      -
439      -
440      - ParticipantDefinitionUpdateMap (returned in repsonse to ParticipantStatusReq only)
441      - See ParticipantUpdate message above for definition of this field
442    * -
443      -
444      -
445      -
446      - ParticipantStatus
447      - The current status of the participant for monitoring
448    * -
449      -
450      -
451      -
452      - ParticipantStatistics
453      - Statistics on the participant such as uptime, or messages processed. Can include participant
454        specific data in a string blob that is opaque to CLAMP
455    * -
456      -
457      -
458      -
459      - ACMInfoMap
460      - A map of ACMInfo types indexed by ACMId, one entry for each Automation Composition
461        running on the participant
462    * -
463      -
464      -
465      -
466      - ACMInfo
467      - The ACMStatus and ACMStatistics for a given Automation Composition
468    * -
469      -
470      -
471      -
472      - ACMStatus
473      - The current status of the Automation Composition for monitoring
474    * -
475      -
476      -
477      -
478      - ACMStatistics
479      - Statistics on the Automation Composition such as uptime, or messages processed. Can include
480        participant specific data in a string blob that is opaque to CLAMP
481
482
483 End of Document