Add documentation for AC instance update support
[policy/parent.git] / docs / clamp / acm / design-impl / participants / participant-intermediary.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2
3 .. _clamp-acm-participant-intermediary:
4
5 Participant Intermediary
6 ########################
7
8 The CLAMP Participant Intermediary is a common library in ONAP, which does common message and
9 state handling for participant implementations. It provides a Java API, which participant
10 implementations implement to receive and send messages to the CLAMP runtime and to handle
11 Automation Composition Element state.
12
13 Terminology
14 -----------
15 - Broadcast message: a message for all participants (participantId=null)
16 - Message to a participant: a message only for a participant (participantId properly filled)
17 - MessageSender: a class that takes care of sending messages from participant-intermediary
18 - GUI: graphical user interface, Postman or a Front-End Application
19 - Message Broker: supported message Broker are DMaap and Strimzi-Kafka
20
21 Inbound messages to participants
22 --------------------------------
23 - PARTICIPANT_REGISTER_ACK: received as a response from clamp-acm runtime server as an acknowledgement to ParticipantRegister message sent from a participant
24 - PARTICIPANT_DEREGISTER_ACK: received as a response from clamp-acm runtime server as an acknowledgement to ParticipantDeregister message sent from a participant
25 - AUTOMATION_COMPOSITION_STATE_CHANGE: a message received from clamp-acm runtime server for a state change of clamp-acm
26 - AUTOMATION_COMPOSITION_DEPLOY: a message received from clamp-acm runtime server for a clamp-acm deploy with clamp-acm instances
27 - PARTICIPANT_PRIME: a message received from clamp-acm runtime server for a participant update with tosca definitions of clamp-acm
28 - PARTICIPANT_STATUS_REQ: A status request received from clamp-acm runtime server to send an immediate ParticipantStatus from all participants
29 - PROPERTIES_UPDATE: a message received from clamp-acm runtime server for updating the Ac instance property values
30
31 Outbound messages
32 -----------------
33 - PARTICIPANT_REGISTER: is sent by a participant during startup
34 - PARTICIPANT_DEREGISTER: is sent by a participant during shutdown
35 - PARTICIPANT_STATUS: is sent by a participant as heartbeat with the status and health of a participant
36 - AUTOMATIONCOMPOSITION_STATECHANGE_ACK: is an acknowledgement sent by a participant as a response to AutomationCompositionStateChange
37 - AUTOMATION_COMPOSITION_DEPLOY_ACK: is an acknowledgement sent by a participant as a response to AutomationCompositionDeploy
38 - PARTICIPANT_PRIME_ACK: is an acknowledgement sent by a participant as a response to ParticipantPrime
39
40 Design of a PARTICIPANT_REGISTER message
41 ----------------------------------------
42 - A participant starts and send a PARTICIPANT_REGISTER message with participantId and Supported Element Definition Types
43 - in AC-runtime ParticipantRegisterListener collects the message from Message Broker
44 - if participant is not present in DB, it saves participant reference with status ON_LINE to DB
45 - It triggers the execution to send a PARTICIPANT_REGISTER_ACK message to the participant registered
46
47 Design of a PARTICIPANT_DEREGISTER message
48 ------------------------------------------
49 - A participant is going to close and undeploys all AC-elements and send a PARTICIPANT_DEREGISTER message
50 - in AC-runtime, ParticipantDeregisterListener collects the message from Message Broker
51 - if participant has AC-elements instance, it updates with UNDEPLOYED deployStatus
52 - It triggers the execution to send a PARTICIPANT_DEREGISTER_ACK message to the participant deregistered
53 - Participant is not monitored.
54
55 Prime of an Automation Composition Definition Type
56 --------------------------------------------------
57 - AC-runtime assigns the AC Definition to the participants based of Supported Element Definition Type by participant
58 - it triggers the execution to send a broadcast PARTICIPANT_PRIME message
59 - the message is built by ParticipantPrimePublisher using Tosca Service Template data (to fill the list of ParticipantDefinition)
60 - Participant-intermediary will receive a PARTICIPANT_PRIME message and stores the Tosca Service Template data on ParticipantHandler
61
62 DePrime of an Automation Composition Definition Type
63 ----------------------------------------------------
64 - AC-runtime triggers the execution to send a broadcast PARTICIPANT_PRIME message
65 - the message is built by ParticipantPrimePublisher with an empty list of ParticipantDefinition
66 - Participant-intermediary will receive a PARTICIPANT_PRIME message and deletes the Tosca Service Template data on ParticipantHandler
67
68 Design of "issues automation composition commands to automation compositions" - case UNDEPLOYED to DEPLOYED
69 -----------------------------------------------------------------------------------------------------------
70 - AUTOMATION_COMPOSITION_DEPLOY message with instantiation details and DEPLOY order state is sent to participants
71 - Participant-intermediary validates the current deployState change
72 - Participant-intermediary will receive AUTOMATION_COMPOSITION_DEPLOY message and sends the details of AutomationCompositionElements to participants
73 - Each participant performs its designated job of deployment by interacting with respective frameworks
74
75 Design of "issues automation composition commands to automation compositions" - case DEPLOYED to UNDEPLOYED
76 -----------------------------------------------------------------------------------------------------------
77 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and UNDEPLOY order state is sent to participants
78 - Participant-intermediary validates the current deployState change
79 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message and sends AC-element details to participants
80 - Each participant performs its designated job of undeployment by interacting with respective frameworks
81
82
83 Update of an Automation Composition Instance
84 --------------------------------------------
85 - AC-runtime updates the instance properties of the deployed Ac instances
86 - it triggers the execution to send a broadcast PROPERTIES_UPDATE message
87 - the message is built by AcElementPropertiesPublisher using the REST request payload (to fill the list of elements with the updated property values)
88 - Participant-intermediary will receive a PROPERTIES_UPDATE message and stores the updated values of the elements on ParticipantHandler
89
90 Design of "issues automation composition commands to automation compositions" - case LOCKED to UNLOCKED
91 -------------------------------------------------------------------------------------------------------
92 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and UNLOCK order state is sent to participants
93 - Participant-intermediary validates the current lockState change
94 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message
95
96 Design of "issues automation composition commands to automation compositions" - case UNLOCKED to LOCKED
97 -------------------------------------------------------------------------------------------------------
98 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and LOCK order state is sent to participants
99 - Participant-intermediary validates the current lockState change
100
101 Design of Delete - case UNDEPLOYED to DELETED
102 ---------------------------------------------
103 - AUTOMATION_COMPOSITION_STATE_CHANGE message with instantiation details and DELETE order state is sent to participants
104 - Participant-intermediary validates the current deployState change
105 - Participant-intermediary will receive AUTOMATION_COMPOSITION_STATE_CHANGE message and sends AC-element details to participants
106 - Each participant performs its designated job of removing instantiation data if not done in undeployment
107 - Participant-intermediary will remove instantiation data
108
109 Design of a PARTICIPANT_STATUS_REQ message
110 ------------------------------------------
111 - AC-runtime triggers the execution to send a broadcast PARTICIPANT_STATUS_REQ message or to send it to a specific participant
112 - the message is built by ParticipantStatusReqPublisher
113 - Participant-intermediary will receive a PARTICIPANT_STATUS_REQ message
114
115 Design of a PARTICIPANT_STATUS message
116 --------------------------------------
117 - A participant sends a scheduled PARTICIPANT_STATUS message or in response to a PARTICIPANT_STATUS_REQ message
118 - This message will hold the state and healthStatus of all the participants running actively
119 - PARTICIPANT_STATUS message holds a special attribute to return Tosca definitions, this attribute is populated only in response to PARTICIPANT_STATUS_REQ
120
121 Design of a AUTOMATION_COMPOSITION_DEPLOY_ACK message
122 -----------------------------------------------------
123 - A participant sends AUTOMATION_COMPOSITION_DEPLOY_ACK message in response to a AUTOMATION_COMPOSITION_DEPLOY message.
124 - For each AC-elements moved to the ordered state as indicated by the AUTOMATION_COMPOSITION_DEPLOY
125 - AutomationCompositionUpdateAckListener in AC-runtime collects the messages from Message Broker
126 - It checks the deployStatus of all automation composition elements
127 - It updates the AC-instance in DB accordingly
128
129 Design of a AUTOMATIONCOMPOSITION_STATECHANGE_ACK message
130 ---------------------------------------------------------
131 - A participant sends AUTOMATIONCOMPOSITION_STATECHANGE_ACK message in response to a AUTOMATIONCOMPOSITION_STATECHANGE message.
132 - For each AC-elements moved to the ordered state as indicated by the AUTOMATIONCOMPOSITION_STATECHANGE
133 - AutomationCompositionStateChangeAckListener in AC-runtime collects the messages from Message Broker
134 - It checks the deployStatus/lockStatus of all automation composition elements
135 - It updates the AC-instance in DB accordingly