Skip to content

Latest commit

 

History

History
843 lines (686 loc) · 26.6 KB

FotaApi.md

File metadata and controls

843 lines (686 loc) · 26.6 KB

Com.Lab5e.Span.Api.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 (string collectionId, string deviceId)

Clear FOTA error

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class ClearFirmwareErrorExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var collectionId = "collectionId_example";  // string | 
            var deviceId = "deviceId_example";  // string | 

            try
            {
                // Clear FOTA error
                ClearFirmwareErrorResponse result = apiInstance.ClearFirmwareError(collectionId, deviceId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.ClearFirmwareError: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ClearFirmwareErrorWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Clear FOTA error
    ApiResponse<ClearFirmwareErrorResponse> response = apiInstance.ClearFirmwareErrorWithHttpInfo(collectionId, deviceId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.ClearFirmwareErrorWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

CreateFirmware

Firmware CreateFirmware (string collectionId, CreateFirmwareBody 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

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class CreateFirmwareExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var collectionId = "collectionId_example";  // string | 
            var body = new CreateFirmwareBody(); // CreateFirmwareBody | 

            try
            {
                // Create firmware
                Firmware result = apiInstance.CreateFirmware(collectionId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.CreateFirmware: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateFirmwareWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create firmware
    ApiResponse<Firmware> response = apiInstance.CreateFirmwareWithHttpInfo(collectionId, body);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.CreateFirmwareWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

DeleteFirmware

Firmware DeleteFirmware (string collectionId, string imageId)

Delete firmware

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class DeleteFirmwareExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var collectionId = "collectionId_example";  // string | 
            var imageId = "imageId_example";  // string | 

            try
            {
                // Delete firmware
                Firmware result = apiInstance.DeleteFirmware(collectionId, imageId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.DeleteFirmware: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteFirmwareWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete firmware
    ApiResponse<Firmware> response = apiInstance.DeleteFirmwareWithHttpInfo(collectionId, imageId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.DeleteFirmwareWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

FirmwareUsage

FirmwareUsageResponse FirmwareUsage (string collectionId, string imageId)

Firmware usage

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class FirmwareUsageExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var collectionId = "collectionId_example";  // string | 
            var imageId = "imageId_example";  // string | 

            try
            {
                // Firmware usage
                FirmwareUsageResponse result = apiInstance.FirmwareUsage(collectionId, imageId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.FirmwareUsage: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FirmwareUsageWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Firmware usage
    ApiResponse<FirmwareUsageResponse> response = apiInstance.FirmwareUsageWithHttpInfo(collectionId, imageId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.FirmwareUsageWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

ListFirmware

ListFirmwareResponse ListFirmware (string collectionId)

List firmware

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class ListFirmwareExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var collectionId = "collectionId_example";  // string | 

            try
            {
                // List firmware
                ListFirmwareResponse result = apiInstance.ListFirmware(collectionId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.ListFirmware: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListFirmwareWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List firmware
    ApiResponse<ListFirmwareResponse> response = apiInstance.ListFirmwareWithHttpInfo(collectionId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.ListFirmwareWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

RetrieveFirmware

Firmware RetrieveFirmware (string collectionId, string imageId)

Retrieve firmware

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class RetrieveFirmwareExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var collectionId = "collectionId_example";  // string | 
            var imageId = "imageId_example";  // string | 

            try
            {
                // Retrieve firmware
                Firmware result = apiInstance.RetrieveFirmware(collectionId, imageId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.RetrieveFirmware: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RetrieveFirmwareWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Retrieve firmware
    ApiResponse<Firmware> response = apiInstance.RetrieveFirmwareWithHttpInfo(collectionId, imageId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.RetrieveFirmwareWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

RetrieveFirmwareStats

FirmwareStats RetrieveFirmwareStats (string collectionId, string imageId)

Retrieve firmware statistics

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class RetrieveFirmwareStatsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var collectionId = "collectionId_example";  // string | 
            var imageId = "imageId_example";  // string | 

            try
            {
                // Retrieve firmware statistics
                FirmwareStats result = apiInstance.RetrieveFirmwareStats(collectionId, imageId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.RetrieveFirmwareStats: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RetrieveFirmwareStatsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Retrieve firmware statistics
    ApiResponse<FirmwareStats> response = apiInstance.RetrieveFirmwareStatsWithHttpInfo(collectionId, imageId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.RetrieveFirmwareStatsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

UpdateFirmware

Firmware UpdateFirmware (string existingCollectionId, string imageId, UpdateFirmwareBody body)

Update firmware

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class UpdateFirmwareExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new FotaApi(config);
            var existingCollectionId = "existingCollectionId_example";  // string | 
            var imageId = "imageId_example";  // string | 
            var body = new UpdateFirmwareBody(); // UpdateFirmwareBody | 

            try
            {
                // Update firmware
                Firmware result = apiInstance.UpdateFirmware(existingCollectionId, imageId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FotaApi.UpdateFirmware: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UpdateFirmwareWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update firmware
    ApiResponse<Firmware> response = apiInstance.UpdateFirmwareWithHttpInfo(existingCollectionId, imageId, body);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FotaApi.UpdateFirmwareWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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