feat: support Cumulocity legacy file upload/download operations#3285
Merged
reubenmiller merged 1 commit intothin-edge:mainfrom Dec 10, 2024
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files📢 Thoughts on this report? Let us know! |
Contributor
Robot Results
|
rina23q
approved these changes
Dec 9, 2024
Member
rina23q
left a comment
There was a problem hiding this comment.
It's a good surprise to support the legacy configuration management with such small changes! I really think it was a good decision to change the operation input from SR2 to JSON :)
I left a minor test modification suggestion.
...k/tests/cumulocity/configuration/legacy_config_operation/legacy_configuration_workflow.robot
Outdated
Show resolved
Hide resolved
7a8632e to
64ddcfb
Compare
Contributor
didier-wenzek
left a comment
There was a problem hiding this comment.
The change is correct, but naming can be improved.
...ework/tests/cumulocity/configuration/legacy_config_operation/tedge-configuration-plugin.toml
Outdated
Show resolved
Hide resolved
albinsuresh
reviewed
Dec 10, 2024
Contributor
albinsuresh
left a comment
There was a problem hiding this comment.
Except for the missing c8y_ConfigurationDump MO creation for the c8y_UploadConfigFile operation, the rest looks fine.
...k/tests/cumulocity/configuration/legacy_config_operation/legacy_configuration_workflow.robot
Show resolved
Hide resolved
2b1fd5e to
c3f895c
Compare
c3f895c to
2ce9ee7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Support Cumulocity Legacy configuration upload/download operations which don't have a type property.
Since the legacy configuration operations and the new type-based file operations both use the same root fragment (
c8y_UploadConfigFileandc8y_DownloadConfigFile), the only main difference is that the legacy versions don't have a type. The Cumulocity server will take responsibility of setting thec8y_ConfigurationDumpinventory fragment when processing the operation status updates (see the documentation listed below).Note: The Cumulocity legacy
c8y_UploadConfigFileoperation will not follow the exact legacy contract. Instead the user should use the "default" type to request the configuration from the device so that it aligns with the requesting other type-based configurations which are already supported by thin-edge.io.Below shows an example of the operation data structure, and a reference to the Cumulocity documentation:
Legacy Config Upload Operation example
Documentation: https://cumulocity.com/docs/device-integration/fragment-library/#upload-current-legacy-configuration
Example operation body:
Legacy Config Download Operation
Documentation: https://cumulocity.com/docs/device-integration/fragment-library/#install-legacy-configuration
Example operation body:
{ "c8y_DownloadConfigFile": { "url": "https://demos.cumulocity.com/inventory/binaries/9100", "c8y_ConfigurationDump": { "id": "9200" } } }Types of changes
Paste Link to the issue
#3284
Checklist
cargo fmtas mentioned in CODING_GUIDELINEScargo clippyas mentioned in CODING_GUIDELINESFurther comments