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,
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:
- delete_device(
- project_id: StrictInt[StrictInt],
- device_id: StrictStr[StrictStr],
- **kwargs,
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:
- get_device(
- project_id: StrictInt[StrictInt],
- device_id: StrictStr[StrictStr],
- **kwargs,
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:
- list_devices(
- project_id: StrictInt[StrictInt],
- **kwargs,
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:
- rename_device(
- project_id: StrictInt[StrictInt],
- device_id: StrictStr[StrictStr],
- rename_device_request: RenameDeviceRequest,
- **kwargs,
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:
- start_sampling(
- project_id: StrictInt[StrictInt],
- device_id: StrictStr[StrictStr],
- start_sampling_request: StartSamplingRequest,
- **kwargs,
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: