thin-edge.io icon indicating copy to clipboard operation
thin-edge.io copied to clipboard

Make tedgeUrl optional when creating config_snapshot command

Open reubenmiller opened this issue 2 years ago • 0 comments

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

The tedgeUrl property of the config_snapshot command should not be mandatory when creating a local operation.

Having the tedgeUrl mandatory makes it hard for custom mappers to use a consistent tedgeUrl path, and it error prone as the component creating the command request needs to know about the file transfer service.

For example, the following MQTT message is required to create a valid config_snapshot command, note the tedgeUrl property.

tedge mqtt pub 'te/device/main///cmd/config_snapshot/local-1234' '{
    "status":"init",
    "type":"tedge-configuration-plugin",
    "tedgeUrl":"http://localhost:8005/tedge/file-transfer/config/tedge-configuration-plugin"
}' -r

Describe the solution you'd like

The following changes should be made

  • the tedgeUrl should not be a mandatory property required by the tedge-agent when processing the config_snapshot command
  • If the tedgeUrl property is not provided, the tedge-agent should set the tedgeUrl property itself.

After the above is implemented, it should be possible to create a config_snapshot using the following command:

tedge mqtt pub 'te/device/main///cmd/config_snapshot/local-1234' '{
    "status":"init",
    "type":"tedge-configuration-plugin"
}' -r

Describe alternatives you've considered

Additional context

reubenmiller avatar Mar 04 '24 07:03 reubenmiller