Skip to content

Latest commit

 

History

History
972 lines (782 loc) · 37 KB

DevicesApi.md

File metadata and controls

972 lines (782 loc) · 37 KB

DevicesApi

All URIs are relative to https://api.lab5e.com

Method HTTP request Description
addDownstreamMessage POST /span/collections/{collectionId}/devices/{deviceId}/outbox Add message to oubox
createDevice POST /span/collections/{collectionId}/devices Create device
deleteDevice DELETE /span/collections/{collectionId}/devices/{deviceId} Remove device.
deleteDownstreamMessage DELETE /span/collections/{collectionId}/devices/{deviceId}/outbox/{messageId} Delete outgoing message
deviceCertificate GET /span/collections/{collectionId}/devices/{deviceId}/certs Get issued certificate(s) for device
listDeviceData GET /span/collections/{collectionId}/devices/{deviceId}/data Retrieve data from device
listDevices GET /span/collections/{collectionId}/devices List devices in collection.
listDownstreamMessages GET /span/collections/{collectionId}/devices/{deviceId}/outbox List the messages in the outbox
listUpstreamMessages GET /span/collections/{collectionId}/devices/{deviceId}/inbox List incoming messages
retrieveDevice GET /span/collections/{collectionId}/devices/{deviceId} Retrieve device
retrieveDeviceStats GET /span/collections/{collectionId}/devices/{deviceId}/stats Retrieve device statistics
updateDevice PATCH /span/collections/{existingCollectionId}/devices/{deviceId} Update device

addDownstreamMessage

MessageDownstream addDownstreamMessage(collectionId, deviceId, body)

Add message to oubox

Add a new message in the outgoing queue to the device. If there is other messages in the outbox these messages will be sent first.

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String deviceId = "deviceId_example"; // String | 
    AddDownstreamMessageBody body = new AddDownstreamMessageBody(); // AddDownstreamMessageBody | 
    try {
      MessageDownstream result = apiInstance.addDownstreamMessage(collectionId, deviceId, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#addDownstreamMessage");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String
deviceId String
body AddDownstreamMessageBody

Return type

MessageDownstream

Authorization

APIToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

createDevice

Device createDevice(collectionId, body)

Create device

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | This is the containing collection
    CreateDeviceBody body = new CreateDeviceBody(); // CreateDeviceBody | 
    try {
      Device result = apiInstance.createDevice(collectionId, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#createDevice");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String This is the containing collection
body CreateDeviceBody

Return type

Device

Authorization

APIToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

deleteDevice

Device deleteDevice(collectionId, deviceId)

Remove device.

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | This is the containing collection
    String deviceId = "deviceId_example"; // String | The device ID is assigned by the backend.
    try {
      Device result = apiInstance.deleteDevice(collectionId, deviceId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#deleteDevice");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String This is the containing collection
deviceId String The device ID is assigned by the backend.

Return type

Device

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

deleteDownstreamMessage

DeleteDownstreamMessageResponse deleteDownstreamMessage(collectionId, deviceId, messageId)

Delete outgoing message

Delete an outgoing (ie downstream) message from the outbox.

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String deviceId = "deviceId_example"; // String | 
    String messageId = "messageId_example"; // String | 
    try {
      DeleteDownstreamMessageResponse result = apiInstance.deleteDownstreamMessage(collectionId, deviceId, messageId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#deleteDownstreamMessage");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String
deviceId String
messageId String

Return type

DeleteDownstreamMessageResponse

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

deviceCertificate

DeviceCertificateResponse deviceCertificate(collectionId, deviceId)

Get issued certificate(s) for device

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String deviceId = "deviceId_example"; // String | 
    try {
      DeviceCertificateResponse result = apiInstance.deviceCertificate(collectionId, deviceId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#deviceCertificate");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String
deviceId String

Return type

DeviceCertificateResponse

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

listDeviceData

ListDataResponse listDeviceData(collectionId, deviceId, limit, start, end, offset)

Retrieve data from device

List the data received from the device. Use the query parameters to control what data you retrieve. The maximum number of data points is 100.

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | The collection ID. This is included in the request path.
    String deviceId = "deviceId_example"; // String | The device ID. This is included in the request path.
    Integer limit = 56; // Integer | Limit the number of payloads to return. The default is 512.
    String start = "start_example"; // String | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch.
    String end = "end_example"; // String | End of time range. The default is the current time stamp. Value is in milliseconds since epoch.
    String offset = "offset_example"; // String | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned.
    try {
      ListDataResponse result = apiInstance.listDeviceData(collectionId, deviceId, limit, start, end, offset);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#listDeviceData");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String The collection ID. This is included in the request path.
deviceId String The device ID. This is included in the request path.
limit Integer Limit the number of payloads to return. The default is 512. [optional]
start String Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. [optional]
end String End of time range. The default is the current time stamp. Value is in milliseconds since epoch. [optional]
offset String The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. [optional]

Return type

ListDataResponse

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

listDevices

ListDevicesResponse listDevices(collectionId)

List devices in collection.

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    try {
      ListDevicesResponse result = apiInstance.listDevices(collectionId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#listDevices");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String

Return type

ListDevicesResponse

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

listDownstreamMessages

ListDownstreamMessagesResponse listDownstreamMessages(collectionId, deviceId, limit, start, end, offset)

List the messages in the outbox

List messages that should be sent to the device when it connects to the service. The messages are sent to the device when it connects to the service and either sends a message (via UDP or CoAP) or requests a message via CoAP GET request.option

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String deviceId = "deviceId_example"; // String | 
    Integer limit = 56; // Integer | 
    String start = "start_example"; // String | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch.
    String end = "end_example"; // String | End of time range. The default is the current time stamp. Value is in milliseconds since epoch.
    String offset = "offset_example"; // String | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned.
    try {
      ListDownstreamMessagesResponse result = apiInstance.listDownstreamMessages(collectionId, deviceId, limit, start, end, offset);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#listDownstreamMessages");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String
deviceId String
limit Integer [optional]
start String Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. [optional]
end String End of time range. The default is the current time stamp. Value is in milliseconds since epoch. [optional]
offset String The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. [optional]

Return type

ListDownstreamMessagesResponse

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

listUpstreamMessages

ListUpstreamMessagesResponse listUpstreamMessages(collectionId, deviceId, limit, start, end, offset)

List incoming messages

Retrieve a list of incoming (ie upstream) messages, ie messages sent from the device to the service. These messages are buffered in the service until they expire. Use the query parameters to limit the number of messages to return. If no limit is specified the default limit of 250 is used.

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String deviceId = "deviceId_example"; // String | 
    Integer limit = 56; // Integer | 
    String start = "start_example"; // String | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch.
    String end = "end_example"; // String | End of time range. The default is the current time stamp. Value is in milliseconds since epoch.
    String offset = "offset_example"; // String | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned.
    try {
      ListUpstreamMessagesResponse result = apiInstance.listUpstreamMessages(collectionId, deviceId, limit, start, end, offset);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#listUpstreamMessages");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String
deviceId String
limit Integer [optional]
start String Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. [optional]
end String End of time range. The default is the current time stamp. Value is in milliseconds since epoch. [optional]
offset String The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. [optional]

Return type

ListUpstreamMessagesResponse

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

retrieveDevice

Device retrieveDevice(collectionId, deviceId)

Retrieve device

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | This is the containing collection
    String deviceId = "deviceId_example"; // String | The device identifier
    try {
      Device result = apiInstance.retrieveDevice(collectionId, deviceId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#retrieveDevice");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String This is the containing collection
deviceId String The device identifier

Return type

Device

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

retrieveDeviceStats

DeviceStats retrieveDeviceStats(collectionId, deviceId)

Retrieve device statistics

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String collectionId = "collectionId_example"; // String | This is the containing collection
    String deviceId = "deviceId_example"; // String | The device identifier
    try {
      DeviceStats result = apiInstance.retrieveDeviceStats(collectionId, deviceId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#retrieveDeviceStats");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
collectionId String This is the containing collection
deviceId String The device identifier

Return type

DeviceStats

Authorization

APIToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

updateDevice

Device updateDevice(existingCollectionId, deviceId, body)

Update device

The device can be moved from one collection to another by setting the collection ID field to the new collection. You must have administrative access to both collections. A note on gateway configurations: Empty gateway configuration blocks are deleted. If the configuration block contains a gateway ID it will be updated with the new values. All values must be submitted in the request. If a device is moved out of the collection and it references a gateway in the configuration the operation will fail. Devices that are moved from one collection to another and references gateway configurations must be updated before they are moved.

Example

// Import classes:
import com.lab5e.ApiClient;
import com.lab5e.ApiException;
import com.lab5e.Configuration;
import com.lab5e.auth.*;
import com.lab5e.models.*;
import com.lab5e.span.DevicesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.lab5e.com");
    
    // Configure API key authorization: APIToken
    ApiKeyAuth APIToken = (ApiKeyAuth) defaultClient.getAuthentication("APIToken");
    APIToken.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //APIToken.setApiKeyPrefix("Token");

    DevicesApi apiInstance = new DevicesApi(defaultClient);
    String existingCollectionId = "existingCollectionId_example"; // String | 
    String deviceId = "deviceId_example"; // String | 
    UpdateDeviceBody body = new UpdateDeviceBody(); // UpdateDeviceBody | 
    try {
      Device result = apiInstance.updateDevice(existingCollectionId, deviceId, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling DevicesApi#updateDevice");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
existingCollectionId String
deviceId String
body UpdateDeviceBody

Return type

Device

Authorization

APIToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -