Modify a Mute Rule¶
POST /api/v1/monitor/mute/{obj_uuid}/modify
Overview¶
Modify a mute rule
Route Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
obj_uuid | string | Y | ID of the mute configuration |
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
name | string | Rule name Example: Name A Allow empty: False |
|
description | string | Description Example: Description A Allow empty: False Allow empty string: True |
|
tags | json | Set of tags Allow empty: False |
|
filterString | string | Event properties Allow empty: False Allow empty string: True Maximum length: 2048 |
|
muteRanges | array | Mute ranges Example: Monitor A Allow empty: False |
|
notifyTargets | array | Notification targets Allow empty: False |
|
notifyMessage | string | Notification message Allow empty: False Maximum length: 3000 |
|
notifyTimeStr | string | Notification time, %Y/%m/%d %H:%M:%S Example: 2023/08/21 19:19:00 Allow empty: False Allow empty string: True |
|
startTime | string | Start time %Y/%m/%d %H:%M:%S Example: 2023/08/21 19:19:00 Allow empty: False |
|
endTime | string | End time %Y/%m/%d %H:%M:%S Example: 2023/08/21 19:19:00 Allow empty: False Allow empty string: True |
|
repeatTimeSet | int | Y | Set to 1 for repeating, set to 0 for single occurrence Example: 0 Allow empty: False |
repeatCrontabSet | None | Repeating crontab configuration Allow empty: False |
|
repeatCrontabSet.min | string | Minute Example: 10 Allow empty: False |
|
repeatCrontabSet.hour | string | Hour Example: 10 Allow empty: False |
|
repeatCrontabSet.day | string | Day Example: * Allow empty: False |
|
repeatCrontabSet.month | string | Month Example: * Allow empty: False |
|
repeatCrontabSet.week | string | Week Example: 1,3 Allow empty: False |
|
crontabDuration | int | Duration in seconds from end time minus start time Example: 3600 Allow empty: False |
|
repeatExpireTime | string | Expiration time for repeated mutes %Y/%m/%d %H:%M:%S Example: Allow empty: False Allow empty string: True |
|
timezone | str | Y | Timezone for the mute rule Example: Asia/Shanghai Allow empty: False |
type | str | Y | Type of mute rule Example: custom Allow empty: False Possible values: ['checker', 'alertPolicy', 'tag', 'custom'] |
declaration | json | Custom declaration information Allow empty: False |
Additional Parameter Explanation¶
Data Explanation.*
- Request Parameter Explanation
Parameter Name | Type | Description |
---|---|---|
muteRanges | list | Mute ranges, including monitors, intelligent checks, user-defined checks, SLOs, alert strategies |
name | str | Rule name |
description | str | Description |
tags | dict | Tags |
filterString | str | Event properties (expression format input) |
notifyTargets | list | List of notification objects, with type as notification type |
repeatTimeSet | int | Whether to repeat mute, 1 for enabled, 0 for single occurrence |
repeatCrontabSet | dict | Configuration for repeating mute rules |
crontabDuration | int | Duration in seconds for the scheduled task |
notifyTargets | list | List of notification objects, with type as notification type |
notifyTimeStr | str | Notification time, %Y/%m/%d %H:%M:%S |
startTime | str | Start time of mute, %Y/%m/%d %H:%M:%S |
endTime | str | End time of mute, %Y/%m/%d %H:%M:%S |
repeatExpireTime | str | Expiration time for repeated mute, %Y/%m/%d %H:%M:%S |
timezone | str | Task timezone, default is Asia/Shanghai |
type | str | Type of mute rule, checker: monitor: tag: custom |
repeatExpire | int | Expiration time for repeated mute (deprecated on 2023-08-24) |
start | int | Start time of mute (deprecated on 2023-08-24) |
end | int | End time of mute (deprecated on 2023-08-24) |
notifyTime | int | Notification time, Unix timestamp in seconds, -1 for immediate notification (deprecated on 2023-08-24) |
declaration | dict | Custom declaration information |
Request Example¶
curl 'https://openapi.guance.com/api/v1/monitor/mute/<obj_uuid>/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"name":"Name A","description":"Description A","startTime":"2023/08/22 16:27:27","notifyTargets":[{"to":["notify_xxxx32"],"type":"notifyObject"}],"tags":{},"muteRanges":[{"name":"Multiple points {version}","checkerUUID":"rul_xxxx32","type":"Monitor"}],"type":"checker","timezone":"Asia/Shanghai","repeatTimeSet":1,"repeatCrontabSet":{"min":"0","hour":"1","day":"*","month":"*","week":"0,5,6,4"},"crontabDuration":10800,"repeatExpireTime":"2023/09/09 00:00:00","notifyTimeStr":"","notifyMessage":"dcscsadcsdacasdcsdacsdac"}' \
--compressed \
--insecure
Response¶
{
"code": 200,
"content": {
"createAt": 1692771116,
"creator": "acnt_xxxx32",
"crontab": "",
"crontabDuration": 0,
"deleteAt": -1,
"description": "Description A",
"end": 1692772267,
"endTime": "2023/08/23 14:31:07",
"id": 643,
"muteRanges": [
{
"checkerUUID": "rul_xxxx32",
"name": "Aerospike cluster 【{cluster_name}】 namespace 【{{ ns }}】 has high Memory usage",
"type": "Monitor"
}
],
"name": "Name A",
"notifyMessage": "cjkackcnkjcklasc",
"notifyTargets": [
{
"to": [
"acnt_xxxx32"
],
"type": "mail"
}
],
"notifyTime": 1692769507,
"notifyTimeStr": "2023/08/23 13:45:07",
"repeatExpire": -1,
"repeatExpireTime": "-1",
"start": 1692770407,
"startTime": "2023/08/23 14:00:07",
"status": 0,
"tags": {},
"timezone": "Asia/Shanghai",
"type": "checker",
"updateAt": 1692771117,
"updator": "acnt_xxxx32",
"uuid": "mute_xxxx32",
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-C5BE0235-BB41-437E-801E-F925E98F8616"
}