Skip to content

Latest commit

 

History

History
438 lines (284 loc) · 13.2 KB

DataAPI.md

File metadata and controls

438 lines (284 loc) · 13.2 KB

\DataAPI

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

Method HTTP request Description
GetData Get /data Gets all data
GetDataAggregated Get /data-aggregated Get aggregated data
GetDataTrends Get /data-trends Get trend of historical data
ListenData Get /data-listener WebSocket connection for asset data changes
PutBulkData Put /data-bulk Create or update multiple asset data
PutData Put /data Create or update asset data

GetData

[]Data GetData(ctx).AssetId(assetId).ParentAssetId(parentAssetId).DataSubtype(dataSubtype).AssetTypeName(assetTypeName).Execute()

Gets all data

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	assetId := int32(4711) // int32 | Filter for a specific asset id (optional)
	parentAssetId := int32(4711) // int32 | Filter for a specific parent asset id (optional)
	dataSubtype := "input" // string | Filter for a specific type of asset data (optional)
	assetTypeName := "weather_location" // string | Filter the name of the asset type (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DataAPI.GetData(context.Background()).AssetId(assetId).ParentAssetId(parentAssetId).DataSubtype(dataSubtype).AssetTypeName(assetTypeName).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DataAPI.GetData``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetData`: []Data
	fmt.Fprintf(os.Stdout, "Response from `DataAPI.GetData`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetDataRequest struct via the builder pattern

Name Type Description Notes
assetId int32 Filter for a specific asset id
parentAssetId int32 Filter for a specific parent asset id
dataSubtype string Filter for a specific type of asset data
assetTypeName string Filter the name of the asset type

Return type

[]Data

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetDataAggregated

[]DataAggregated GetDataAggregated(ctx).FromDate(fromDate).ToDate(toDate).AssetId(assetId).DataSubtype(dataSubtype).AssetTypeName(assetTypeName).AggregationId(aggregationId).AggregationRaster(aggregationRaster).Execute()

Get aggregated data

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	fromDate := "2020-01-01T09:00:00.000Z" // string | Filter by lower date time (RFC3339) limit inclusive (optional)
	toDate := "2021-12-31T23:00:00.000Z" // string | Filter by upper date time (RFC3339) limit exclusive (optional)
	assetId := int32(4711) // int32 | Filter for a specific asset id (optional)
	dataSubtype := "input" // string | Filter for a specific type of asset data (optional)
	assetTypeName := "weather_location" // string | Filter the name of the asset type (optional)
	aggregationId := int32(0815) // int32 | Filter for a specific aggregation id (optional)
	aggregationRaster := "DAY" // string | Aggregation calculation interval (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DataAPI.GetDataAggregated(context.Background()).FromDate(fromDate).ToDate(toDate).AssetId(assetId).DataSubtype(dataSubtype).AssetTypeName(assetTypeName).AggregationId(aggregationId).AggregationRaster(aggregationRaster).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DataAPI.GetDataAggregated``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetDataAggregated`: []DataAggregated
	fmt.Fprintf(os.Stdout, "Response from `DataAPI.GetDataAggregated`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetDataAggregatedRequest struct via the builder pattern

Name Type Description Notes
fromDate string Filter by lower date time (RFC3339) limit inclusive
toDate string Filter by upper date time (RFC3339) limit exclusive
assetId int32 Filter for a specific asset id
dataSubtype string Filter for a specific type of asset data
assetTypeName string Filter the name of the asset type
aggregationId int32 Filter for a specific aggregation id
aggregationRaster string Aggregation calculation interval

Return type

[]DataAggregated

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetDataTrends

[]Data GetDataTrends(ctx).FromDate(fromDate).ToDate(toDate).AssetId(assetId).DataSubtype(dataSubtype).AssetTypeName(assetTypeName).Execute()

Get trend of historical data

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	fromDate := "2020-01-01T09:00:00.000Z" // string | Filter by lower date time (RFC3339) limit inclusive (optional)
	toDate := "2021-12-31T23:00:00.000Z" // string | Filter by upper date time (RFC3339) limit exclusive (optional)
	assetId := int32(4711) // int32 | Filter for a specific asset id (optional)
	dataSubtype := "input" // string | Filter for a specific type of asset data (optional)
	assetTypeName := "weather_location" // string | Filter the name of the asset type (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DataAPI.GetDataTrends(context.Background()).FromDate(fromDate).ToDate(toDate).AssetId(assetId).DataSubtype(dataSubtype).AssetTypeName(assetTypeName).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DataAPI.GetDataTrends``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetDataTrends`: []Data
	fmt.Fprintf(os.Stdout, "Response from `DataAPI.GetDataTrends`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetDataTrendsRequest struct via the builder pattern

Name Type Description Notes
fromDate string Filter by lower date time (RFC3339) limit inclusive
toDate string Filter by upper date time (RFC3339) limit exclusive
assetId int32 Filter for a specific asset id
dataSubtype string Filter for a specific type of asset data
assetTypeName string Filter the name of the asset type

Return type

[]Data

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListenData

DataListen ListenData(ctx).AssetId(assetId).DataSubtype(dataSubtype).Execute()

WebSocket connection for asset data changes

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	assetId := int32(4711) // int32 | Filter for a specific asset id (optional)
	dataSubtype := "input" // string | Filter for a specific type of asset data (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DataAPI.ListenData(context.Background()).AssetId(assetId).DataSubtype(dataSubtype).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DataAPI.ListenData``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListenData`: DataListen
	fmt.Fprintf(os.Stdout, "Response from `DataAPI.ListenData`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListenDataRequest struct via the builder pattern

Name Type Description Notes
assetId int32 Filter for a specific asset id
dataSubtype string Filter for a specific type of asset data

Return type

DataListen

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutBulkData

PutBulkData(ctx).Data(data).DirectMode(directMode).Execute()

Create or update multiple asset data

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	data := []openapiclient.Data{*openapiclient.NewData(int32(4711), openapiclient.DataSubtype("input"), map[string]interface{}({}))} // []Data | 
	directMode := "true" // string | Executes the operation directly without using other services. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.DataAPI.PutBulkData(context.Background()).Data(data).DirectMode(directMode).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DataAPI.PutBulkData``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPutBulkDataRequest struct via the builder pattern

Name Type Description Notes
data []Data
directMode string Executes the operation directly without using other services.

Return type

(empty response body)

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutData

PutData(ctx).Data(data).DirectMode(directMode).Execute()

Create or update asset data

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/eliona-smart-building-assistant/go-eliona-api-client/v2"
)

func main() {
	data := *openapiclient.NewData(int32(4711), openapiclient.DataSubtype("input"), map[string]interface{}({})) // Data | 
	directMode := "true" // string | Executes the operation directly without using other services. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.DataAPI.PutData(context.Background()).Data(data).DirectMode(directMode).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DataAPI.PutData``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPutDataRequest struct via the builder pattern

Name Type Description Notes
data Data
directMode string Executes the operation directly without using other services.

Return type

(empty response body)

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]