Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Latest commit

 

History

History
269 lines (157 loc) · 7.29 KB

DevicesApi.md

File metadata and controls

269 lines (157 loc) · 7.29 KB

\DevicesApi

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

Method HTTP request Description
CreateDevice Post /collections/{collectionId}/devices Create device
DeleteDevice Delete /collections/{collectionId}/devices/{deviceId} Remove device
ListDeviceData Get /collections/{collectionId}/devices/{deviceId}/data Get payloads
ListDevices Get /collections/{collectionId}/devices List devices
RetrieveDevice Get /collections/{collectionId}/devices/{deviceId} Retrieve device
SendMessage Post /collections/{collectionId}/devices/{deviceId}/to Send message
UpdateDevice Patch /collections/{existingCollectionId}/devices/{deviceId} Update device

CreateDevice

Device CreateDevice(ctx, collectionId, body)

Create device

Create a new device. This will add a device to the collection. You must have write access to the collection.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
collectionId string This is the containing collection
body Device

Return type

Device

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]

DeleteDevice

Device DeleteDevice(ctx, collectionId, deviceId)

Remove device

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
collectionId string
deviceId string

Return type

Device

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]

ListDeviceData

ListDataResponse ListDeviceData(ctx, collectionId, deviceId, optional)

Get payloads

List the data received from the device. Use the query parameters to control what data you retrieve.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
collectionId string The collection ID. This is included in the request path.
deviceId string The device ID. This is included in the request path.
optional *ListDeviceDataOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a ListDeviceDataOpts struct

Name Type Description Notes

limit | optional.Int32| Limit the number of payloads to return. The default is 512. | start | optional.String| Start of time range. The default is 24 hours ago. | end | optional.String| End of time range. The default is the current time stamp. |

Return type

ListDataResponse

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]

ListDevices

ListDevicesResponse ListDevices(ctx, collectionId)

List devices

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
collectionId string

Return type

ListDevicesResponse

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]

RetrieveDevice

Device RetrieveDevice(ctx, collectionId, deviceId)

Retrieve device

Retrieve a single device

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
collectionId string
deviceId string

Return type

Device

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]

SendMessage

map[string]interface{} SendMessage(ctx, collectionId, deviceId, body)

Send message

Send a message to the device

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
collectionId string
deviceId string
body SendMessageRequest

Return type

map[string]interface{}

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]

UpdateDevice

Device UpdateDevice(ctx, existingCollectionId, deviceId, body)

Update device

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
existingCollectionId string
deviceId string
body UpdateDeviceRequest

Return type

Device

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]