aboutsummaryrefslogtreecommitdiffstats
path: root/docs/clamp/acm/api-protocol/acm-participant-protocol.rst
blob: 449e20967c587785e036dd8f8a7f8f272c44b4c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
.. This work is licensed under a Creative Commons Attribution 4.0 International License.

.. _acm-participant-protocol-label:

The ACM Automation Composition Participant Protocol
###################################################

The CLAMP Automation Composition protocol is an asynchronous protocol that is used by the CLAMP
runtime to coordinate lifecycle management of Automation Composition instances. The protocol
supports the functions described in the sections below.


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 Automation Composition type
information and common parameter values for its Automation Composition types.

.. image:: ../images/acm-participants-protocol/participant-registering.png


De-registration is executed as a participant goes down.

.. image:: ../images/acm-participants-protocol/participant-deregistration.png


Automation Composition Priming and De-Priming
---------------------------------------------

When an Automation Composition is primed, the portion of the Automation Composition Type Definition
and Common Property values for the participants of each participant type mentioned in the
Automation Composition Definition are sent to the participants.

.. image:: ../images/acm-participants-protocol/acm-priming.png

When an Automation Composition is de-primed, the portion of the Automation Composition Type
Definition and Common Property values for the participants of each participant type mentioned in
the Automation Composition Definition are deleted on participants.

.. image:: ../images/acm-participants-protocol/acm-depriming.png


Automation Composition Update
-----------------------------

Automation Composition Update handles creation, change, and deletion of Automation Compositions on
participants. Change of Automation Compositions uses a semantic versioning approach and follows the
semantics described on the page :ref:`4.1 Management of Automation Composition Instance
Configurations <management-acm-instance-configs>`.

.. image:: ../images/acm-participants-protocol/acm-update.png

The handling of an *ACMUpdate* message in each participant is as shown below.

.. image:: ../images/acm-participants-protocol/acm-update-msg.png

Automation Composition State Change
-----------------------------------

This dialogue is used to change the state of Automation Compositions and their Automation
Composition Elements. The CLAMP Runtime sends an Automation Composition State Change message on the
Automation Composition to all participants. Participants that have Automation Composition Elements
in that Automation Composition attempt an update on the state of the Automation Composition
elements they have for that Automation Composition, and report the result back.

The *startPhase* in the `Definition of TOSCA fundamental Automation Composition Types
<https://github.com/onap/policy-clamp/blob/master/common/src/main/resources/tosca/AutomationCompositionTOSCAServiceTemplateTypes.yaml>`_
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.

.. image:: ../images/acm-participants-protocol/acm-state-change.png

The handling of an ACMStateChange message in each participant is as shown below.

.. image:: ../images/acm-participants-protocol/acm-state-change-msg.png

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.

.. image:: ../images/acm-participants-protocol/acm-monitoring.png


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 Github
<https://github.com/onap/policy-clamp/tree/master/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant>`_
. All messages are carried on DMaaP.


.. list-table::
   :widths: 15 10 10 15 15 35
   :header-rows: 1

   * - 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 Deegistration
     - 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 the
       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
     - Acknowledgment 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 Automation
       Composition Type Definitions
   * -
     -
     -
     -
     - 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
   * -
     -
     -
     -
     - Result
     - Success/Fail
   * -
     -
     -
     -
     - Message
     - A message indicating the reason for failure
   * - ParticipantStatusReq
     - CLAMP Runtime
     - Participant
     - 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 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


End of Document