sitesAlarms := client.SitesAlarms()
SitesAlarms
- Ack Site Alarm
- Ack Site All Alarms
- Ack Site Multiple Alarms
- Count Site Alarms
- Search Site Alarms
- Subscribe Site Alarms
- Unack Site Alarm
- Unack Site All Arlarms
- Unack Site Multiple Alarms
- Unsubscribe Site Alarms
Ack Site Alarm
AckSiteAlarm(
ctx context.Context,
siteId uuid.UUID,
alarmId uuid.UUID,
body *models.NoteString) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
alarmId |
uuid.UUID |
Template, Required | - |
body |
*models.NoteString |
Body, Optional | Request Body |
``
ctx := context.Background()
siteId := 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 := sitesAlarms.AckSiteAlarm(ctx, siteId, 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 Site Alarms
N.B.: Batch size for multiple alarm ack and unack has to be less or or equal to 1000.
AckSiteAllAlarms(
ctx context.Context,
siteId uuid.UUID,
body *models.NoteString) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
body |
*models.NoteString |
Body, Optional | - |
``
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.NoteString{
Note: models.ToPointer("maintenance window"),
}
resp, err := sitesAlarms.AckSiteAllAlarms(ctx, siteId, &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 Site Alarms
AckSiteMultipleAlarms(
ctx context.Context,
siteId uuid.UUID,
body *models.AlarmAck) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
body |
*models.AlarmAck |
Body, Optional | Request Body |
``
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.AlarmAck{
AlarmIds: []uuid.UUID{
uuid.MustParse("ccb8c94d-ca56-4075-932f-1f2ab444ff2c"),
uuid.MustParse("98ff4a3d-ec9b-4138-a42e-54fc3335179d"),
},
Note: models.ToPointer("maintenance window"),
}
resp, err := sitesAlarms.AckSiteMultipleAlarms(ctx, siteId, &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 Site Alarms
CountSiteAlarms(
ctx context.Context,
siteId uuid.UUID,
distinct *models.AlarmCountDisctinctEnum,
ackAdminName *string,
acked *bool,
mType *string,
severity *string,
group *string,
start *int,
end *int,
duration *string,
limit *int,
page *int) (
models.ApiResponse[models.RepsonseCount],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
distinct |
*models.AlarmCountDisctinctEnum |
Query, Optional | Group by and count the alarms by some distinct field Default: "type" |
ackAdminName |
*string |
Query, Optional | Name of the admins who have acked the alarms; accepts multiple values separated by comma |
acked |
*bool |
Query, Optional | - |
mType |
*string |
Query, Optional | Key-name of the alarms; accepts multiple values separated by comma |
severity |
*string |
Query, Optional | Alarm severity; accepts multiple values separated by comma |
group |
*string |
Query, Optional | Alarm group name; accepts multiple values separated by comma |
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()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
distinct := models.AlarmCountDisctinctEnum("type")
duration := "10m"
limit := 100
page := 1
apiResponse, err := sitesAlarms.CountSiteAlarms(ctx, siteId, &distinct, nil, nil, nil, nil, 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 Site Alarms
SearchSiteAlarms(
ctx context.Context,
siteId uuid.UUID,
mType *string,
ackAdminName *string,
acked *bool,
severity *string,
group *string,
limit *int,
start *int,
end *int,
duration *string) (
models.ApiResponse[models.AlarmSearchResult],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
mType |
*string |
Query, Optional | Key-name of the alarms; accepts multiple values separated by comma |
ackAdminName |
*string |
Query, Optional | Name of the admins who have acked the alarms; accepts multiple values separated by comma |
acked |
*bool |
Query, Optional | - |
severity |
*string |
Query, Optional | Alarm severity; accepts multiple values separated by comma |
group |
*string |
Query, Optional | Alarm group name; accepts multiple values separated by comma |
limit |
*int |
Query, Optional | Default: 100 Constraints: >= 0 |
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" |
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
limit := 100
duration := "10m"
apiResponse, err := sitesAlarms.SearchSiteAlarms(ctx, siteId, nil, nil, nil, nil, nil, &limit, nil, nil, &duration)
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 |
Subscribe to Site Alarms
SubscribeSiteAlarms(
ctx context.Context,
siteId uuid.UUID) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
``
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
resp, err := sitesAlarms.SubscribeSiteAlarms(ctx, siteId)
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 Site Alarm
UnackSiteAlarm(
ctx context.Context,
siteId uuid.UUID,
alarmId uuid.UUID,
body *models.NoteString) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
alarmId |
uuid.UUID |
Template, Required | - |
body |
*models.NoteString |
Body, Optional | Request Body |
``
ctx := context.Background()
siteId := 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 := sitesAlarms.UnackSiteAlarm(ctx, siteId, 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 |
Unack all Site Alarms
N.B.: Batch size for multiple alarm ack and unack has to be less or or equal to 1000.
UnackSiteAllArlarms(
ctx context.Context,
siteId uuid.UUID,
body *models.NoteString) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
body |
*models.NoteString |
Body, Optional | Request Body |
``
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.NoteString{
Note: models.ToPointer("maintenance window"),
}
resp, err := sitesAlarms.UnackSiteAllArlarms(ctx, siteId, &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 Site Alarms
UnackSiteMultipleAlarms(
ctx context.Context,
siteId uuid.UUID,
body *models.AlarmAck) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
body |
*models.AlarmAck |
Body, Optional | Request Body |
``
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.AlarmAck{
AlarmIds: []uuid.UUID{
uuid.MustParse("ccb8c94d-ca56-4075-932f-1f2ab444ff2c"),
uuid.MustParse("98ff4a3d-ec9b-4138-a42e-54fc3335179d"),
},
Note: models.ToPointer("maintenance window"),
}
resp, err := sitesAlarms.UnackSiteMultipleAlarms(ctx, siteId, &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 |
Unsubscribe to Site Alarms
UnsubscribeSiteAlarms(
ctx context.Context,
siteId uuid.UUID) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
``
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
resp, err := sitesAlarms.UnsubscribeSiteAlarms(ctx, siteId)
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 |