This is an OmniCore Model and State Management server.
- API version: 1.8.18
- Package version: 1.8.18
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit http://www.korewireless.com
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import OmniCore "github.com/korewireless/OmniCore-Go-SDK"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
For using other server than the one defined on index 0 set context value sw.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), OmniCore.ContextServerIndex, 1)
Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), OmniCore.ContextServerVariables, map[string]string{
"basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
Each operation can use different server URL defined using OperationServers
map in the Configuration
.
An operation is uniquely identified by "{classname}Service.{nickname}"
string.
Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices
and sw.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), OmniCore.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), OmniCore.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
All URIs are relative to https://api.korewireless.com
Class | Method | HTTP request | Description |
---|---|---|---|
DeviceApi | BindDevice | Post /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/bindDeviceToGateway | |
DeviceApi | BindDevices | Post /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/bindDevicesToGateway | |
DeviceApi | BlockDeviceCommuncation | Put /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/communication | |
DeviceApi | CreateDevice | Post /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices | |
DeviceApi | DeleteDevice | Delete /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId} | |
DeviceApi | GetConfig | Get /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/configVersions | |
DeviceApi | GetDevice | Get /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId} | |
DeviceApi | GetDevices | Get /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices | |
DeviceApi | GetDevicesLastSeen | Get /omnicore/subscriptions/{subscriptionId}/devices | |
DeviceApi | GetStates | Get /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/states | |
DeviceApi | SendCommandToDevice | Post /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/sendCommandToDevice | |
DeviceApi | UnBindDevice | Post /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/unbindDeviceFromGateway | |
DeviceApi | UnBindDevices | Post /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/unbindDevicesFromGateway | |
DeviceApi | UpdateConfigurationToDevice | Post /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/updateConfigurationToDevice | |
DeviceApi | UpdateCustomOnboardRequest | Post /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/updateCustomOnboardRequest | |
DeviceApi | UpdateDevice | Patch /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId} | |
MetricsApi | GetMetrics | Get /omnicore/subscriptions/{subscriptionId}/metrics | |
RegistryApi | CreateRegistry | Post /omnicore/subscriptions/{subscriptionId}/registries | |
RegistryApi | DeleteRegistry | Delete /omnicore/subscriptions/{subscriptionId}/registries/{registryId} | |
RegistryApi | GetRegistries | Get /omnicore/subscriptions/{subscriptionId}/registries | |
RegistryApi | GetRegistry | Get /omnicore/subscriptions/{subscriptionId}/registries/{registryId} | |
RegistryApi | SendBroadcastToDevices | Post /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/sendBroadcastToDevice | |
RegistryApi | UpdateRegistry | Patch /omnicore/subscriptions/{subscriptionId}/registries/{registryId} | |
SinkApi | CreateSink | Post /omnicore/subscriptions/{subscriptionId}/sinks | |
SinkApi | DeleteSink | Delete /omnicore/subscriptions/{subscriptionId}/sinks/{sinkId} | |
SinkApi | GetSink | Get /omnicore/subscriptions/{subscriptionId}/sinks/{sinkId} | |
SinkApi | GetSinks | Get /omnicore/subscriptions/{subscriptionId}/sinks | Get All Sinks |
VaultApi | CreateVaultConfiguration | Post /vault/subscriptions/{subscriptionid}/configurations | |
VaultApi | CreateVaultKey | Post /vault/subscriptions/{subscriptionid}/encryptionkeys | |
VaultApi | DeleteConfiguration | Delete /vault/subscriptions/{subscriptionid}/configurations/{configid} | |
VaultApi | DeleteVaultKey | Delete /vault/subscriptions/{subscriptionid}/encryptionkeys/{keyid} | |
VaultApi | EnableEncryption | Post /vault/subscriptions/{subscriptionid}/encryption | |
VaultApi | GetExports | Get /vault/subscriptions/{subscriptionid}/exports | |
VaultApi | GetRegistryData | Get /vault/subscriptions/{subscriptionid}/folders | |
VaultApi | GetReplays | Get /vault/subscriptions/{subscriptionid}/replays | |
VaultApi | GetVaultAudit | Get /vault/subscriptions/{subscriptionid}/audit | |
VaultApi | GetVaultConfigurations | Get /vault/subscriptions/{subscriptionid}/configurations | |
VaultApi | GetVaultFiles | Get /vault/subscriptions/{subscriptionid}/registry/{registryid}/files | |
VaultApi | GetVaultKeys | Get /vault/subscriptions/{subscriptionid}/encryptionkeys | |
VaultApi | GetVaultMetrics | Get /vault/subscriptions/{subscriptionid}/metrics | |
VaultApi | GetVaultStatus | Get /vault/subscriptions/{subscriptionid}/status | |
VaultApi | SetRetention | Post /vault/subscriptions/{subscriptionid}/retention | |
VaultApi | StartExport | Post /vault/subscriptions/{subscriptionid}/exports | |
VaultApi | StartReplay | Post /vault/subscriptions/{subscriptionid}/replays |
- Audit
- AuditResult
- BindRequest
- BindRequestIdsGateway
- BlockCommunicationBody
- Config
- Configurations
- CreateConfiguration
- CreateVaultKeyBody
- CustomOnboard
- Device
- DeviceCommand
- DeviceConfig
- DeviceConfiguration
- DeviceCredential
- DeviceOnline
- DeviceRegistry
- DeviceState
- DeviceTcpUdpModelDetails
- EnableEncryptionBody
- ErrorFrame
- ErrorStatus
- EventNotificationConfig
- ExportDetail
- FileDetail
- FileDetails
- Folder
- FolderData
- Frame
- GatewayConfig
- GenericErrorResponse
- GetExportsResponse
- GetKeysResponse
- GetReplaysResponse
- HttpConfig
- Info
- ListDeviceConfigVersionsResponse
- ListDeviceRegistries
- ListDeviceStatesResponse
- ListDevicesOnlineResponse
- ListDevicesResponse
- ListSinks
- LogLevel
- Metrics
- MetricsData
- MetricsDetails
- MetricsLogs
- MetricsResponse
- MetricsResponseDetails
- MqttConfig
- NotificationConfig
- OperationMetrics
- Policy
- PublicKeyCertificate
- PublicKeyCredential
- RegistryCredential
- Replay
- ReplayBody
- SetRetentionBody
- Sink
- StartExportBody
- TcpUdpImage
- TcpUdpModel
- TcpUdpPortDetail
- VaultConfiguration
- VaultEncryptionKey
- VaultStatus
- VaultStatusDetails
- X509CertificateDetails
- Type: HTTP Bearer token authentication
Example
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
Note, each API key must be added to a map of map[string]APIKey
where the key is: x-api-key and passed in as the auth context for each request.
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBool
PtrInt
PtrInt32
PtrInt64
PtrFloat
PtrFloat32
PtrFloat64
PtrString
PtrTime