Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services should be able to register supported operations #3226

Open
reubenmiller opened this issue Nov 5, 2024 · 0 comments
Open

services should be able to register supported operations #3226

reubenmiller opened this issue Nov 5, 2024 · 0 comments
Labels
idea ideas/opportunities/feature requests which need to be further investigated before implementation

Comments

@reubenmiller
Copy link
Contributor

reubenmiller commented Nov 5, 2024

Is your feature request related to a problem? Please describe.

thin-edge.io should allow services to register support for operations via the /cmd/<command_name> topic, and such supported operations should be sent to the cloud.

Currently, if a service register a topic, the mapper will log the following error:

Nov 05 21:32:11 57e667c78707 tedge-mapper[337]: 2024-11-05T21:32:11.607598388Z ERROR c8y_mapper_ext::converter: Mapping error: Unexpected error: log_upload operation for services are currently unsupported

Below shows an example of what would be expected. The example shows a service registering support for the log_upload operation.

tedge mqtt pub -r -q 1 te/device/main/service/nginx@nginx/cmd/log_upload '{"types":"container"}'

Describe the solution you'd like

thin-edge.io should make no distinction between a service's or child devices when it comes to registering of commands (from the user's perspective).

Whilst the Cumulocity IoT device management UI does not currently allow users to send operations to devices, this is a purely UI limitation, and users are free to create their custom UI plugins to allow sending operations to services (as a service is just a managed object after all). See the additional context section for proof that the operations are sent to the correct thin-edge.io service entity.

Describe alternatives you've considered

Additional context

To verify that an operation created for a service does get sent to the device (with the proper external id of the service), a c8y_LogfileRequest operation was created and below is the received MQTT messages on the device. It shows that the tedge-mapper-c8y does also correctly map the incoming operation to the proper thin-edge.io topic id related to the service.

[c8y/devicecontrol/notifications] {"delivery":{"log":[],"time":"2024-11-05T21:43:24.199Z","status":"PENDING"},"agentId":"17298067","creationTime":"2024-11-05T21:43:24.145Z","deviceId":"73298086","id":"298094","status":"PENDING","c8y_LogfileRequest":{"searchText":"","logFile":"container","dateTo":"2024-11-05T22:43:07+0100","dateFrom":"2024-11-04T22:43:07+0100","maximumLines":1000},"description":"Log file request","externalSource":{"externalId":"TST_sketch_indigo_chord:device:main:service:nginx@nginx","type":"c8y_Serial"}}
[c8y/s/ds] 522,TST_sketch_indigo_chord:device:main:service:nginx@nginx,container,2024-11-04T22:43:07+0100,2024-11-05T22:43:07+0100,,1000
[te/device/main/service/nginx@nginx/cmd/log_upload/c8y-mapper-298094] {"status":"init","tedgeUrl":"http://127.0.0.1:8000/tedge/file-transfer/TST_sketch_indigo_chord:device:main:service:nginx@nginx/log_upload/container-c8y-mapper-298094","type":"container","dateFrom":"2024-11-04T22:43:07+01:00","dateTo":"2024-11-05T22:43:07+01:00","lines":1000}
@reubenmiller reubenmiller added the idea ideas/opportunities/feature requests which need to be further investigated before implementation label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea ideas/opportunities/feature requests which need to be further investigated before implementation
Projects
None yet
Development

No branches or pull requests

1 participant