Update dependencies in policy parent
[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 ACM Automation Composition protocol is an asynchronous protocol that is used by the ACM
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 Participant Registration is performed by a Participant when it starts up. It registers its ID and the ACM Element Types it supports with the ACM runtime.
22 In a scenario where Participant has been restarted, ACM runtime have to provide all Primed ACM Definition and Deployed ACM instances of the Participant sending a Restart message.
23
24
25 .. image:: ../images/system-dialogues/RegisterParticipant.png
26
27
28 Participant Deregistration is performed by a Participant when it shuts down. It deregisters its ID and type with the ACM runtime.
29
30 .. image:: ../images/system-dialogues/DeregisterParticipant.png
31
32
33 Automation Composition Priming and De-Priming
34 ---------------------------------------------
35
36 The Priming operation sends Automation Composition Types and common property values to participants for each Automation Composition Element Type in the Automation Composition Type. The ParticipantPrime message type is sent to trigger priming and depriming in participants in participants
37
38 .. image:: ../images/system-dialogues/PrimeAcTypeOnPpnts.png
39
40 A participant should respond for each Automation Composition Element Type, thus causing the full Automation Composition Type to become primed. Note that if more than one participant can support an Automation Composition Element Type the ACM Runtime uses the participant in the first response it receives for that Automation Composition Element Type.
41
42 .. image:: ../images/system-dialogues/PrimeAcTypeMultiplePpnts.png
43
44 The ACM Runtime updates the priming information in the database.
45
46 .. image:: ../images/system-dialogues/PrimeInfoUpdatedInDb.png
47
48 The Depriming operation removes Automation Composition Types and common property values on participants for each Automation Composition Element Type in the Automation Composition Type.
49
50 .. image:: ../images/system-dialogues/DeprimeOnParticipants.png
51
52 A participant should respond for each Automation Composition Element Type, thus causing the full Automation Composition Type to become deprimed.
53
54 .. image:: ../images/system-dialogues/DeprimeElements.png
55
56 The ACM Runtime updates the priming information in the database.
57
58 .. image:: ../images/system-dialogues/UpdateDeprimeInDb.png
59
60 Automation Composition Update
61 -----------------------------
62
63 Automation Composition Update handles creation, change, and deletion of Automation Compositions on
64 participants. Change of Automation Compositions uses a semantic versioning approach and follows the
65 semantics described on the page :ref:`4.1 Management of Automation Composition Instance
66 Configurations <management-acm-instance-configs>`.
67
68 .. image:: ../images/acm-participants-protocol/acm-update.png
69
70 The handling of an *ACMUpdate* message in each participant is as shown below.
71
72 .. image:: ../images/acm-participants-protocol/acm-update-msg.png
73
74 Automation Composition State Change
75 -----------------------------------
76
77 This dialogue is used to change the state of Automation Compositions and their Automation
78 Composition Elements. The CLAMP Runtime sends an Automation Composition State Change message on the
79 Automation Composition to all participants. Participants that have Automation Composition Elements
80 in that Automation Composition attempt an update on the state of the Automation Composition
81 elements they have for that Automation Composition, and report the result back.
82
83 The *startPhase* in the `Definition of TOSCA fundamental Automation Composition Types
84 <https://github.com/onap/policy-clamp/blob/master/common/src/main/resources/tosca/AutomationCompositionTOSCAServiceTemplateTypes.yaml>`_
85 is particularly important in Automation Composition state changes because sometimes the user wishes
86 to control the order in which the state changes in Automation Composition Elements in an Automation
87 Composition. In-state changes from *UNDEPLOYED → DEPLOYED*,
88 Automation Composition elements are started in increasing order of their startPhase. In-state
89 changes from *DEPLOYED → UNDEPLOYED*, Automation Composition
90 elements are started in decreasing order of their *startPhase*.
91
92 The ACM runtime controls the state change process described in the diagram below. The ACM
93 runtime sends an Automation Composition state change message on the messaging system (e.g. Kafka) to all participants in a
94 particular start phase so, in each state change multiple Automation Composition State Change
95 messages are sent, one for each start phase in the Automation Composition. If more than one
96 Automation Composition Element has the same start phase, those Automation Composition Elements
97 receive the same Automation Composition State Change message from Kafka and start in parallel.
98
99 The Participant reads each State Change Message it sees on Kafka. If the start phase on the
100 Automation Composition State Change message matches the Start Phase of the Automation Composition
101 Element, the participant processes the state change message. Otherwise, the participant ignores the
102 message.
103
104 .. image:: ../images/acm-participants-protocol/acm-state-change.png
105
106 The flow of the DEPLOY/UNDEPLOY state change messages are shown below. But the same flow is true for LOCK/UNLOCK and DELETE
107
108 .. note:: More details of the state machine are available on :ref:`ACM States <acm-states-label>`
109
110 .. image:: ../images/acm-participants-protocol/acm-state-change-msg.png
111
112 Automation Composition Monitoring and Reporting
113 -----------------------------------------------
114
115 This dialogue is used as a heartbeat mechanism for participants, to monitor the status of
116 Automation Composition Elements, and to gather statistics on Automation Compositions. The
117 *ParticipantStatus* message is sent periodically by each participant. The reporting interval for
118 sending the message is configurable.
119
120 .. image:: ../images/acm-participants-protocol/acm-monitoring.png
121
122
123 Messages
124 ========
125
126 The CLAMP Automation Composition Participant Protocol uses the following messages. The
127 descriptions below give an overview of each message. For the precise definition of the messages,
128 see the `CLAMP code at Github
129 <https://github.com/onap/policy-clamp/tree/master/models/src/main/java/org/onap/policy/clamp/models/acm/messages/kafka/participant>`_
130 . All messages are carried on DMaaP.
131
132 .. csv-table:: ACM Messages
133   :file: ../files/ACM-Message-Table.csv
134   :header-rows: 1
135
136
137 End of Document