Skip to content

Latest commit

 

History

History
213 lines (133 loc) · 5.9 KB

AlarmRulesApi.md

File metadata and controls

213 lines (133 loc) · 5.9 KB

\AlarmRulesApi

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

GetAlarmRuleById

AlarmRule GetAlarmRuleById(ctx, alarmRuleId).Expansions(expansions).Execute()

Information about an alarm rule

Example

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)
}

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

Return type

AlarmRule

Authorization

ApiKeyAuth

HTTP request headers

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

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

GetAlarmRules

[]AlarmRule GetAlarmRules(ctx).Expansions(expansions).Execute()

Information about alarm rules

Example

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)
}

Path Parameters

Other Parameters

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

Return type

[]AlarmRule

Authorization

ApiKeyAuth

HTTP request headers

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

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

PutAlarmRule

PutAlarmRule(ctx).AlarmRule(alarmRule).Execute()

Create or update an alarm rule

Example

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)
    }
}

Path Parameters

Other Parameters

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

Name Type Description Notes
alarmRule AlarmRule

Return type

(empty response body)

Authorization

ApiKeyAuth

HTTP request headers

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

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