Skip to content

Modify



POST /api/v1/checker/{rule_uuid}/modify

Overview

Modify the specified monitor information based on rule_uuid.

Path Parameters

Parameter Name Type Required Description
rule_uuid string Y ID of the checker

Body Request Parameters

Parameter Name Type Required Description
queryType string The DQL frontend echo mode used and validated when extend.querylist is not provided. simple means Studio parses and injects simple mode fields, dql means DQL text mode; default is dql. When extend.querylist is explicitly passed, it is used as-is with priority and the injection semantics of queryType are ignored; if simple conversion fails, it automatically falls back to dql without changing the DQL actually executed in jsonScript.targets.
Allow empty: False
Example: simple
extend json Additional information
Allow empty: True
status integer Monitor status field, 0 enabled, 2 disabled, default enabled, (added in 2025-02-19 iteration)
Allow empty: False
Optional values: [0, 2]
alertPolicyUUIDs array Alert Policy UUID
Allow empty: False
dashboardUUID string Associated dashboard ID
Allow empty: False
tags array Tag names for filtering
Allow empty: False
Example: ['xx', 'yy']
secret string The middle segment unique identifier secret of the Webhook URL
Allow empty: False
Example: secret_xxxxx
jsonScript json Rule configuration
Allow empty: False
jsonScript.targetWorkspaceUUID string Target workspace, cross-workspace query, only supported for threshold detection type (added in 2025-08-13 iteration)
Allow empty: False
Allow empty string: False
jsonScript.type string Y Check method type
Example: simpleCheck
Allow empty: False
jsonScript.windowDql string Window DQL
Allow empty: False
jsonScript.title string Y Title of the generated event
Example: Monitor: {{monitor_name}} Checker: {{monitor_checker_name}} Trigger Value: {{M1}}
Allow empty: False
Allow empty string: True
Maximum length: 256
jsonScript.message string Event content
Example: status: {{status}}, title: {{title}}
Allow empty: False
Allow empty string: True
jsonScript.recoverTitle string Output recovery event title template
Example: Monitor: {{monitor_name}} Checker: {{monitor_checker_name}} Trigger Value: {{M1}}
Allow empty: False
Allow empty string: True
jsonScript.recoverMessage string Output recovery event message template
Example: status: {{status}}, title: {{title}}
Allow empty: False
Allow empty string: True
jsonScript.noDataTitle string Output no data event title template
Example: Monitor: {{monitor_name}} Checker: {{monitor_checker_name}} Trigger Value: {{M1}}
Allow empty: False
Allow empty string: True
jsonScript.noDataMessage string Output no data event message template
Example: status: {{status}}, title: {{title}}
Allow empty: False
Allow empty string: True
jsonScript.openNotificationMessage boolean Whether to enable event notification content, default disabled (uses event content as notification content)
Example: False
Allow empty: False
jsonScript.notificationMessage string Event notification content
Example: Monitor: {{monitor_name}} Checker: {{monitor_checker_name}} Trigger Value: {{M1}}
Allow empty: False
Allow empty string: True
jsonScript.openNoDataNotificationMessage boolean Whether to enable data gap event notification content, default disabled (uses data gap event content as notification content)
Example: False
Allow empty: False
jsonScript.noDataNotificationMessage string Data gap event notification content
Example: status: {{status}}, title: {{title}}
Allow empty: False
Allow empty string: True
jsonScript.noDataRecoverTitle string Output no data recovery upload event title template
Example: Monitor: {{monitor_name}} Checker: {{monitor_checker_name}} Trigger Value: {{M1}}
Allow empty: False
Allow empty string: True
jsonScript.noDataRecoverMessage string Output no data recovery upload event message template
Example: status: {{status}}, title: {{title}}
Allow empty: False
Allow empty string: True
jsonScript.every string Check frequency
Example: 1m
Allow empty: False
jsonScript.customCrontab string Custom check frequency
Example: 0 */12 * * *
Allow empty: False
jsonScript.delaySeconds integer Data waiting window for regular monitors, in seconds, 0 means no wait; not supported by Intelligent Monitoring
Example: 60
Allow empty: False
Optional values: [0, 60, 120, 180, 300, 600, 900, 1800]
jsonScript.interval integer Query interval, i.e., the time range difference for a single query
Example: 60
Allow empty: False
jsonScript.range integer Range parameter for Advanced Detection and Sudden Change Detection, in seconds
Example: 3600
Allow empty: False
jsonScript.range_2 integer Range_2 parameter for Advanced Detection and Sudden Change Detection, in seconds. Special note: (-1 represents month-over-month, 0 represents using the periodBefore field)
Example: 600
Allow empty: False
jsonScript.periodBefore integer (Yesterday/one hour ago) parameter for Advanced Detection and Sudden Change Detection, in seconds
Example: 600
Allow empty: False
jsonScript.recoverNeedPeriodCount integer Specifies the number of check cycles after which a recovery event is generated. If the check frequency is customCrontab, this field represents a time length in seconds; otherwise, it represents the number of check frequencies.
Example: 60
Allow empty: False
jsonScript.noDataInterval integer How long without data triggers a no data event
Example: 60
Allow empty: False
jsonScript.noDataAction string No data handling action
Allow empty: False
Optional values: ['none', 'checkAs0', 'noDataEvent', 'fatalEvent', 'criticalEvent', 'errorEvent', 'warningEvent', 'okEvent', 'noData', 'recover']
jsonScript.checkFuncs array Check function information list
Example: [{'funcId': 'xxx', 'kwargs': {}}]
Allow empty: False
jsonScript.groupBy array Trigger dimensions
Example: ['Hospital']
Allow empty: False
jsonScript.targets array Check targets
Example: [{'dql': 'M::士兵信息:(AVG(潜力值)) [::auto] by 性别', 'alias': 'M1'}]
Allow empty: False
jsonScript.checkerOpt json Check condition settings
Allow empty: False
jsonScript.checkerOpt.disableLargeScaleEventProtect boolean Whether to disable large-scale event protection, default false
Example: True
jsonScript.checkerOpt.script string Script content for Programmable Monitor
Allow empty: False
Allow empty string: True
jsonScript.checkerOpt.rules array Trigger condition list
Example: [{'status': 'warning', 'conditions': [{'operands': [60], 'operator': '>', 'alias': 'M1'}], 'conditionLogic': 'and', 'matchTimes': 10}]
Allow empty: False
jsonScript.checkerOpt.openOkConditions boolean Enable graduated recovery, default disabled (false)
Example: True
jsonScript.checkerOpt.openMatchTimes boolean Enable consecutive trigger judgment, default disabled (false)
Example: True
jsonScript.checkerOpt.infoEvent boolean Whether to generate an info event when continuous normal, default false
Example: True
jsonScript.checkerOpt.infoEventCondition json Info event generation condition, only supported by threshold monitors; empty object means unconditional generation
Example: {'alias': 'M1', 'operator': '>=', 'operands': [60]}
Allow empty: False
jsonScript.checkerOpt.infoEventCondition.alias string Judgment object alias
jsonScript.checkerOpt.infoEventCondition.operator string Judgment operator
jsonScript.checkerOpt.infoEventCondition.operands array Judgment operand list
jsonScript.checkerOpt.diffMode string Difference mode for Sudden Change Detection in Advanced Detection, enum values: value, percent
Example: value
Optional values: ['value', 'percent']
jsonScript.checkerOpt.direction string Trigger condition direction for Sudden Change Detection and Interval Detection in Advanced Detection
Example: up
Optional values: ['up', 'down', 'both']
jsonScript.checkerOpt.eps float Distance parameter, range: 0 ~ 3.0
Example: 0.5
jsonScript.checkerOpt.threshold json Trigger prerequisite settings for Sudden Change Detection
Allow empty: False
jsonScript.checkerOpt.threshold.status boolean Y Whether the trigger prerequisite is enabled for Sudden Change Detection
Example: True
jsonScript.checkerOpt.threshold.operator string Y Trigger prerequisite operator for Sudden Change Detection
Example:
jsonScript.checkerOpt.threshold.value float Y Trigger prerequisite detection value for Sudden Change Detection
Example: 90
Allow empty: True
jsonScript.checkerOpt.combineExpr string Composite Monitor, combination method
Example: A && B
Allow empty string: False
jsonScript.checkerOpt.ignoreNodata boolean Composite Monitor, whether to ignore no data results (true means to ignore)
Example: True
jsonScript.checkerOpt.confidenceInterval integer New parameter for Interval Detection V2, confidence interval range 1-100
Example: 10
jsonScript.channels array Channel UUID list
Example: ['Name1', 'Name2']
Allow empty: False
jsonScript.atAccounts array List of account UUIDs to be @mentioned under normal detection
Example: ['xx1', 'xx2']
Allow empty: False
jsonScript.atNoDataAccounts array List of account UUIDs to be @mentioned under no data condition
Example: ['xx1', 'xx2']
Allow empty: False
jsonScript.subUri string Webhook URL suffix for OuterEventChecker; required when creating, uniqueness not required
Example: datakit/push
Allow empty: False
jsonScript.isChangeEvent boolean Whether OuterEventChecker is treated as a change event, default false; missing in existing rules is treated as false
Example: False
Allow empty: False
jsonScript.disableCheckEndTime boolean Whether to disable end time limit
Example: True
Allow empty: False
jsonScript.eventChartEnable boolean Whether to enable event charts, default disabled (note: only takes effect when the primary storage engine logging is Doris)
Example: False
Allow empty: False
jsonScript.eventCharts array Event chart list
Example: True
Allow empty: False
jsonScript.eventCharts[*] None
jsonScript.eventCharts[*].dql string Event chart query statement
Example: M::cpu:(avg(load5s)) BY host
Allow empty: False
openPermissionSet boolean Enable custom permission configuration (default false: disabled). When enabled, the operation permissions of this rule are based on permissionSet.
Allow empty: False
permissionSet array Operation permission configuration, can be configured with (roles (except Owner), member UUID, team UUID)
Example: ['wsAdmin', 'acnt_xxxx', 'group_yyyy']
Allow empty: False

Parameter Details

Request Example

curl 'https://openapi.guance.com/api/v1/checker/rul_xxxxxx/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"queryType":"simple","extend":{"querylist":[{"datasource":"dataflux","qtype":"dql","query":{"code":"Result","type":"simple","namespace":"metric","dataSource":"ssh","field":"ssh_check","fieldType":"float","alias":"","fieldFunc":"count","groupByTime":"","groupBy":["host"],"q":"M::`ssh`:(count(`ssh_check`)) BY `host`","funcList":[]},"uuid":"aada629a-672e-46f9-9503-8fd61065c382"}],"funcName":"","rules":[{"conditionLogic":"and","conditions":[{"alias":"Result","operands":["90"],"operator":">="}],"status":"critical"},{"conditionLogic":"and","conditions":[{"alias":"Result","operands":["0"],"operator":">="}],"status":"error"}],"issueLevelUUID":"system_level_3","isNeedCreateIssue":false,"needRecoverIssue":false},"jsonScript":{"title":"Host {{ host }} SSH Service Exception","message":">Level:{{status}}  \n>Host:{{host}}  \n>Content:Host SSH Status {{ Result |  to_fixed(2) }}%  \n>Suggestion:Check Host SSH Service Status","noDataTitle":"","noDataMessage":"","type":"simpleCheck","every":"1m","groupBy":["host"],"interval":300,"targets":[{"dql":"M::`ssh`:(count(`ssh_check`)) BY `host`","alias":"Result","qtype":"dql"}],"checkerOpt":{"rules":[{"conditionLogic":"and","conditions":[{"alias":"Result","operands":["90"],"operator":">="}],"status":"critical"},{"conditionLogic":"and","conditions":[{"alias":"Result","operands":["0"],"operator":">="}],"status":"error"}],"infoEvent":false},"recoverNeedPeriodCount":2,"channels":[],"atAccounts":[],"atNoDataAccounts":[],"disableCheckEndTime":false},"alertPolicyUUIDs":["altpl_xxxx32"],"tags":["Local Test Combination Detection"]}' \
--compressed 

Response

{
    "code": 200,
    "content": {
        "createAt": 1710827935,
        "createdWay": "manual",
        "creator": "acnt_xxxx32",
        "crontabInfo": {
            "crontab": "*/1 * * * *",
            "id": "cron-pwiThsuE9gtQ"
        },
        "declaration": {
            "b": [
                "asfawfgajfasfafgafwba",
                "asfgahjfaf"
            ],
            "business": "aaa",
            "organization": "64fe7b4062f74d0007b46676"
        },
        "deleteAt": -1,
        "extend": {
            "funcName": "",
            "isNeedCreateIssue": false,
            "issueLevelUUID": "system_level_3",
            "needRecoverIssue": false,
            "querylist": [
                {
                    "datasource": "dataflux",
                    "qtype": "dql",
                    "query": {
                        "alias": "",
                        "code": "Result",
                        "dataSource": "ssh",
                        "field": "ssh_check",
                        "fieldFunc": "count",
                        "fieldType": "float",
                        "funcList": [],
                        "groupBy": [
                            "host"
                        ],
                        "groupByTime": "",
                        "namespace": "metric",
                        "q": "M::`ssh`:(count(`ssh_check`)) BY `host`",
                        "type": "simple"
                    },
                    "uuid": "aada629a-672e-46f9-9503-8fd61065c382"
                }
            ],
            "rules": [
                {
                    "conditionLogic": "and",
                    "conditions": [
                        {
                            "alias": "Result",
                            "operands": [
                                "90"
                            ],
                            "operator": ">="
                        }
                    ],
                    "status": "critical"
                },
                {
                    "conditionLogic": "and",
                    "conditions": [
                        {
                            "alias": "Result",
                            "operands": [
                                "0"
                            ],
                            "operator": ">="
                        }
                    ],
                    "status": "error"
                }
            ]
        },
        "id": 1118,
        "isLocked": 0,
        "jsonScript": {
            "atAccounts": [],
            "atNoDataAccounts": [],
            "channels": [],
            "checkerOpt": {
                "infoEvent": false,
                "rules": [
                    {
                        "conditionLogic": "and",
                        "conditions": [
                            {
                                "alias": "Result",
                                "operands": [
                                    "90"
                                ],
                                "operator": ">="
                            }
                        ],
                        "status": "critical"
                    },
                    {
                        "conditionLogic": "and",
                        "conditions": [
                            {
                                "alias": "Result",
                                "operands": [
                                    "0"
                                ],
                                "operator": ">="
                            }
                        ],
                        "status": "error"
                    }
                ]
            },
            "disableCheckEndTime": false,
            "every": "1m",
            "groupBy": [
                "host"
            ],
            "interval": 300,
            "message": ">Level:{{status}}  \n>Host:{{host}}  \n>Content:Host SSH Status {{ Result |  to_fixed(2) }}%  \n>Suggestion:Check Host SSH Service Status",
            "name": "Host {{ host }} SSH Service Exception",
            "noDataMessage": "",
            "noDataTitle": "",
            "recoverNeedPeriodCount": 2,
            "targets": [
                {
                    "alias": "Result",
                    "dql": "M::`ssh`:(count(`ssh_check`)) BY `host`",
                    "qtype": "dql"
                }
            ],
            "title": "Host {{ host }} SSH Service Exception",
            "type": "simpleCheck"
        },
        "monitorUUID": "monitor_xxxx32",
        "refKey": "",
        "secret": "",
        "status": 0,
        "tagInfo": [
            {
                "id": "tag_xxxx32",
                "name": "Local Test Combination Detection"
            }
        ],
        "type": "trigger",
        "updateAt": 1710831784,
        "updator": "wsak_xxxxx",
        "uuid": "rul_xxxx32",
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-FF2C1DA3-1EE2-4802-A857-D37BCFB0C562"
}

Feedback

Is this page helpful?