Is your feature improvement request related to a problem? Please describe.
It would be useful if thin-edge.io would be able to be configurable to control when to use the new Cumulocity Advanced Software Management API and when to use the legacy inventory managed update API.
This is a follow-up feature enhancement of the c8y mapper enhancement:
Allow users to control the Cumulocity Software API used by thin-edge.io via configuration. Also include an option which will automatically detect the appropriate API to use during runtime.
Proposed tedge.toml configuration
The following tedge.toml configuration is proposed:
software_management.api is used to control which API is used by the c8y tedge-mapper. With the following values:
legacy - send software update via HTTP request directly to the managed object REST API
advanced - send software update via MQTT using the 140 and 141 SmartREST 2.0 static templates
~auto - Auto detect whether to use legacy or advanced by sending a HTTP request to GET /service/advanced-software-mgmt/health and if it returns a HTTP status between 200 - 399 (inclusive), then use the advanced api, otherwise use teh legacy option. The api option should be detected any time it is updating the software_list (as the server can change at anytime, so only doing the check on agent startup would be insufficient)~
software_management.with_types is only applicable when the advanced api is being used, and controls whether the software types are sent to the Cumulocity tenant or not. The sending of the software types controls influences the data model of the software list (as controlled by the advanced-software-mgmt microservice running in the tenant - see the Cumulocity Fragment Library for more details)
Describe alternatives you've considered
Additional context
the advanced-software-mgmt microservice is not enabled on all tenants (or at least this was observed on the qa tenant which is hosted on eu-latest).
2771 implemented the feature described in this ticket besides the auto option. So as of now, we support legacy and advanced enum only as you can find it in the code below.
Is your feature improvement request related to a problem? Please describe.
It would be useful if thin-edge.io would be able to be configurable to control when to use the new Cumulocity Advanced Software Management API and when to use the legacy inventory managed update API.
This is a follow-up feature enhancement of the c8y mapper enhancement:
Describe the solution you'd like
Allow users to control the Cumulocity Software API used by thin-edge.io via configuration. Also include an option which will automatically detect the appropriate API to use during runtime.
Proposed tedge.toml configuration
The following tedge.toml configuration is proposed:
Where
software_management.api
is used to control which API is used by the c8y tedge-mapper. With the following values:legacy
- send software update via HTTP request directly to the managed object REST APIadvanced
- send software update via MQTT using the140
and141
SmartREST 2.0 static templatesauto
- Auto detect whether to uselegacy
oradvanced
by sending a HTTP request toGET /service/advanced-software-mgmt/health
and if it returns a HTTP status between 200 - 399 (inclusive), then use theadvanced
api, otherwise use tehlegacy
option. The api option should be detected any time it is updating the software_list (as the server can change at anytime, so only doing the check on agent startup would be insufficient)~software_management.with_types
is only applicable when theadvanced
api is being used, and controls whether the software types are sent to the Cumulocity tenant or not. The sending of the software types controls influences the data model of the software list (as controlled by theadvanced-software-mgmt
microservice running in the tenant - see the Cumulocity Fragment Library for more details)Describe alternatives you've considered
Additional context
advanced-software-mgmt
microservice is not enabled on all tenants (or at least this was observed on the qa tenant which is hosted on eu-latest).