Skip to content

Latest commit

 

History

History
744 lines (603 loc) · 25.8 KB

File metadata and controls

744 lines (603 loc) · 25.8 KB

Com.Lab5e.Span.Api.CollectionsApi

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

Method HTTP request Description
CreateCollection POST /span/collections Create collection
DeleteCollection DELETE /span/collections/{collectionId} Delete collection
ListCollectionData GET /span/collections/{collectionId}/data Retrieve data from devices
ListCollections GET /span/collections List collections
RetrieveCollection GET /span/collections/{collectionId} Retrieve collection
RetrieveCollectionStats GET /span/collections/{collectionId}/stats Retrieve collection statistics
UpdateCollection PATCH /span/collections/{collectionId} Update collection

CreateCollection

Collection CreateCollection (CreateCollectionRequest body)

Create collection

Create a new collection

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 CreateCollectionExample
    {
        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 CollectionsApi(config);
            var body = new CreateCollectionRequest(); // CreateCollectionRequest | Request object when creating a collection. The collect ID is assigned by the service.

            try
            {
                // Create collection
                Collection result = apiInstance.CreateCollection(body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CollectionsApi.CreateCollection: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateCollectionWithHttpInfo variant

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

try
{
    // Create collection
    ApiResponse<Collection> response = apiInstance.CreateCollectionWithHttpInfo(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 CollectionsApi.CreateCollectionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
body CreateCollectionRequest Request object when creating a collection. The collect ID is assigned by the service.

Return type

Collection

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]

DeleteCollection

Collection DeleteCollection (string collectionId)

Delete collection

Remove the collection. Devices, firmware images, outputs and all other related resources must be removed from the collection before it can be deleted.

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 DeleteCollectionExample
    {
        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 CollectionsApi(config);
            var collectionId = "collectionId_example";  // string | The ID of the collection you want to delete

            try
            {
                // Delete collection
                Collection result = apiInstance.DeleteCollection(collectionId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CollectionsApi.DeleteCollection: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteCollectionWithHttpInfo variant

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

try
{
    // Delete collection
    ApiResponse<Collection> response = apiInstance.DeleteCollectionWithHttpInfo(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 CollectionsApi.DeleteCollectionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string The ID of the collection you want to delete

Return type

Collection

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]

ListCollectionData

ListDataResponse ListCollectionData (string collectionId, int? limit = null, string? start = null, string? end = null, string? offset = null)

Retrieve data from devices

Retrieve data sent by the devices in the collection. The maximum number of data points is 100.

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 ListCollectionDataExample
    {
        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 CollectionsApi(config);
            var collectionId = "collectionId_example";  // string | The collection ID requested. This is included in the request path.
            var limit = 56;  // int? | Limit the number of payloads to return. The default is 512. (optional) 
            var start = "start_example";  // string? | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. (optional) 
            var end = "end_example";  // string? | End of time range. The default is the current time stamp. Value is in milliseconds since epoch. (optional) 
            var 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. (optional) 

            try
            {
                // Retrieve data from devices
                ListDataResponse result = apiInstance.ListCollectionData(collectionId, limit, start, end, offset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CollectionsApi.ListCollectionData: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListCollectionDataWithHttpInfo variant

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

try
{
    // Retrieve data from devices
    ApiResponse<ListDataResponse> response = apiInstance.ListCollectionDataWithHttpInfo(collectionId, limit, start, end, offset);
    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 CollectionsApi.ListCollectionDataWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string The collection ID requested. This is included in the request path.
limit int? 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. -

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

ListCollections

ListCollectionResponse ListCollections ()

List collections

Lists all the collections that one of your teams owns. The collections returned includes only the data on the collection and not the summary information

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 ListCollectionsExample
    {
        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 CollectionsApi(config);

            try
            {
                // List collections
                ListCollectionResponse result = apiInstance.ListCollections();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CollectionsApi.ListCollections: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListCollectionsWithHttpInfo variant

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

try
{
    // List collections
    ApiResponse<ListCollectionResponse> response = apiInstance.ListCollectionsWithHttpInfo();
    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 CollectionsApi.ListCollectionsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

ListCollectionResponse

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]

RetrieveCollection

Collection RetrieveCollection (string collectionId, bool? upstream = null, bool? downstream = null)

Retrieve collection

Retrieve collection information. This includes a list of the most recent messages in the inbox. The upstream and downstream parameters are optional and if set to true will include the timestamps for up to 100 messages up- and downstream for the last hour.

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 RetrieveCollectionExample
    {
        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 CollectionsApi(config);
            var collectionId = "collectionId_example";  // string | The collection ID of the collection you are requesting
            var upstream = true;  // bool? |  (optional) 
            var downstream = true;  // bool? |  (optional) 

            try
            {
                // Retrieve collection
                Collection result = apiInstance.RetrieveCollection(collectionId, upstream, downstream);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CollectionsApi.RetrieveCollection: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RetrieveCollectionWithHttpInfo variant

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

try
{
    // Retrieve collection
    ApiResponse<Collection> response = apiInstance.RetrieveCollectionWithHttpInfo(collectionId, upstream, downstream);
    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 CollectionsApi.RetrieveCollectionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string The collection ID of the collection you are requesting
upstream bool? [optional]
downstream bool? [optional]

Return type

Collection

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]

RetrieveCollectionStats

CollectionStats RetrieveCollectionStats (string collectionId)

Retrieve collection statistics

Retrieve statistics for the collection. This is the aggregated metrics for devices, outputs, firmware images, blobs and gateways in the collection

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 RetrieveCollectionStatsExample
    {
        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 CollectionsApi(config);
            var collectionId = "collectionId_example";  // string | The collection ID of the collection you are requesting

            try
            {
                // Retrieve collection statistics
                CollectionStats result = apiInstance.RetrieveCollectionStats(collectionId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CollectionsApi.RetrieveCollectionStats: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RetrieveCollectionStatsWithHttpInfo variant

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

try
{
    // Retrieve collection statistics
    ApiResponse<CollectionStats> response = apiInstance.RetrieveCollectionStatsWithHttpInfo(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 CollectionsApi.RetrieveCollectionStatsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string The collection ID of the collection you are requesting

Return type

CollectionStats

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]

UpdateCollection

Collection UpdateCollection (string collectionId, UpdateCollectionBody body)

Update collection

Update a collection.

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 UpdateCollectionExample
    {
        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 CollectionsApi(config);
            var collectionId = "collectionId_example";  // string | The ID of the collection. This is assigned by the backend.
            var body = new UpdateCollectionBody(); // UpdateCollectionBody | 

            try
            {
                // Update collection
                Collection result = apiInstance.UpdateCollection(collectionId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling CollectionsApi.UpdateCollection: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UpdateCollectionWithHttpInfo variant

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

try
{
    // Update collection
    ApiResponse<Collection> response = apiInstance.UpdateCollectionWithHttpInfo(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 CollectionsApi.UpdateCollectionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string The ID of the collection. This is assigned by the backend.
body UpdateCollectionBody

Return type

Collection

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]