Skip to content

Latest commit

 

History

History
632 lines (401 loc) · 18.1 KB

AlarmsAPI.md

File metadata and controls

632 lines (401 loc) · 18.1 KB

\AlarmsAPI

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

Method HTTP request Description
DeleteAlarmById Delete /alarms/{alarm-rule-id} Removes an alarm
GetAlarmById Get /alarms/{alarm-rule-id} Information about alarm
GetAlarmHistoryById Get /alarms-history/{alarm-rule-id} Information about alarm history
GetAlarms Get /alarms Information about alarms
GetAlarmsHistory Get /alarms-history Information about alarms history
GetHighestAlarms Get /alarms-highest Information about most prioritized alarms
ListenAlarm Get /alarm-listener WebSocket connection for alarm changes
PatchAlarmById Patch /alarms/{alarm-rule-id} Update alarm
PutAlarm Put /alarms Create or update an alarm

DeleteAlarmById

DeleteAlarmById(ctx, alarmRuleId).Execute()

Removes an alarm

Example

package main

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

func main() {
	alarmRuleId := int32(4711) // int32 | The id of the alarm rule

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
alarmRuleId int32 The id of the alarm rule

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetAlarmById

Alarm GetAlarmById(ctx, alarmRuleId).Expansions(expansions).Execute()

Information about alarm

Example

package main

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

func main() {
	alarmRuleId := int32(4711) // int32 | The id of the alarm rule
	expansions := []string{"Inner_example"} // []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AlarmsAPI.GetAlarmById(context.Background(), alarmRuleId).Expansions(expansions).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AlarmsAPI.GetAlarmById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAlarmById`: Alarm
	fmt.Fprintf(os.Stdout, "Response from `AlarmsAPI.GetAlarmById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
alarmRuleId int32 The id of the alarm rule

Other Parameters

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

Name Type Description Notes

expansions | []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. |

Return type

Alarm

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]

GetAlarmHistoryById

[]Alarm GetAlarmHistoryById(ctx, alarmRuleId).Expansions(expansions).Execute()

Information about alarm history

Example

package main

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

func main() {
	alarmRuleId := int32(4711) // int32 | The id of the alarm rule
	expansions := []string{"Inner_example"} // []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AlarmsAPI.GetAlarmHistoryById(context.Background(), alarmRuleId).Expansions(expansions).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AlarmsAPI.GetAlarmHistoryById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAlarmHistoryById`: []Alarm
	fmt.Fprintf(os.Stdout, "Response from `AlarmsAPI.GetAlarmHistoryById`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
alarmRuleId int32 The id of the alarm rule

Other Parameters

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

Name Type Description Notes

expansions | []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. |

Return type

[]Alarm

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]

GetAlarms

[]Alarm GetAlarms(ctx).ProjectId(projectId).Expansions(expansions).Execute()

Information about alarms

Example

package main

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

func main() {
	projectId := "projectId_example" // string | Filter for a specific project (optional)
	expansions := []string{"Inner_example"} // []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AlarmsAPI.GetAlarms(context.Background()).ProjectId(projectId).Expansions(expansions).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AlarmsAPI.GetAlarms``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAlarms`: []Alarm
	fmt.Fprintf(os.Stdout, "Response from `AlarmsAPI.GetAlarms`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
projectId string Filter for a specific project
expansions []string List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'.

Return type

[]Alarm

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]

GetAlarmsHistory

[]Alarm GetAlarmsHistory(ctx).ProjectId(projectId).Expansions(expansions).Execute()

Information about alarms history

Example

package main

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

func main() {
	projectId := "projectId_example" // string | Filter for a specific project (optional)
	expansions := []string{"Inner_example"} // []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AlarmsAPI.GetAlarmsHistory(context.Background()).ProjectId(projectId).Expansions(expansions).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AlarmsAPI.GetAlarmsHistory``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetAlarmsHistory`: []Alarm
	fmt.Fprintf(os.Stdout, "Response from `AlarmsAPI.GetAlarmsHistory`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
projectId string Filter for a specific project
expansions []string List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'.

Return type

[]Alarm

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]

GetHighestAlarms

[]Alarm GetHighestAlarms(ctx).ProjectId(projectId).Expansions(expansions).Execute()

Information about most prioritized alarms

Example

package main

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

func main() {
	projectId := "projectId_example" // string | Filter for a specific project (optional)
	expansions := []string{"Inner_example"} // []string | List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AlarmsAPI.GetHighestAlarms(context.Background()).ProjectId(projectId).Expansions(expansions).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AlarmsAPI.GetHighestAlarms``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetHighestAlarms`: []Alarm
	fmt.Fprintf(os.Stdout, "Response from `AlarmsAPI.GetHighestAlarms`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
projectId string Filter for a specific project
expansions []string List of referenced data to load, insert or update. Each entry defines the full qualified name of the field to be expanded as follows 'ObjectName.fieldName'.

Return type

[]Alarm

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]

ListenAlarm

AlarmListen ListenAlarm(ctx).Execute()

WebSocket connection for alarm changes

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

AlarmListen

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]

PatchAlarmById

PatchAlarmById(ctx, alarmRuleId).Acknowledged(acknowledged).AcknowledgeText(acknowledgeText).Execute()

Update alarm

Example

package main

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

func main() {
	alarmRuleId := int32(4711) // int32 | The id of the alarm rule
	acknowledged := true // bool | Marks the alarm as acknowledged or not acknowledged by setting the acknowledge timestamp to now or to null.
	acknowledgeText := "acknowledgeText_example" // string | Sets the text for acknowledgement if acknowledged is set to true (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.AlarmsAPI.PatchAlarmById(context.Background(), alarmRuleId).Acknowledged(acknowledged).AcknowledgeText(acknowledgeText).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AlarmsAPI.PatchAlarmById``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
alarmRuleId int32 The id of the alarm rule

Other Parameters

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

Name Type Description Notes

acknowledged | bool | Marks the alarm as acknowledged or not acknowledged by setting the acknowledge timestamp to now or to null. | acknowledgeText | string | Sets the text for acknowledgement if acknowledged is set to true |

Return type

(empty response body)

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

PutAlarm

Alarm PutAlarm(ctx).Alarm(alarm).Execute()

Create or update an alarm

Example

package main

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

func main() {
	alarm := *openapiclient.NewAlarm(int32(123), map[string]interface{}({})) // Alarm | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AlarmsAPI.PutAlarm(context.Background()).Alarm(alarm).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AlarmsAPI.PutAlarm``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PutAlarm`: Alarm
	fmt.Fprintf(os.Stdout, "Response from `AlarmsAPI.PutAlarm`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
alarm Alarm

Return type

Alarm

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

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