Categorygithub.com/eliona-smart-building-assistant/go-eliona-api-client

# README

Go API client for api

The Eliona REST API enables unified access to the resources and data of an Eliona environment.

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: 2.6.12
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://eliona.io

Installation

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 api "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value api.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), api.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value api.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), api.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

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 api.ContextOperationServerIndices and api.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), api.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), api.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://name.eliona.io/v2

ClassMethodHTTP requestDescription
AgentsAPIGetAgentByClassAndIdGet /agents/{agent-class}/{agent-id}Information about an agent
AgentsAPIGetAgentDeviceByIdGet /agent-devices/{agent-class}/{agent-device-id}Information about agent device
AgentsAPIGetAgentDeviceMappingByIdGet /agent-device-mappings/{agent-class}/{agent-device-mapping-id}Information about agent device mapping
AgentsAPIGetAgentDeviceMappingsByDeviceIdGet /agent-devices/{agent-class}/{agent-device-id}/mappingsInformation about agent device mappings
AgentsAPIGetAgentDevicesByAgentIdGet /agents/{agent-class}/{agent-id}/devicesInformation about agent devices
AgentsAPIGetAgentsGet /agentsInformation about agents
AgentsAPIGetAgentsByClassGet /agents/{agent-class}Information about agents for a specific class
AgentsAPIPostAgentByClassPost /agents/{agent-class}Create an agent
AgentsAPIPostAgentDeviceByAgentIdPost /agents/{agent-class}/{agent-id}/devicesCreate an agent device
AgentsAPIPostAgentDeviceMappingByDeviceIdPost /agent-devices/{agent-class}/{agent-device-id}/mappingsCreate an agent device mapping
AgentsAPIPutAgentByClassPut /agents/{agent-class}Create or update an agent
AgentsAPIPutAgentByClassAndIdPut /agents/{agent-class}/{agent-id}Update an agent
AgentsAPIPutAgentDeviceByAgentIdPut /agents/{agent-class}/{agent-id}/devicesCreate or update an agent device
AgentsAPIPutAgentDeviceByIdPut /agent-devices/{agent-class}/{agent-device-id}Update an agent device
AgentsAPIPutAgentDeviceMappingByDeviceIdPut /agent-devices/{agent-class}/{agent-device-id}/mappingsCreate or update an agent device mapping
AgentsAPIPutAgentDeviceMappingByIdPut /agent-device-mappings/{agent-class}/{agent-device-mapping-id}Update an agent device mapping
AggregationsAPIDeleteAggregationByIdDelete /aggregations/{aggregation-id}Delete an aggregation
AggregationsAPIGetAggregationByIdGet /aggregations/{aggregation-id}Information about an aggregation
AggregationsAPIGetAggregationsGet /aggregationsInformation about aggregations
AggregationsAPIPostAggregationPost /aggregationsCreates an aggregation
AggregationsAPIPutAggregationPut /aggregationsCreates or updates an aggregation
AggregationsAPIPutAggregationByIdPut /aggregations/{aggregation-id}Updates an aggregation
AlarmRulesAPIDeleteAlarmRuleByIdDelete /alarm-rules/{alarm-rule-id}Delete an alarm rule
AlarmRulesAPIGetAlarmRuleByIdGet /alarm-rules/{alarm-rule-id}Information about an alarm rule
AlarmRulesAPIGetAlarmRulesGet /alarm-rulesInformation about alarm rules
AlarmRulesAPIPostAlarmRulePost /alarm-rulesCreate an alarm rule
AlarmRulesAPIPutAlarmRulePut /alarm-rulesCreate or update an alarm rule
AlarmRulesAPIPutAlarmRuleByIdPut /alarm-rules/{alarm-rule-id}Update an alarm rule
AlarmsAPIGetAlarmByIdGet /alarms/{alarm-rule-id}Information about alarm
AlarmsAPIGetAlarmHistoryByIdGet /alarms-history/{alarm-rule-id}Information about alarm history
AlarmsAPIGetAlarmsGet /alarmsInformation about alarms
AlarmsAPIGetAlarmsHistoryGet /alarms-historyInformation about alarms history
AlarmsAPIGetHighestAlarmsGet /alarms-highestInformation about most prioritized alarms
AlarmsAPIListenAlarmGet /alarm-listenerWebSocket connection for alarm changes
AlarmsAPIPatchAlarmByIdPatch /alarms/{alarm-rule-id}Update alarm
AppsAPIGetAppByNameGet /apps/{app-name}Information about an app
AppsAPIGetPatchByNameGet /apps/{app-name}/patches/{patch-name}Information about a patch for an app
AppsAPIPatchAppByNamePatch /apps/{app-name}Update an app
AppsAPIPatchPatchByNamePatch /apps/{app-name}/patches/{patch-name}Updates a patch
AssetTypesAPIDeleteAssetTypeByNameDelete /asset-types/{asset-type-name}Delete an asset type
AssetTypesAPIGetAssetTypeByNameGet /asset-types/{asset-type-name}Information about an asset type
AssetTypesAPIGetAssetTypesGet /asset-typesList of asset types
AssetTypesAPIPostAssetTypePost /asset-typesCreate an asset type
AssetTypesAPIPostAssetTypeAttributePost /asset-types/{asset-type-name}/attributesCreate asset type attribute
AssetTypesAPIPutAssetTypePut /asset-typesCreate or update an asset type
AssetTypesAPIPutAssetTypeAttributePut /asset-types/{asset-type-name}/attributesCreate or update an asset type attribute
AssetTypesAPIPutAssetTypeByNamePut /asset-types/{asset-type-name}Update an asset type
AssetsAPIDeleteAssetByIdDelete /assets/{asset-id}Delete an asset
AssetsAPIDeleteBulkAssetsDelete /assets-bulkDelete a list of assets
AssetsAPIDryRunDeleteBulkAssetsDelete /assets-bulk/dry-runDry-run for deleting a list of assets
AssetsAPIDryRunPostBulkAssetsPost /assets-bulk/dry-runDry-run for creating a list of assets
AssetsAPIDryRunPutBulkAssetsPut /assets-bulk/dry-runDry-run for creating or updating a list of assets
AssetsAPIGetAssetByIdGet /assets/{asset-id}Information about an asset
AssetsAPIGetAssetsGet /assetsInformation about assets
AssetsAPIGetAttributeDisplayGet /attribute-displayHow attributes are displayed
AssetsAPIListenAssetGet /asset-listenerWebSocket connection for asset changes
AssetsAPIPostAssetPost /assetsCreate an asset
AssetsAPIPostBulkAssetsPost /assets-bulkCreate a list of assets
AssetsAPIPutAssetPut /assetsCreate or update an asset
AssetsAPIPutAssetByIdPut /assets/{asset-id}Update an asset
AssetsAPIPutAttributeDisplayPut /attribute-displayCreate or update how attributes are displayed
AssetsAPIPutBulkAssetsPut /assets-bulkCreate or update a list of assets
CalculationRulesAPIDeleteCalculationRuleByIdDelete /calculation-rules/{calculation-rule-id}Delete a calculation rule
CalculationRulesAPIGetCalculationRuleByIdGet /calculation-rules/{calculation-rule-id}Information about a calculation rules rule
CalculationRulesAPIGetCalculationRulesGet /calculation-rulesInformation about calculation rules
CalculationRulesAPIPutCalculationRulePut /calculation-rulesCreates or updates a calculation rule
CalculationRulesAPIPutCalculationRuleByIdPut /calculation-rules/{calculation-rule-id}Update a calculation rule
CommunicationAPIGetMessageReceiptByIdGet /message-receipts/{message-id}Information about a message
CommunicationAPIPostMailPost /send-mailSend e-mail
CommunicationAPIPostNotificationPost /send-notificationSend notification
DashboardsAPIGetDashboardByIdGet /dashboards/{dashboard-id}Information about a dashboard
DashboardsAPIGetDashboardsGet /dashboardsInformation about dashboards
DashboardsAPIPostDashboardPost /dashboardsCreates a new dashboard
DataAPIGetDataGet /dataGets all data
DataAPIGetDataAggregatedGet /data-aggregatedGet aggregated data
DataAPIGetDataTrendsGet /data-trendsGet trend of historical data
DataAPIListenDataGet /data-listenerWebSocket connection for asset data changes
DataAPIPutBulkDataPut /data-bulkCreate or update multiple asset data
DataAPIPutDataPut /dataCreate or update asset data
NodesAPIGetNodeByIdentGet /nodes/{node-ident}Information about a node
NodesAPIGetNodesGet /nodesInformation about nodes
NodesAPIPostNodePost /nodesCreate a node
NodesAPIPutNodePut /nodesCreate or update a node
NodesAPIPutNodeByIdentPut /nodes/{node-ident}Update a node
ProjectsAPIGetProjectByIdGet /projects/{project-id}Information about a project
ProjectsAPIGetProjectsGet /projectsInformation about projects
ProjectsAPIPutProjectPut /projectsCreate or update a project
QRCodesAPIGetQrCodeByAssetIdGet /qr-codes/assets/{asset-id}QR code for assets
TagsAPIGetTagByNameGet /tags/{tag-name}Information about a tag
TagsAPIGetTagsGet /tagsInformation about tags
TagsAPIPutTagPut /tagsCreate or update a tag
UsersAPIGetUserByIdGet /users/{user-id}Information about an user
UsersAPIGetUsersGet /usersInformation about users
UsersAPIPutUserPut /usersCreate or update an user
VersionAPIGetOpenAPIGet /version/openapi.jsonOpenAPI specification for this API version
VersionAPIGetVersionGet /versionVersion of the API
WidgetsAPIGetDashboardWidgetsGet /dashboards/{dashboard-id}/widgetsInformation about widgets on dashboard
WidgetsAPIPostDashboardWidgetPost /dashboards/{dashboard-id}/widgetsAdds widget to dashboard
WidgetsTypesAPIDeleteWidgetTypeByNameDelete /widget-types/{widget-type-name}Delete a widget type
WidgetsTypesAPIGetWidgetTypeByNameGet /widget-types/{widget-type-name}Information about a widget type
WidgetsTypesAPIGetWidgetTypesGet /widget-typesList of widget types
WidgetsTypesAPIPostWidgetTypePost /widget-typesCreate a widget type
WidgetsTypesAPIPutWidgetTypePut /widget-typesCreate or update a widget type
WidgetsTypesAPIPutWidgetTypeByNamePut /widget-types/{widget-type-name}Update a widget type

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • 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.

Example

auth := context.WithValue(
		context.Background(),
		api.ContextAPIKeys,
		map[string]api.APIKey{
			"X-API-Key": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

BearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), api.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

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

Author

[email protected]

# Packages

No description provided by the author