Skip to main content

io.edgehog.devicemanager.fileTransfer.ServerToDevice v0.1

File transfer from a Server to a Device.

Request a file transfer operation. Providing a URL from which the device will download a file with an HTTP GET request, the destination of the file to download is implementation specific.

About​

This interface is of type datastream and is owned by the server, meaning that it is the server which initiates the data flow. Thanks to this type of interface, the server can send a mutable, ordered stream of data, with no concept of persistent state or synchronization.

Data gets sent with an object aggregation. Astarte expects the owner to send all of the interface's mappings at the same time, packed in a single message.

Mappings​

The interface has the following mappings:

  • /request/id with string type. Transfer ID (UUID) for the file
  • /request/url with string type. The URL to get the file from
  • /request/httpHeaderKeys with stringarray type. Keys for the HTTP headers, must be in the order of the values
  • /request/httpHeaderValues with stringarray type. Values for the HTTP headers, must be in the order of the keys
  • /request/encoding with string type. Encoding of the file or directory to download
  • /request/fileSizeBytes with longinteger type. File size decompressed
  • /request/progress with boolean type. Flag to enable the progress reporting of the download.
  • /request/digest with string type. Digest of the file contents
  • /request/ttlSeconds with longinteger type. TTL on how long to keep the file for
  • /request/fileMode with longinteger type. Unix mode for the file
  • /request/userId with longinteger type. Uid of the user owning the file
  • /request/groupId with longinteger type. Gid of the user owning the file
  • /request/destinationType with string type. Destination where the file should be written to.
  • /request/destination with string type. Destination-specific information on where to write the file to.

/request/id​

Transfer ID (UUID) for the file

If the file is to be stored, this MUST be unique to the file (e.g. hash of the content). For a file that needs to be streamed, it can be unique for the single request (e.g. uuid).

This endpoint accepts values of type string: an UTF-8 string, at most 65536 bytes long.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/url​

The URL to get the file from

This endpoint accepts values of type string: an UTF-8 string, at most 65536 bytes long.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/httpHeaderKeys​

Keys for the HTTP headers, must be in the order of the values

This endpoint accepts values of type stringarray: a list of values, represented as a JSON Array. Arrays can have up to 1024 items and each item must respect the limits of its scalar type.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/httpHeaderValues​

Values for the HTTP headers, must be in the order of the keys

This endpoint accepts values of type stringarray: a list of values, represented as a JSON Array. Arrays can have up to 1024 items and each item must respect the limits of its scalar type.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/encoding​

Encoding of the file or directory to download

Optional enum string for the file encoding with default value empty, other values are: [gz, lz4, tar, tar.gz, tar.lz4]

This endpoint accepts values of type string: an UTF-8 string, at most 65536 bytes long.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/fileSizeBytes​

File size decompressed

Total file size (if multiple files) uncompressed in bytes. It's used to reserve this space on the device.

This endpoint accepts values of type longinteger: a signed 64 bit integer (please note that longinteger is represented as a string by default in JSON-based APIs.).

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/progress​

Flag to enable the progress reporting of the download.

This endpoint accepts values of type boolean: either true or false, adhering to JSON boolean type.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/digest​

Digest of the file contents

Must be in the form sha256:deadbeaf, and should be used only if supported by the device.

This endpoint accepts values of type string: an UTF-8 string, at most 65536 bytes long.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/ttlSeconds​

TTL on how long to keep the file for

Optional ttl for how long to keep the file for, if 0 is forever

This endpoint accepts values of type longinteger: a signed 64 bit integer (please note that longinteger is represented as a string by default in JSON-based APIs.).

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/fileMode​

Unix mode for the file

Optional unix mode for the file, set to default if 0. All files are immutable, so setting it to writable has no effect.

This endpoint accepts values of type longinteger: a signed 64 bit integer (please note that longinteger is represented as a string by default in JSON-based APIs.).

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/userId​

Uid of the user owning the file

Optional unix uid of the user owning the file, set to default if -1.

This endpoint accepts values of type longinteger: a signed 64 bit integer (please note that longinteger is represented as a string by default in JSON-based APIs.).

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/groupId​

Gid of the user owning the file

Optional unix gid of the group owning the file, set to default if -1.

This endpoint accepts values of type longinteger: a signed 64 bit integer (please note that longinteger is represented as a string by default in JSON-based APIs.).

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/destinationType​

Destination where the file should be written to.

String enum specifying the destination type, with allowed values: [storage, streaming, filesystem].

This endpoint accepts values of type string: an UTF-8 string, at most 65536 bytes long.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.

/request/destination​

Destination-specific information on where to write the file to.

The value depends on the selected destination type: for 'storage' and 'streaming' it's an empty string, and for 'filesystem' is a path to a file on the device.

This endpoint accepts values of type string: an UTF-8 string, at most 65536 bytes long.

The endpoint has a specific configuration for how data is stored, transferred and indexed. Data is considered delivered when it has been received at least once by the recipient. Data is discarded if the transport is temporarily uncapable of delivering it. Delivered data is kept for 3600 seconds before it is erased from the database.