# README
Go API client for spanclient
API for device, collection, output and firmware management
Overview
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 4.1.3 factual-kahlil
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://lab5e.com/span
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional
Put the package under your project folder and add the following in import:
import "./spanclient"
Documentation for API Endpoints
All URIs are relative to https://api.lab5e.com/span
Class | Method | HTTP request | Description |
---|---|---|---|
CollectionsApi | BroadcastMessage | Post /collections/{collectionId}/to | Broadcast message |
CollectionsApi | CreateCollection | Post /collections | Create collection |
CollectionsApi | DeleteCollection | Delete /collections/{collectionId} | Delete collection |
CollectionsApi | ListCollectionData | Get /collections/{collectionId}/data | Get payloads |
CollectionsApi | ListCollections | Get /collections | List collections |
CollectionsApi | RetrieveCollection | Get /collections/{collectionId} | Retrieve collection |
CollectionsApi | UpdateCollection | Patch /collections/{collectionId} | Update collection |
DatadumpApi | DataDump | Post /datadump | Data dump |
DevicesApi | CreateDevice | Post /collections/{collectionId}/devices | Create device |
DevicesApi | DeleteDevice | Delete /collections/{collectionId}/devices/{deviceId} | Remove device |
DevicesApi | ListDeviceData | Get /collections/{collectionId}/devices/{deviceId}/data | Get payloads |
DevicesApi | ListDevices | Get /collections/{collectionId}/devices | List devices |
DevicesApi | RetrieveDevice | Get /collections/{collectionId}/devices/{deviceId} | Retrieve device |
DevicesApi | SendMessage | Post /collections/{collectionId}/devices/{deviceId}/to | Send message |
DevicesApi | UpdateDevice | Patch /collections/{existingCollectionId}/devices/{deviceId} | Update device |
FotaApi | ClearFirmwareError | Delete /collections/{collectionId}/devices/{deviceId}/fwerror | Clear FOTA error |
FotaApi | CreateFirmware | Post /collections/{collectionId}/firmware | Create firmware |
FotaApi | DeleteFirmware | Delete /collections/{collectionId}/firmware/{imageId} | Delete firmware |
FotaApi | FirmwareUsage | Patch /collections/{collectionId}/firmware/{imageId}/usage | Firmware usage |
FotaApi | ListFirmware | Get /collections/{collectionId}/firmware | List firmware |
FotaApi | RetrieveFirmware | Get /collections/{collectionId}/firmware/{imageId} | Retrieve firmware |
FotaApi | UpdateFirmware | Patch /collections/{collectionId}/firmware/{imageId} | Update firmware |
OutputsApi | CreateOutput | Post /collections/{collectionId}/outputs | Create output |
OutputsApi | DeleteOutput | Delete /collections/{collectionId}/outputs/{outputId} | Delete output |
OutputsApi | ListOutputs | Get /collections/{collectionId}/outputs | List outputs |
OutputsApi | Logs | Get /collections/{collectionId}/outputs/{outputId}/logs | Output logs |
OutputsApi | RetrieveOutput | Get /collections/{collectionId}/outputs/{outputId} | Retrieve output |
OutputsApi | Status | Get /collections/{collectionId}/outputs/{outputId}/status | Output status |
OutputsApi | UpdateOutput | Patch /collections/{collectionId}/outputs/{outputId} | Update output |
SystemApi | GetSystemInfo | Get /system | System information |
Documentation For Models
- CoApMetadata
- Collection
- CollectionFirmware
- CollectionFirmwareFirmwareManagement
- CreateFirmwareRequest
- DataDumpResponse
- Device
- DumpedCollection
- DumpedDevice
- FieldMask
- Firmware
- FirmwareMetadata
- FirmwareUsageResponse
- ListCollectionResponse
- ListDataResponse
- ListDevicesResponse
- ListFirmwareResponse
- ListOutputResponse
- MessageSendResult
- MultiSendMessageResponse
- NetworkMetadata
- Output
- OutputConfig
- OutputDataMessage
- OutputDataMessageOutputMessageType
- OutputLogEntry
- OutputLogs
- OutputStatus
- OutputType
- ProtobufAny
- RuntimeError
- RuntimeStreamError
- SendMessageRequest
- SystemInfoResponse
- UdpMetadata
- UpdateDeviceRequest
Documentation For Authorization
APIToken
- Type: API key
Example
auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
Key: "APIKEY",
Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)
Author
# Packages
No description provided by the author
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewAuthContext is a convenience method to create an authentication context with an API key.
NewCollectionDataStream creates a live data stream for devices in a collection.
NewConfiguration returns a new Configuration object.
NewDeviceDataStream creates a live data stream for a single device.
# Constants
List of CollectionFirmwareFirmwareManagement.
List of OutputDataMessageOutputMessageType.
List of CollectionFirmwareFirmwareManagement.
List of CollectionFirmwareFirmwareManagement.
List of OutputType.
List of OutputDataMessageOutputMessageType.
List of OutputType.
List of OutputType.
List of OutputType.
List of OutputDataMessageOutputMessageType.
List of CollectionFirmwareFirmwareManagement.
List of OutputType.
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
# Structs
APIClient manages communication with the The Span API API v4.1.3 factual-kahlil In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
CoApMetadata struct for CoApMetadata.
Collection struct for Collection.
CollectionFirmware struct for CollectionFirmware.
Configuration stores the configuration of the API client.
CreateFirmwareRequest struct for CreateFirmwareRequest.
DataDumpResponse struct for DataDumpResponse.
Device struct for Device.
DumpedCollection struct for DumpedCollection.
DumpedDevice struct for DumpedDevice.
FieldMask struct for FieldMask.
Firmware Firmware images aren't served back out through the API, only the metadata.
FirmwareMetadata Metadata about firmware on devices.
FirmwareUsageResponse struct for FirmwareUsageResponse.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
ListCollectionDataOpts Optional parameters for the method 'ListCollectionData'.
ListCollectionResponse Collection list.
ListDataResponse struct for ListDataResponse.
ListDeviceDataOpts Optional parameters for the method 'ListDeviceData'.
ListDevicesResponse struct for ListDevicesResponse.
ListFirmwareResponse struct for ListFirmwareResponse.
ListOutputResponse struct for ListOutputResponse.
MessageSendResult struct for MessageSendResult.
MultiSendMessageResponse Broadcast message result.
NetworkMetadata Network metadata for devices.
Output struct for Output.
OutputConfig Output configuration.
OutputDataMessage The output data message contains payload plus metadata for a payload received from a device.
OutputLogEntry struct for OutputLogEntry.
OutputLogs struct for OutputLogs.
OutputStatus struct for OutputStatus.
ProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message.
RuntimeError struct for RuntimeError.
RuntimeStreamError struct for RuntimeStreamError.
SendMessageRequest struct for SendMessageRequest.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
SystemInfoResponse struct for SystemInfoResponse.
UdpMetadata struct for UdpMetadata.
UpdateDeviceRequest struct for UpdateDeviceRequest.
# Interfaces
DataStream is a stream of data from the Span service.
# Type aliases
CollectionFirmwareFirmwareManagement The firmware management settings for a collection can either be \"disabled\", ie there is no firmware management for this collection, \"collection\"; devices are managed through the settings on the collection or \"device\" where each device is configured individual.
CollectionsApiService CollectionsApi service.
DatadumpApiService DatadumpApi service.
DevicesApiService DevicesApi service.
FotaApiService FotaApi service.
OutputDataMessageOutputMessageType the model 'OutputDataMessageOutputMessageType'.
OutputsApiService OutputsApi service.
OutputType the model 'OutputType'.
SystemApiService SystemApi service.