From b12c67854c70ae410e02af501126ecf8434e5dd9 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Fri, 4 Aug 2023 14:00:54 +0100 Subject: Add documentation of participant composition properties Issue-ID: POLICY-4779 Change-Id: I67ddb8541aa0cfd198d4bd84414b56b59bc1a594 Signed-off-by: FrancescoFioraEst --- docs/clamp/acm/acm-participant-guide.rst | 35 ++++++++++++++++++++----- docs/clamp/acm/acm-user-guide.rst | 44 +++++++++++++++++++++++++++++--- 2 files changed, 69 insertions(+), 10 deletions(-) mode change 100644 => 100755 docs/clamp/acm/acm-participant-guide.rst mode change 100644 => 100755 docs/clamp/acm/acm-user-guide.rst (limited to 'docs/clamp/acm') diff --git a/docs/clamp/acm/acm-participant-guide.rst b/docs/clamp/acm/acm-participant-guide.rst old mode 100644 new mode 100755 index 9228ca37..b2ee244a --- a/docs/clamp/acm/acm-participant-guide.rst +++ b/docs/clamp/acm/acm-participant-guide.rst @@ -122,11 +122,34 @@ This following method is invoked to update the AC element state after each opera 1. void updateAutomationCompositionElementState(UUID automationCompositionId, UUID elementId, DeployState deployState, LockState lockState, StateChangeResult stateChangeResult, String message); 2. Map getAutomationCompositions(); - 3. void sendAcElementInfo(UUID automationCompositionId, UUID elementId, String useState, String operationalState, Map outProperties); - 4. void updateCompositionState(UUID compositionId, AcTypeState state, StateChangeResult stateChangeResult, String message); + 3. AutomationComposition getAutomationComposition(UUID automationCompositionId); + 4. AutomationCompositionElement getAutomationCompositionElement(UUID automationCompositionId, UUID elementId); + 5. Map> getAcElementsDefinitions(); + 6. Map getAcElementsDefinitions(UUID compositionId); + 7. AutomationCompositionElementDefinition getAcElementDefinition(UUID compositionId, ToscaConceptIdentifier elementId); + 8. void sendAcDefinitionInfo(UUID compositionId, ToscaConceptIdentifier elementId, Map outProperties); + 9. void updateCompositionState(UUID compositionId, AcTypeState state, StateChangeResult stateChangeResult, String message); + 10. void sendAcElementInfo(UUID automationCompositionId, UUID elementId, String useState, String operationalState, Map outProperties); + +In/Out composition Properties +----------------------------- + The 'Common Properties' could be created or updated by ACM-runtime. Participants will receive that Properties during priming events. -In/Out Properties ------------------ + The 'Out Properties' could be created or updated by participants. ACM-runtime will receive that Properties during ParticipantStatus event. + The participant can trigger this event using the method sendAcDefinitionInfo. + + Is allowed to the participant to read all In/Out Properties of all compositions handled by the participant using the method getAcElementsDefinitions. + The following code is an example how to update the property 'myProperty' and send to ACM-runtime: + +.. code-block:: java + + var acElement = intermediaryApi.getAcElementDefinition(compositionId, elementId); + var outProperties = acElement.getOutProperties(); + outProperties.put("myProperty", myProperty); + intermediaryApi.sendAcDefinitionInfo(compositionId, elementId, outProperties); + +In/Out instance Properties +-------------------------- The 'In Properties' could be created or updated by ACM-runtime. Participants will receive that Properties during deploy and update events. The 'Out Properties' could be created or updated by participants. ACM-runtime will receive that Properties during ParticipantStatus event. @@ -138,9 +161,7 @@ In/Out Properties .. code-block:: java - var automationCompositions = intermediaryApi.getAutomationCompositions(); - var automationComposition = automationCompositions.get(automationCompositionId); - var acElement = automationComposition.getElements().get(elementId); + var acElement = intermediaryApi.getAutomationCompositionElement(automationCompositionId, elementId); var outProperties = acElement.getOutProperties(); outProperties.put("myProperty", myProperty); intermediaryApi.sendAcElementInfo(automationCompositionId, elementId, acElement.getUseState(), acElement.getOperationalState(), outProperties); diff --git a/docs/clamp/acm/acm-user-guide.rst b/docs/clamp/acm/acm-user-guide.rst old mode 100644 new mode 100755 index 2ed49176..0a033b50 --- a/docs/clamp/acm/acm-user-guide.rst +++ b/docs/clamp/acm/acm-user-guide.rst @@ -337,7 +337,9 @@ Functionality covered: #. Set participantId and supportedElementType by properties file or by parameter environment. #. Set a delay for each operation at runtime by Rest-Api. #. Set success or fail for each operation at runtime by Rest-Api. -#. update useState, operationalState and outPropeties and send to ACM-runtime by Rest-Api. +#. update composition outProperties and send to ACM-runtime by Rest-Api. +#. read all AC Definition inProperties/outProperties information by Rest-Api. +#. update useState, operationalState and outProperties and send to ACM-runtime by Rest-Api. #. read all AC instance elements information by Rest-Api. Mock a participant using docker-compose @@ -388,8 +390,44 @@ The Json below is an example of configuration: "deprimeTimerMs": 100 } -Update and send useState operationalState and outProperites ------------------------------------------------------------ +Update and send composition outProperites +----------------------------------------- +Data like useState operationalState and outProperites could be updated any time using the following endpoint: + +.. code-block:: bash + + Invoke a PUT request 'http://participant_sim_ip:port/onap/policy/clamp/acm/simparticipant/v2/compositiondatas' + +The Json below is an example of update, where {{compositionId}} is the UUID of the AC Definition +and ("onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement", "1.2.3") is the ToscaConceptIdentifier of the AC Definition element: + +.. code-block:: json + + { + "outProperties": { + "list": [ + {"id": 10 }, + {"id": 20 } + ] + }, + "compositionId": "{{compositionId}}", + "compositionDefinitionElementId": { + "name": "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement", + "version": "1.2.3" + } + } + +Read all AC Definition elements information +------------------------------------------- +All AC Definition elements information like composition inProperties and outProperties +could be read using the following endpoint: + +.. code-block:: bash + + Invoke a GET request 'http://participant_sim_ip:port/onap/policy/clamp/acm/simparticipant/v2/compositiondatas' + +Update and send useState operationalState and instance outProperites +-------------------------------------------------------------------- Data like useState operationalState and outProperites could be updated any time using the following endpoint: .. code-block:: bash -- cgit 1.2.3-korg