Skip to content

Latest commit

 

History

History
361 lines (252 loc) · 10.9 KB

GatewaysApi.md

File metadata and controls

361 lines (252 loc) · 10.9 KB

spanapi.api.GatewaysApi

Load the API package

import 'package:spanapi/api.dart';

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

Method HTTP request Description
createGateway POST /span/collections/{collectionId}/gateways Create gateway
deleteGateway DELETE /span/collections/{collectionId}/gateways/{gatewayId} Delete gateway
gatewayCertificates GET /span/collections/{collectionId}/gateways/{gatewayId}/certs Get issued certificate(s) for gateway
listGateways GET /span/collections/{collectionId}/gateways List gateways
retrieveGateway GET /span/collections/{collectionId}/gateways/{gatewayId} Retrieve gateway
retrieveGatewayStats GET /span/collections/{collectionId}/gateways/{gatewayId}/stats Retrieve gateway statistics
updateGateway PATCH /span/collections/{existingCollectionId}/gateways/{gatewayId} Update gateway

createGateway

Gateway createGateway(collectionId, body)

Create gateway

Create a new gateway.

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 = GatewaysApi();
final collectionId = collectionId_example; // String | 
final body = CreateGatewayBody(); // CreateGatewayBody | 

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

Parameters

Name Type Description Notes
collectionId String
body CreateGatewayBody

Return type

Gateway

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]

deleteGateway

Gateway deleteGateway(collectionId, gatewayId)

Delete gateway

Remove a gateway from Span.

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 = GatewaysApi();
final collectionId = collectionId_example; // String | 
final gatewayId = gatewayId_example; // String | 

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

Parameters

Name Type Description Notes
collectionId String
gatewayId String

Return type

Gateway

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]

gatewayCertificates

GatewayCertificateResponse gatewayCertificates(collectionId, gatewayId)

Get issued certificate(s) for gateway

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 = GatewaysApi();
final collectionId = collectionId_example; // String | 
final gatewayId = gatewayId_example; // String | 

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

Parameters

Name Type Description Notes
collectionId String
gatewayId String

Return type

GatewayCertificateResponse

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]

listGateways

ListGatewayResponse listGateways(collectionId)

List gateways

List the user's gatways, including built-in gateways.

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 = GatewaysApi();
final collectionId = collectionId_example; // String | 

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

Parameters

Name Type Description Notes
collectionId String

Return type

ListGatewayResponse

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]

retrieveGateway

Gateway retrieveGateway(collectionId, gatewayId)

Retrieve gateway

Get gateway information

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 = GatewaysApi();
final collectionId = collectionId_example; // String | 
final gatewayId = gatewayId_example; // String | 

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

Parameters

Name Type Description Notes
collectionId String
gatewayId String

Return type

Gateway

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]

retrieveGatewayStats

GatewayStats retrieveGatewayStats(collectionId, gatewayId)

Retrieve gateway statistics

Get statistics for gateway

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 = GatewaysApi();
final collectionId = collectionId_example; // String | 
final gatewayId = gatewayId_example; // String | 

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

Parameters

Name Type Description Notes
collectionId String
gatewayId String

Return type

GatewayStats

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]

updateGateway

Gateway updateGateway(existingCollectionId, gatewayId, body)

Update gateway

Update configuration for a gateway. If you want to remove or move a gateway from the collection the devices in the collection must not have any gateway configuration. The certificates for the gateway are unchanged when the gateway is moved.

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 = GatewaysApi();
final existingCollectionId = existingCollectionId_example; // String | 
final gatewayId = gatewayId_example; // String | 
final body = UpdateGatewayBody(); // UpdateGatewayBody | 

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

Parameters

Name Type Description Notes
existingCollectionId String
gatewayId String
body UpdateGatewayBody

Return type

Gateway

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]