All URIs are relative to http://api.eliona.io/v2
Method | HTTP request | Description |
---|---|---|
GetAlarmRuleById | Get /alarm-rules/{alarm-rule-id} | Information about an alarm rule |
GetAlarmRules | Get /alarm-rules | Information about alarm rules |
PutAlarmRule | Put /alarm-rules | Create or update an alarm rule |
AlarmRule GetAlarmRuleById(ctx, alarmRuleId).Expansions(expansions).Execute()
Information about an alarm rule
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
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.AlarmRulesApi.GetAlarmRuleById(context.Background(), alarmRuleId).Expansions(expansions).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlarmRulesApi.GetAlarmRuleById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAlarmRuleById`: AlarmRule
fmt.Fprintf(os.Stdout, "Response from `AlarmRulesApi.GetAlarmRuleById`: %v\n", resp)
}
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 are passed through a pointer to a apiGetAlarmRuleByIdRequest 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'. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]AlarmRule GetAlarmRules(ctx).Expansions(expansions).Execute()
Information about alarm rules
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
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.AlarmRulesApi.GetAlarmRules(context.Background()).Expansions(expansions).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlarmRulesApi.GetAlarmRules``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAlarmRules`: []AlarmRule
fmt.Fprintf(os.Stdout, "Response from `AlarmRulesApi.GetAlarmRules`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetAlarmRulesRequest 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'. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PutAlarmRule(ctx).AlarmRule(alarmRule).Execute()
Create or update an alarm rule
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
alarmRule := *openapiclient.NewAlarmRule(int32(4711), openapiclient.DataSubtype("input"), "temperature", openapiclient.AlarmPriority(1)) // AlarmRule |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AlarmRulesApi.PutAlarmRule(context.Background()).AlarmRule(alarmRule).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AlarmRulesApi.PutAlarmRule``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Other parameters are passed through a pointer to a apiPutAlarmRuleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
alarmRule | AlarmRule |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]