DevicesResource
Manages Slim devices, their live rows and telemetry.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.24+fa54770
public final class DevicesResourceManages Slim devices, their live rows and telemetry. Get it from SlimResource.devices().
Methods
list
public Page<JsonNode> list(
Map<String, ?> query,
RequestOptions options) throws IOException, InterruptedExceptionLists devices (GET /v1/slim/device).
Parameters:
query: query parameters, sent as givenoptions: per-request options, such as the timeout
Returns: the first page; iterating it loads the next pages
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
retrieve
public JsonNode retrieve(
String deviceId,
RequestOptions options) throws IOException, InterruptedExceptionReads one device (GET /v1/slim/device/{deviceId}).
Parameters:
deviceId: the device IDoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
create
public JsonNode create(Object body, RequestOptions options) throws IOException, InterruptedExceptionCreates a device (POST /v1/slim/device).
Parameters:
body: the device to createoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
update
public JsonNode update(
String deviceId,
Object body,
RequestOptions options) throws IOException, InterruptedExceptionReplaces a device (PUT /v1/slim/device/{deviceId}).
Parameters:
deviceId: the device IDbody: the updated deviceoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
delete
public void delete(String deviceId, RequestOptions options) throws IOException, InterruptedExceptionDeletes a device (DELETE /v1/slim/device/{deviceId}).
Parameters:
deviceId: the device IDoptions: per-request options, such as the timeout
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
assignToProject
public JsonNode assignToProject(
Object body,
RequestOptions options) throws IOException, InterruptedExceptionAssigns devices to a project (PUT /v1/slim/device/assign/project).
Parameters:
body: the assignment requestoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
live
public Page<JsonNode> live(
Map<String, ?> query,
RequestOptions options) throws IOException, InterruptedExceptionLists devices with their live state (GET /v1/slim/device/live).
Parameters:
query: query parameters;countmust be an integer from 1 to 100options: per-request options, such as the timeout
Returns: the first page; iterating it loads the next pages
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the responseOvokValidationException: ifcountis out of range
liveTelemetry
public JsonNode liveTelemetry(
Map<String, ?> query,
RequestOptions options) throws IOException, InterruptedExceptionReads live telemetry keyed by device (GET /v1/slim/device/live/telemetry).
Parameters:
query: query parameters;countmust be an integer from 1 to 100options: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the responseOvokValidationException: ifcountis out of range
telemetry
public JsonNode telemetry(
String deviceId,
RequestOptions options) throws IOException, InterruptedExceptionReads one device's latest telemetry (GET /v1/slim/telemetry/{deviceId}).
Parameters:
deviceId: the device IDoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
effectiveObservationIds
public JsonNode effectiveObservationIds(
String deviceId,
RequestOptions options) throws IOException, InterruptedExceptionReads one device's effective observation IDs (GET /v1/slim/telemetry/{deviceId}/effectiveIds).
Parameters:
deviceId: the device IDoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
effectiveObservationIdsByDevice
public JsonNode effectiveObservationIdsByDevice(
RequestOptions options) throws IOException, InterruptedExceptionReads effective observation IDs for every device (GET /v1/slim/telemetry/effectiveIds).
Parameters:
options: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
lastObservationIds
public JsonNode lastObservationIds(
String deviceId,
RequestOptions options) throws IOException, InterruptedExceptionReads one device's last observation IDs (GET /v1/slim/telemetry/{deviceId}/lastIds).
Parameters:
deviceId: the device IDoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
lastObservationIdsByDevice
public JsonNode lastObservationIdsByDevice(
RequestOptions options) throws IOException, InterruptedExceptionReads last observation IDs for every device (GET /v1/slim/telemetry/lastIds).
Parameters:
options: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Last updated on