Skip to content

Latest commit

 

History

History
377 lines (262 loc) · 11.3 KB

GatewaysAPI.md

File metadata and controls

377 lines (262 loc) · 11.3 KB

GatewaysAPI

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

    open class func createGateway(collectionId: String, body: CreateGatewayBody, completion: @escaping (_ data: Gateway?, _ error: Error?) -> Void)

Create gateway

Create a new gateway.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Span

let collectionId = "collectionId_example" // String | 
let body = CreateGatewayBody(name: "name_example", type: GatewayType(), config: GatewayConfig(ciot: GatewayCIoTConfig(apn: "apn_example", udpEndpoint: "udpEndpoint_example", coapEndpoint: "coapEndpoint_example"), inet: GatewayInetConfig(dtlsEndpoint: "dtlsEndpoint_example", coapEndpoint: "coapEndpoint_example", mqttEndpoint: "mqttEndpoint_example"), user: GatewayCustomConfig(params: "TODO")), tags: "TODO") // CreateGatewayBody | 

// Create gateway
GatewaysAPI.createGateway(collectionId: collectionId, body: body) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

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

    open class func deleteGateway(collectionId: String, gatewayId: String, completion: @escaping (_ data: Gateway?, _ error: Error?) -> Void)

Delete gateway

Remove a gateway from Span.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Span

let collectionId = "collectionId_example" // String | 
let gatewayId = "gatewayId_example" // String | 

// Delete gateway
GatewaysAPI.deleteGateway(collectionId: collectionId, gatewayId: gatewayId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

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

    open class func gatewayCertificates(collectionId: String, gatewayId: String, completion: @escaping (_ data: GatewayCertificateResponse?, _ error: Error?) -> Void)

Get issued certificate(s) for gateway

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Span

let collectionId = "collectionId_example" // String | 
let gatewayId = "gatewayId_example" // String | 

// Get issued certificate(s) for gateway
GatewaysAPI.gatewayCertificates(collectionId: collectionId, gatewayId: gatewayId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

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

    open class func listGateways(collectionId: String, completion: @escaping (_ data: ListGatewayResponse?, _ error: Error?) -> Void)

List gateways

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

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Span

let collectionId = "collectionId_example" // String | 

// List gateways
GatewaysAPI.listGateways(collectionId: collectionId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

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

    open class func retrieveGateway(collectionId: String, gatewayId: String, completion: @escaping (_ data: Gateway?, _ error: Error?) -> Void)

Retrieve gateway

Get gateway information

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Span

let collectionId = "collectionId_example" // String | 
let gatewayId = "gatewayId_example" // String | 

// Retrieve gateway
GatewaysAPI.retrieveGateway(collectionId: collectionId, gatewayId: gatewayId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

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

    open class func retrieveGatewayStats(collectionId: String, gatewayId: String, completion: @escaping (_ data: GatewayStats?, _ error: Error?) -> Void)

Retrieve gateway statistics

Get statistics for gateway

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Span

let collectionId = "collectionId_example" // String | 
let gatewayId = "gatewayId_example" // String | 

// Retrieve gateway statistics
GatewaysAPI.retrieveGatewayStats(collectionId: collectionId, gatewayId: gatewayId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

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

    open class func updateGateway(existingCollectionId: String, gatewayId: String, body: UpdateGatewayBody, completion: @escaping (_ data: Gateway?, _ error: Error?) -> Void)

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

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import Span

let existingCollectionId = "existingCollectionId_example" // String | 
let gatewayId = "gatewayId_example" // String | 
let body = UpdateGatewayBody(name: "name_example", collectionId: "collectionId_example", type: GatewayType(), config: GatewayConfig(ciot: GatewayCIoTConfig(apn: "apn_example", udpEndpoint: "udpEndpoint_example", coapEndpoint: "coapEndpoint_example"), inet: GatewayInetConfig(dtlsEndpoint: "dtlsEndpoint_example", coapEndpoint: "coapEndpoint_example", mqttEndpoint: "mqttEndpoint_example"), user: GatewayCustomConfig(params: "TODO")), tags: "TODO", enabled: false) // UpdateGatewayBody | 

// Update gateway
GatewaysAPI.updateGateway(existingCollectionId: existingCollectionId, gatewayId: gatewayId, body: body) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

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]