Skip to content

Latest commit

 

History

History
401 lines (282 loc) · 12.1 KB

FotaApi.md

File metadata and controls

401 lines (282 loc) · 12.1 KB

spanapi.api.FotaApi

Load the API package

import 'package:spanapi/api.dart';

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 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final collectionId = collectionId_example; // String | 
final deviceId = deviceId_example; // String | 

try {
    final result = api_instance.clearFirmwareError(collectionId, deviceId);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->clearFirmwareError: $e\n');
}

Parameters

Name Type Description Notes
collectionId String
deviceId String

Return type

ClearFirmwareErrorResponse

Authorization

APIToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

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 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final collectionId = collectionId_example; // String | 
final body = CreateFirmwareBody(); // CreateFirmwareBody | 

try {
    final result = api_instance.createFirmware(collectionId, body);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->createFirmware: $e\n');
}

Parameters

Name Type Description Notes
collectionId String
body CreateFirmwareBody

Return type

Firmware

Authorization

APIToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteFirmware

Firmware deleteFirmware(collectionId, imageId)

Delete firmware

Example

import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final collectionId = collectionId_example; // String | 
final imageId = imageId_example; // String | 

try {
    final result = api_instance.deleteFirmware(collectionId, imageId);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->deleteFirmware: $e\n');
}

Parameters

Name Type Description Notes
collectionId String
imageId String

Return type

Firmware

Authorization

APIToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firmwareUsage

FirmwareUsageResponse firmwareUsage(collectionId, imageId)

Firmware usage

Example

import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final collectionId = collectionId_example; // String | 
final imageId = imageId_example; // String | 

try {
    final result = api_instance.firmwareUsage(collectionId, imageId);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->firmwareUsage: $e\n');
}

Parameters

Name Type Description Notes
collectionId String
imageId String

Return type

FirmwareUsageResponse

Authorization

APIToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listFirmware

ListFirmwareResponse listFirmware(collectionId)

List firmware

Example

import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final collectionId = collectionId_example; // String | 

try {
    final result = api_instance.listFirmware(collectionId);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->listFirmware: $e\n');
}

Parameters

Name Type Description Notes
collectionId String

Return type

ListFirmwareResponse

Authorization

APIToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveFirmware

Firmware retrieveFirmware(collectionId, imageId)

Retrieve firmware

Example

import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final collectionId = collectionId_example; // String | 
final imageId = imageId_example; // String | 

try {
    final result = api_instance.retrieveFirmware(collectionId, imageId);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->retrieveFirmware: $e\n');
}

Parameters

Name Type Description Notes
collectionId String
imageId String

Return type

Firmware

Authorization

APIToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveFirmwareStats

FirmwareStats retrieveFirmwareStats(collectionId, imageId)

Retrieve firmware statistics

Example

import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final collectionId = collectionId_example; // String | 
final imageId = imageId_example; // String | 

try {
    final result = api_instance.retrieveFirmwareStats(collectionId, imageId);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->retrieveFirmwareStats: $e\n');
}

Parameters

Name Type Description Notes
collectionId String
imageId String

Return type

FirmwareStats

Authorization

APIToken

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

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 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';

final api_instance = FotaApi();
final existingCollectionId = existingCollectionId_example; // String | 
final imageId = imageId_example; // String | 
final body = UpdateFirmwareBody(); // UpdateFirmwareBody | 

try {
    final result = api_instance.updateFirmware(existingCollectionId, imageId, body);
    print(result);
} catch (e) {
    print('Exception when calling FotaApi->updateFirmware: $e\n');
}

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]