Device Logger
These endpoints are for devices to upload their logs to the cloud.
Endpoints
The Device Log Request object
- idstring
Unique ID of log request
- deviceIdinteger
ID of device associated with log request.
- projectIdinteger
ID of project associated with log request.
- status
Status of log request.
- tsstring| format is date-time
Creation timestamp of log request.
- contentTypestring
MIME type of file uploaded for this request.
- tokenstring
Request token sent to device.
- uploadIdstring
Unique ID assigned to an upload session.
- filenamestring
Filename of uploaded device log.
- urlstring
URL for downloading the stored device log.
The Device Logger Upload Initiation Response object
- numOfPartsinteger
Number of parts the log file should be split into.
- partSizeinteger
Size of a single part except for the last part. The last part must contain the remaining bytes of the log file.
- urlsarray
URLs for uploading the parts, one for each part of the log file.
- uploadIdstring
A unique ID for the upload session. Needed for the API endpoint to commit the session when the upload in finished.
Initiate Upload Session
Endpoint
post /deviceLogger/{token}
Description
Initiate the file upload for a log request. To upload a log file, the device must first initiate an upload and obtain pre-signed secure URL(s) for the actual file upload. After the upload is complete, the client must make another request to commit the upload. A device may call this endpoint again if it wishes to reset a previously initiated upload session.
Path Parameters
token
string
required
Authentication token that is passed to device by DDP
Request Body
filename
string
Filename of file to upload.
size
integer
required
Size of the whole file to upload.
contentType
string
required
MIME type of file to upload.
Response
- 201Upload session initiated. The response contains the information needed for the file upload, and the session ID needed to commit the session after the upload is done.
- 403Request failed because of invalid data or denied permission.
- 500An unexpected error has occurred.
- 503The service is temporarily unavailable.
Report Status of Device Log Request
Endpoint
patch /deviceLogger/{token}
Description
Update the status of a log request. A device should use this endpoint to report errors in uploading the requested log file.
Path Parameters
token
string
required
Authentication token that is passed to device by DDP
Request Body
status
string
required
Log request status to be reported.
Options are failure, nologs
Response
- 204Status of request updated successfully.
- 403Request failed because of invalid data or denied permission.
- 500An unexpected error has occurred.
- 503The service is temporarily unavailable.
Commit Upload Session
Endpoint
post /deviceLogger/{token}/uploads/{uploadId}
Description
Conclude the specified upload session. If the upload was done in multiple parts, the parts will be combined back into a single file for storage. Note that although this is a POST request, a request body is not required.
Path Parameters
token
string
required
Authentication token that is passed to device by DDP
uploadId
string
required
Upload session ID
Response
- 200Device log file has been successfully saved.
- 403Request failed because of invalid data or denied permission.
- 500An unexpected error has occurred.
- 503The service is temporarily unavailable.
Get Upload Session Status
Endpoint
get /deviceLogger/{token}/uploads/{uploadId}
Description
Get the status of an ongoing upload session. The response is an array, with each item corresponding to one part of the upload.
Path Parameters
token
string
required
Authentication token that is passed to device by DDP
uploadId
string
required
Upload session ID
Response
- 200Status of upload session is returned.
- 403Request failed because of invalid data or denied permission.
- 500An unexpected error has occurred.
- 503The service is temporarily unavailable.