Open mbay-ODW opened 2 years ago
A more generic option would be to have a local HTTP proxy to the cloud endpoint, so the full REST API of Cumulocity would be available locally.
Any feedback on this here? Got the same request here now:
With the new local c8y auth proxy, we are now in good position to ease file upload to c8y.
@reubenmiller can you take some time to define a solution?
The proposal is to extend the tedge
cli with a tedge c8y upload
command,
the plan being to add new Cumulocity-specific commands overtime.
Upload a file to Cumulocity
The command create a new event for the device,
attach the given file content to this new event,
and return the event ID.
Usage: tedge c8y upload [OPTIONS] --file <FILE>
Options:
--file <FILE>
Path to the uploaded file
--mime-type <MIME_TYPE>
MIME type of the file content
[default: application/octet-stream]
--type <EVENT_TYPE>
Type of the event
[default: tedge_UploadedFile]
--text <TEXT>
Text description of the event
[default: ]
--json <JSON>
JSON fragment attached to the event
[default: {}]
Note: The initial proposal was to add support for a tedge file upload c8y
command.
However, the need is more to simplify the interactions with the Cumulocity event API
rather than to upload files to various targets. Hence, the decision to shift the focus toward a tedge c8y upload
command.
Is your feature improvement request related to a problem? Please describe. The configuration/log plugin has implemented a logic to upload files to the binary storage of Cumulocity, However if I develop an own plugin and need to upload files to the binary storage of c8y, I currently can not do so without implementing own Rest API logic into my plugin, using the jet token etc. .
Describe the solution you'd like Since file upload logic is already available somehow in the code I would basically wish something on the cli such as:
For the cli I used the structure of the cert upload. I would basically expect to get back the binaryID of the uploaded file.