Skip to content

Latest commit

 

History

History
628 lines (502 loc) · 20.3 KB

FotaApi.md

File metadata and controls

628 lines (502 loc) · 20.3 KB

FotaApi

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

Method HTTP request Description
clearFirmwareError DELETE /span/collections/{collectionId}/devices/{deviceId}/fwerror Clear FOTA error
createFirmware POST /span/collections/{collectionId}/firmware Create firmware
deleteFirmware DELETE /span/collections/{collectionId}/firmware/{imageId} Delete firmware
firmwareUsage GET /span/collections/{collectionId}/firmware/{imageId}/usage Firmware usage
listFirmware GET /span/collections/{collectionId}/firmware List firmware
retrieveFirmware GET /span/collections/{collectionId}/firmware/{imageId} Retrieve firmware
retrieveFirmwareStats GET /span/collections/{collectionId}/firmware/{imageId}/stats Retrieve firmware statistics
updateFirmware PATCH /span/collections/{existingCollectionId}/firmware/{imageId} Update firmware

clearFirmwareError

ClearFirmwareErrorResponse clearFirmwareError(collectionId, deviceId)

Clear FOTA error

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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String deviceId = "deviceId_example"; // String | 
    try {
      ClearFirmwareErrorResponse result = apiInstance.clearFirmwareError(collectionId, deviceId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#clearFirmwareError");
      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

ClearFirmwareErrorResponse

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. -

createFirmware

Firmware createFirmware(collectionId, body)

Create firmware

Firmware images must have unique version numbers and have an unique checksum. The checksum is calculated when the firmware image is uploaded.

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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    CreateFirmwareBody body = new CreateFirmwareBody(); // CreateFirmwareBody | 
    try {
      Firmware result = apiInstance.createFirmware(collectionId, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#createFirmware");
      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
body CreateFirmwareBody

Return type

Firmware

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. -

deleteFirmware

Firmware deleteFirmware(collectionId, imageId)

Delete firmware

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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String imageId = "imageId_example"; // String | 
    try {
      Firmware result = apiInstance.deleteFirmware(collectionId, imageId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#deleteFirmware");
      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
imageId String

Return type

Firmware

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. -

firmwareUsage

FirmwareUsageResponse firmwareUsage(collectionId, imageId)

Firmware usage

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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String imageId = "imageId_example"; // String | 
    try {
      FirmwareUsageResponse result = apiInstance.firmwareUsage(collectionId, imageId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#firmwareUsage");
      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
imageId String

Return type

FirmwareUsageResponse

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. -

listFirmware

ListFirmwareResponse listFirmware(collectionId)

List firmware

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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    try {
      ListFirmwareResponse result = apiInstance.listFirmware(collectionId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#listFirmware");
      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

ListFirmwareResponse

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. -

retrieveFirmware

Firmware retrieveFirmware(collectionId, imageId)

Retrieve firmware

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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String imageId = "imageId_example"; // String | 
    try {
      Firmware result = apiInstance.retrieveFirmware(collectionId, imageId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#retrieveFirmware");
      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
imageId String

Return type

Firmware

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. -

retrieveFirmwareStats

FirmwareStats retrieveFirmwareStats(collectionId, imageId)

Retrieve firmware 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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String collectionId = "collectionId_example"; // String | 
    String imageId = "imageId_example"; // String | 
    try {
      FirmwareStats result = apiInstance.retrieveFirmwareStats(collectionId, imageId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#retrieveFirmwareStats");
      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
imageId String

Return type

FirmwareStats

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. -

updateFirmware

Firmware updateFirmware(existingCollectionId, imageId, body)

Update firmware

Only the version and tags fields can be updated. The other fields will be ignored.

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.FotaApi;

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");

    FotaApi apiInstance = new FotaApi(defaultClient);
    String existingCollectionId = "existingCollectionId_example"; // String | 
    String imageId = "imageId_example"; // String | 
    UpdateFirmwareBody body = new UpdateFirmwareBody(); // UpdateFirmwareBody | 
    try {
      Firmware result = apiInstance.updateFirmware(existingCollectionId, imageId, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling FotaApi#updateFirmware");
      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
imageId String
body UpdateFirmwareBody

Return type

Firmware

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. -