Skip to content

Modify



POST /api/v1/monitor/mute/{obj_uuid}/modify

Overview

Modify a Mute rule

Route Parameters

Parameter Name Type Required Description
obj_uuid string Y Mute configuration ID

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 Tags
Allow empty: False
filterString string Event attributes
Allow empty: False
Allow empty string: True
Max 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
Max 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 Repeat configuration value pass 1, single mute time pass 0
Example: 0
Allow empty: False
repeatCrontabSet None Repeat 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 End time minus start time, positive integer, unit is s
Example: 3600
Allow empty: False
repeatExpireTime string Repeat expiration time %Y/%m/%d %H:%M:%S
Example:
Allow empty: False
Allow empty string: True
timezone str Y Mute rule timezone
Example: Asia/Shanghai
Allow empty: False
type str Y Mute rule type
Example: custom
Allow empty: False
Optional values: ['checker', 'alertPolicy', 'tag', 'custom']
declaration json Custom declaration information
Allow empty: False

Parameter Additional Notes

Data description.*

  • Request parameter description
Parameter Name Type Description
muteRanges list Mute ranges, including monitors, intelligent inspections, self-built inspections, SLOs, alert policies
name str Rule name
description str Description
tags dict Tags
filterString str Event attributes (expression form input)
notifyTargets list to: list is notification targets, type is their notification type
repeatTimeSet int Whether to repeat mute, 1 means enable repeat mute, 0 means only once
repeatCrontabSet dict Repeat mute rule time configuration
crontabDuration int Represents the duration of mute after the scheduled task starts
notifyTargets list to: list is notification targets, type is their notification type
notifyTimeStr str Notification time, %Y/%m/%d %H:%M:%S
startTime str Mute start time %Y/%m/%d %H:%M:%S
endTime str Mute end time %Y/%m/%d %H:%M:%S
repeatExpireTime str Repeat mute expiration time %Y/%m/%d %H:%M:%S
timezone str Task timezone default Asia/Shanghai
type str Corresponding mute rule type checker:monitor:tag:custom
repeatExpire int Repeat mute expiration time (deprecated on 2023-08-24)
start int Mute start time (deprecated on 2023-08-24)
end int Mute end time (deprecated on 2023-08-24)
notifyTime int Notification time, second-level timestamp of the time point, -1 means notify immediately (deprecated on 2023-08-24)
declaration dict Custom declaration information

Request Example

curl 'https://openapi.truewatch.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":"nameA","description":"descA","startTime":"2023/08/22 16:27:27","notifyTargets":[{"to":["notify_xxxx32"],"type":"notifyObject"}],"tags":{},"muteRanges":[{"name":"multi{version}","checkerUUID":"rul_xxxx32","type":"checker"}],"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":"nofity message"}' \
  --compressed \
  --insecure

Response

{
    "code": 200,
    "content": {
        "createAt": 1692771116,
        "creator": "acnt_xxxx32",
        "crontab": "",
        "crontabDuration": 0,
        "deleteAt": -1,
        "description": "descA",
        "end": 1692772267,
        "endTime": "2023/08/23 14:31:07",
        "id": 643,
        "muteRanges": [
            {
                "checkerUUID": "rul_xxxx32",
                "name": "The Memory usage rate of the Aerospike cluster [{cluster_name}] space [{ns}] is too high",
                "type": "checker"
            }
        ],
        "name": "nameA",
        "notifyMessage": "nofity message",
        "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"
}