orgsAlarms := client.OrgsAlarms()
OrgsAlarms
- Ack Org Alarm
- Ack Org All Alarms
- Ack Org Multiple Alarms
- Count Org Alarms
- Search Org Alarms
- Unack Org All Arlarms
- Unack Org Multiple Alarms
Ack Org Alarm
AckOrgAlarm(
ctx context.Context,
orgId uuid.UUID,
alarmId uuid.UUID,
body *models.NoteString) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
orgId |
uuid.UUID |
Template, Required | - |
alarmId |
uuid.UUID |
Template, Required | - |
body |
*models.NoteString |
Body, Optional | Request Body |
``
ctx := context.Background()
orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
alarmId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.NoteString{
Note: models.ToPointer("maintenance window"),
}
resp, err := orgsAlarms.AckOrgAlarm(ctx, orgId, alarmId, &body)
if err != nil {
log.Fatalln(err)
} else {
fmt.Println(resp.StatusCode)
}
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Bad Syntax | ResponseHttp400Exception |
401 | Unauthorized | ResponseHttp401ErrorException |
403 | Permission Denied | ResponseHttp403ErrorException |
404 | Not found. The API endpoint doesn’t exist or resource doesn’ t exist | ResponseHttp404Exception |
429 | Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold | ResponseHttp429ErrorException |
Ack all Org Alarms
N.B.: Batch size for multiple alarm ack and unack has to be less or or equal to 1000.
AckOrgAllAlarms(
ctx context.Context,
orgId uuid.UUID,
body *models.NoteString) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
orgId |
uuid.UUID |
Template, Required | - |
body |
*models.NoteString |
Body, Optional | - |
``
ctx := context.Background()
orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.NoteString{
Note: models.ToPointer("string"),
}
resp, err := orgsAlarms.AckOrgAllAlarms(ctx, orgId, &body)
if err != nil {
log.Fatalln(err)
} else {
fmt.Println(resp.StatusCode)
}
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Bad Syntax | ResponseHttp400Exception |
401 | Unauthorized | ResponseHttp401ErrorException |
403 | Permission Denied | ResponseHttp403ErrorException |
404 | Not found. The API endpoint doesn’t exist or resource doesn’ t exist | ResponseHttp404Exception |
429 | Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold | ResponseHttp429ErrorException |
Ack multiple Org Alarms
AckOrgMultipleAlarms(
ctx context.Context,
orgId uuid.UUID,
body *models.Alarms) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
orgId |
uuid.UUID |
Template, Required | - |
body |
*models.Alarms |
Body, Optional | Request Body |
``
ctx := context.Background()
orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.Alarms{
AlarmIds: []uuid.UUID{
uuid.MustParse("ccb8c94d-ca56-4075-932f-1f2ab444ff2c"),
uuid.MustParse("98ff4a3d-ec9b-4138-a42e-54fc3335179d"),
},
Note: models.ToPointer("maintenance window"),
}
resp, err := orgsAlarms.AckOrgMultipleAlarms(ctx, orgId, &body)
if err != nil {
log.Fatalln(err)
} else {
fmt.Println(resp.StatusCode)
}
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Bad Syntax | ResponseHttp400Exception |
401 | Unauthorized | ResponseHttp401ErrorException |
403 | Permission Denied | ResponseHttp403ErrorException |
404 | Not found. The API endpoint doesn’t exist or resource doesn’ t exist | ResponseHttp404Exception |
429 | Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold | ResponseHttp429ErrorException |
Count Org Alarms
CountOrgAlarms(
ctx context.Context,
orgId uuid.UUID,
distinct *string,
start *int,
end *int,
duration *string,
limit *int,
page *int) (
models.ApiResponse[models.RepsonseCount],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
orgId |
uuid.UUID |
Template, Required | - |
distinct |
*string |
Query, Optional | - |
start |
*int |
Query, Optional | start datetime, can be epoch or relative time like -1d, -1w; -1d if not specified |
end |
*int |
Query, Optional | end datetime, can be epoch or relative time like -1d, -2h; now if not specified |
duration |
*string |
Query, Optional | duration like 7d, 2w Default: "1d" |
limit |
*int |
Query, Optional | Default: 100 Constraints: >= 0 |
page |
*int |
Query, Optional | Default: 1 Constraints: >= 1 |
ctx := context.Background()
orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
duration := "10m"
limit := 100
page := 1
apiResponse, err := orgsAlarms.CountOrgAlarms(ctx, orgId, nil, nil, nil, &duration, &limit, &page)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
{
"distinct": "string",
"end": 0,
"limit": 0,
"results": [
{
"count": 0,
"property": "string"
}
],
"start": 0,
"total": 0
}
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Bad Syntax | ResponseHttp400Exception |
401 | Unauthorized | ResponseHttp401ErrorException |
403 | Permission Denied | ResponseHttp403ErrorException |
404 | Not found. The API endpoint doesn’t exist or resource doesn’ t exist | ResponseHttp404Exception |
429 | Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold | ResponseHttp429ErrorException |
Search Org Alarms
SearchOrgAlarms(
ctx context.Context,
orgId uuid.UUID,
siteId *uuid.UUID,
mType *string,
start *int,
end *int,
duration *string,
limit *int) (
models.ApiResponse[models.AlarmSearchResult],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
orgId |
uuid.UUID |
Template, Required | - |
siteId |
*uuid.UUID |
Query, Optional | site ID |
mType |
*string |
Query, Optional | alarm type |
start |
*int |
Query, Optional | start datetime, can be epoch or relative time like -1d, -1w; -1d if not specified |
end |
*int |
Query, Optional | end datetime, can be epoch or relative time like -1d, -2h; now if not specified |
duration |
*string |
Query, Optional | duration like 7d, 2w Default: "1d" |
limit |
*int |
Query, Optional | Default: 100 Constraints: >= 0 |
ctx := context.Background()
orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
duration := "10m"
limit := 100
apiResponse, err := orgsAlarms.SearchOrgAlarms(ctx, orgId, nil, nil, nil, nil, &duration, &limit)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Bad Syntax | ResponseHttp400Exception |
401 | Unauthorized | ResponseHttp401ErrorException |
403 | Permission Denied | ResponseHttp403ErrorException |
404 | Not found. The API endpoint doesn’t exist or resource doesn’ t exist | ResponseHttp404Exception |
429 | Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold | ResponseHttp429ErrorException |
Unack all Org Alarms
N.B.: Batch size for multiple alarm ack and unack has to be less or or equal to 1000.
UnackOrgAllArlarms(
ctx context.Context,
orgId uuid.UUID,
body *models.NoteString) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
orgId |
uuid.UUID |
Template, Required | - |
body |
*models.NoteString |
Body, Optional | Request Body |
``
ctx := context.Background()
orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.NoteString{
Note: models.ToPointer("maintenance window"),
}
resp, err := orgsAlarms.UnackOrgAllArlarms(ctx, orgId, &body)
if err != nil {
log.Fatalln(err)
} else {
fmt.Println(resp.StatusCode)
}
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Bad Syntax | ResponseHttp400Exception |
401 | Unauthorized | ResponseHttp401ErrorException |
403 | Permission Denied | ResponseHttp403ErrorException |
404 | Not found. The API endpoint doesn’t exist or resource doesn’ t exist | ResponseHttp404Exception |
429 | Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold | ResponseHttp429ErrorException |
Unack multiple Org Alarms
UnackOrgMultipleAlarms(
ctx context.Context,
orgId uuid.UUID,
body *models.Alarms) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
orgId |
uuid.UUID |
Template, Required | - |
body |
*models.Alarms |
Body, Optional | Request Body |
``
ctx := context.Background()
orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.Alarms{
AlarmIds: []uuid.UUID{
uuid.MustParse("ccb8c94d-ca56-4075-932f-1f2ab444ff2c"),
uuid.MustParse("98ff4a3d-ec9b-4138-a42e-54fc3335179d"),
},
Note: models.ToPointer("maintenance window"),
}
resp, err := orgsAlarms.UnackOrgMultipleAlarms(ctx, orgId, &body)
if err != nil {
log.Fatalln(err)
} else {
fmt.Println(resp.StatusCode)
}
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Bad Syntax | ResponseHttp400Exception |
401 | Unauthorized | ResponseHttp401ErrorException |
403 | Permission Denied | ResponseHttp403ErrorException |
404 | Not found. The API endpoint doesn’t exist or resource doesn’ t exist | ResponseHttp404Exception |
429 | Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold | ResponseHttp429ErrorException |