Skip to content

Create a Mute Rule



post /api/v1/monitor/mute/create

Overview

Create a mute rule.

Body Request Parameter

Parameter Name Type Required Description
muteRanges array Range of mute
Example: Monitor A
Allow null: False
tags json Tag set
Allow null: False
notifyTargets array Notification target
Allow null: False
notifyMessage string Notification information
Allow null: False
notifyTime integer Notification time, default to -1 when not set.
Example: None
Allow null: False
start integer Start timestamp milliseconds
Example: 60
Allow null: False
end integer End timestamp in milliseconds, -1 for forever.
Example: 60
Allow null: False
repeatTimeSet int Y The repeated configuration value is passed 1, and the silence time is passed 0 for a single time.
Example: 0
Allow null: False
repeatCrontabSet None Repeat crontab configuration
Allow null: False
repeatCrontabSet.min string Minutes
Example: 10
Allow null: False
repeatCrontabSet.hour string Hours
Example: 10
Allow null: False
repeatCrontabSet.day string Days
Example: *
Allow null: False
repeatCrontabSet.month string Months
Example: *
Allow null: False
repeatCrontabSet.week string Weeks
Example: 1,3
Allow null: False
crontabDuration int End time minus start time, positive integer in s.
Example: 3600
Allow null: False
repeatExpire int Repeat end time, specific timestamp, if it is forever repeated transmission 0.
Example: 0
Allow null: False

Supplementary Description of Parameters

Data description.

  • Request parameter description
Parameter Name Type Description
muteRanges list mute range, including monitor, intelligent check, self-built patrol, SLO and mute policy
tags dict tag
notifyTargets list to: The list is the notification object, and type is its notification type
notifyTime int Notification time, the second timestamp corresponding to the time point, -1 for immediate notification
start int mute start time
end int mute end time
repeatTimeSet int Whether to repeat mute, 1 means to turn on repeated mute, and 0 means only once
repeatCrontabSet dict Time allocation of repeated mute rules
repeatExpire int expiry time of repeated mute
crontabDuration int Represent the duration of mute after the start of the timed task

Request Example

curl 'https://openapi.guance.com/api/v1/monitor/mute/create' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-raw '{"tags": {"host": ["10-23-190-37"]},"repeatTimeSet":0, "start": 1669878235, "end": 1669888235, "notifyTargets": []}' \
  --compressed \
  --insecure

Response

{
    "code": 200,
    "content": {
        "createAt": 1669878266,
        "creator": "wsak_60b430adbf1440ad991a4647e9ef411a",
        "crontab": "",
        "crontabDuration": 0,
        "deleteAt": -1,
        "end": 1669888235,
        "id": null,
        "muteRanges": [],
        "notifyMessage": "",
        "notifyTargets": [],
        "notifyTime": -1,
        "repeatExpire": -1,
        "start": 1669878235,
        "status": 0,
        "tags": {
            "host": [
                "10-23-190-37"
            ]
        },
        "type": "host",
        "updateAt": 1669878266.470657,
        "updator": "wsak_60b430adbf1440ad991a4647e9ef411a",
        "uuid": "mute_f5533997b770444b91d507527c361e34",
        "workspaceUUID": "wksp_2dc431d6693711eb8ff97aeee04b54af"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-1391A46B-581E-43F9-9B0D-EA850F384A45"
} 

Feedback

Is this page helpful? ×