devices_api module#

class edgeimpulse_api.api.devices_api.DevicesApi(api_client=None)[source]#

Bases: object

create_device(
project_id: StrictInt[StrictInt],
create_device_request: CreateDeviceRequest,
**kwargs,
) GenericApiResponse[source]#

Create device

Create a new device. If you set ifNotExists to false and the device already exists, the deviceType will be overwritten.

Parameters:
  • project_id (int) – Project ID (required)

  • create_device_request (CreateDeviceRequest) – (required)

  • async_req (bool, optional) – Whether to execute the request asynchronously.

  • _preload_content (bool, optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

  • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

Returns:

Returns the result object. If the method is called asynchronously, returns the request thread.

Return type:

GenericApiResponse

delete_device(
project_id: StrictInt[StrictInt],
device_id: StrictStr[StrictStr],
**kwargs,
) GenericApiResponse[source]#

Delete device

Delete a device. When this device sends a new message to ingestion or connects to remote management the device will be recreated.

Parameters:
  • project_id (int) – Project ID (required)

  • device_id (str) – Device ID (required)

  • async_req (bool, optional) – Whether to execute the request asynchronously.

  • _preload_content (bool, optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

  • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

Returns:

Returns the result object. If the method is called asynchronously, returns the request thread.

Return type:

GenericApiResponse

get_device(
project_id: StrictInt[StrictInt],
device_id: StrictStr[StrictStr],
**kwargs,
) GetDeviceResponse[source]#

Get device

Retrieves a single device

Parameters:
  • project_id (int) – Project ID (required)

  • device_id (str) – Device ID (required)

  • async_req (bool, optional) – Whether to execute the request asynchronously.

  • _preload_content (bool, optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

  • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

Returns:

Returns the result object. If the method is called asynchronously, returns the request thread.

Return type:

GetDeviceResponse

list_devices(
project_id: StrictInt[StrictInt],
**kwargs,
) ListDevicesResponse[source]#

Lists devices

List all devices for this project. Devices get included here if they connect to the remote management API or if they have sent data to the ingestion API and had the device_id field set.

Parameters:
  • project_id (int) – Project ID (required)

  • async_req (bool, optional) – Whether to execute the request asynchronously.

  • _preload_content (bool, optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

  • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

Returns:

Returns the result object. If the method is called asynchronously, returns the request thread.

Return type:

ListDevicesResponse

rename_device(
project_id: StrictInt[StrictInt],
device_id: StrictStr[StrictStr],
rename_device_request: RenameDeviceRequest,
**kwargs,
) GenericApiResponse[source]#

Rename

Set the current name for a device.

Parameters:
  • project_id (int) – Project ID (required)

  • device_id (str) – Device ID (required)

  • rename_device_request (RenameDeviceRequest) – (required)

  • async_req (bool, optional) – Whether to execute the request asynchronously.

  • _preload_content (bool, optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

  • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

Returns:

Returns the result object. If the method is called asynchronously, returns the request thread.

Return type:

GenericApiResponse

start_sampling(
project_id: StrictInt[StrictInt],
device_id: StrictStr[StrictStr],
start_sampling_request: StartSamplingRequest,
**kwargs,
) StartSamplingResponse[source]#

Start sampling

Start sampling on a device. This function returns immediately. Updates are streamed through the websocket API.

Parameters:
  • project_id (int) – Project ID (required)

  • device_id (str) – Device ID (required)

  • start_sampling_request (StartSamplingRequest) – (required)

  • async_req (bool, optional) – Whether to execute the request asynchronously.

  • _preload_content (bool, optional) – if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.

  • _request_timeout – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

Returns:

Returns the result object. If the method is called asynchronously, returns the request thread.

Return type:

StartSamplingResponse