POST
Description : retrieve devices based on filters and sorting with a limit/offset for pagination.
Accepts : JSON
Returns : JSON
Body of the request
{
"filters": "dict[str, list | dict]",
"limit": "int",
"offset": "int",
"sort": "str",
"order": "int"
}
Body parameters
- filters : dictionary composed of a column or column range and the desired values.
Example :
{"client_id": [1,2]},{"client_id_range": {"min": 3, "max": 5}} - limit : the number of devices to be returned by the request.
Example :
20 - offset : the index from which the data must be fetched from the database results.
Example :
20 - sort : the column by which the data must be ordered.
Example :
client_id - order : the direction in which the data must be sorted.
Example :
ASC,DESC
Responses
Depending of the validity of the request, different responses/status codes will be returned.
HTTP 200
{
"result": {
"items": "list",
"count": "int",
"limit": "int",
"offset": "str",
}
}
Response parameters
- items : the retrieved devices.
Example :
[{"device_id":"11ab..5f", ..}, ..] - count : the total number of stored devices in order to compute pagination.
Example :
80 - limit : the number of devices to be returned by the request.
Example :
20 - offset : the index from which the data must be fetched from the database results.
Example :
20
HTTP 501
{
"result": "str"
}
Response parameters
- result : the error code.
Example :
Error
PUT
Description : add new devices.
Accepts : JSON
Returns : JSON
Body of the request
{
"data": "dict[str, str | int]",
"ids": "list[str]"
}
Body parameters
- data : dictionary composed of columns and their values.
Example :
{"device_id":"11ab..", "license_duration":"2629800", ..} - ids : the device_id of the device to be created.
Example :
["11ab.."]
At least one of the inferences_quota and license_duration columns must be set.
Responses
Depending of the validity of the request, different responses will be returned.
HTTP 200, 501
{
"result": "str"
}
Response parameters
- result : the result of the request.
Example :
OK,Error
PATCH
Description : patch existing devices.
Accepts : JSON
Returns : JSON
Body of the request
{
"data": "dict[str, str | int]",
"ids": "list[str]"
}
Body parameters
- data : dictionary composed of columns and their values.
Example :
{"device_id":"11ab..", "license_duration":"2629800", ..} - ids : the device id of the device to be updated.
Example :
["11ab..", "52f..]
At least one of the inferences_quota and license_duration columns must be set.
Responses
Depending of the validity of the request, different responses will be returned.
HTTP 200, 501
{
"result": "str"
}
Response parameters
- result : the result of the request.
Example :
OK,Error
DELETE
Description : delete existing devices.
Accepts : JSON
Returns : JSON
Body of the request
{
"ids": "list[str]"
}
Body parameters
- ids : the list of device ID(s) to be deleted from the database.
Example :
['11ab..', '78fe..']
Responses
Depending of the validity of the request, different responses will be returned.
HTTP 200, 501
{
"result": "str"
}
Response parameters
- result : the result of the request.
Example :
OK,Error