Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Provide mapping UI for C8Y -> Hub Events (outbound) #16

Closed
haraldmeyer opened this issue May 18, 2022 · 3 comments · Fixed by #32
Closed

Provide mapping UI for C8Y -> Hub Events (outbound) #16

haraldmeyer opened this issue May 18, 2022 · 3 comments · Fixed by #32
Assignees
Labels
enhancement New feature or request

Comments

@haraldmeyer
Copy link
Member

haraldmeyer commented May 18, 2022

UI currently only supports inbound (Hub Events -> C8Y):
image

There should be another menu entry "Events to Hub" and a page to configure the mapping. At the moment C8Y to ADAMOS Hub event processing is implemented in the Hub Connector Backend in a fixed way:

  • Every 60s all events of type AdamosHubEvent are fetched
  • Check if the device is a Hub-connected device, progress only if true
  • Extract "adamos_hub_data" fragment from C8Y event
  • Enhance extracted fragment with the HUB id of the device and timestamp
  • Send event containing the enriched data to ADAMOS Hub

In the future the mapping should be configurable. A user should be able to select:

  • The Cumulocity event type that should be the source of the mapping (free-text field)
  • Optionally select one or multiple devices for which the event should be mapped. If no device is selected, rule should apply to all devices
  • The ADAMOS Hub event code (=type) as a free-text field
  • A list of fragments from the C8Y event that should be mapped 1:1 into the "attributes" array of the ADMOS Hub event. If the C8Y event fragment is an array, the elements of that array should be flattened into the "attributes" array.

See here for specification of ADAMOS Hub events:
https://enablement.adamos.com/adamos-hub/fuer-entwickler/developer-handbook/event-service/?anchor=Event-definition

The microservice implementation here:

needs to be extended to interpret the mapping rules and start separate listeners per mapping rule. Upon changes of mapping rules, the listeners should be updated. Listener logic should remain polling for the time being (change to Notification 2.0 is treated in #27). Probably best to have one repeated tasks that polls all "listeners".

@haraldmeyer haraldmeyer added the enhancement New feature or request label May 18, 2022
@hnaether-sag
Copy link
Collaborator

@haraldmeyer The list of fragments is optional I guess? The list of devices - should it contain all c8y devices of a tenant or just the devices which are connected with ADAMOS Hub?

@haraldmeyer
Copy link
Member Author

  • only Hub-connected devices
  • all ADAMOS Hub Events at the moment, require a payload in the form of one or multiple fragment. It is conceivable that this might not be the case in the future though. So let us make it optional.

@hnaether-sag
Copy link
Collaborator

In progress. Created UI part. Continuing with MS part.

@hnaether-sag hnaether-sag linked a pull request Dec 20, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants