Skip to content

Modify



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

Overview

Modify specified monitor information based on rule_uuid.

Route Parameters

Parameter Name Type Required Description
rule_uuid string Y Check Item ID

Body Request Parameters

Parameter Name Type Required Description
queryType string DQL frontend display mode used for validation when extend.querylist is not provided. "simple" means parsed by Studio and injected into simple mode fields, "dql" means DQL text mode; default is "dql". When extend.querylist is explicitly provided, it is used as-is and the injection semantics of queryType are ignored. If simple conversion fails, it automatically falls back to dql without changing the actual DQL executed in jsonScript.targets.
Allow Empty: False
Example: simple
extend json Additional information
Allow Empty: True
status integer Monitor status field: 0 for enabled, 2 for disabled; default is enabled (newly added in 2025-02-19 iteration)
Allow Empty: False
Optional Values: [0, 2]
alertPolicyUUIDs array Alert Policy UUIDs
Allow Empty: False
dashboardUUID string Associated Dashboard ID
Allow Empty: False
tags array Tag names used for filtering
Allow Empty: False
Example: ['xx', 'yy']
secret string Unique identifier secret in the middle segment of the Webhook URL
Allow Empty: False
Example: secret_xxxxx
jsonScript json Rule configuration
Allow Empty: False
jsonScript.targetWorkspaceUUID string Target workspace, for cross-workspace queries; only supports threshold detection types (newly 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 for generated event
Example: Monitor: {{monitor_name}} Checker:{{monitor_checker_name}} Trigger Value:{{M1}}
Allow Empty: False
Allow Empty String: True
Max Length: 256
jsonScript.message string Event content
Example: status: {{status}}, title:{{title}}
Allow Empty: False
Allow Empty String: True
jsonScript.recoverTitle string Template for recovery event title
Example: Monitor: {{monitor_name}} Checker:{{monitor_checker_name}} Trigger Value:{{M1}}
Allow Empty: False
Allow Empty String: True
jsonScript.recoverMessage string Template for recovery event message
Example: status: {{status}}, title:{{title}}
Allow Empty: False
Allow Empty String: True
jsonScript.noDataTitle string Template for no-data event title
Example: Monitor: {{monitor_name}} Checker:{{monitor_checker_name}} Trigger Value:{{M1}}
Allow Empty: False
Allow Empty String: True
jsonScript.noDataMessage string Template for no-data event message
Example: status: {{status}}, title:{{title}}
Allow Empty: False
Allow Empty String: True
jsonScript.openNotificationMessage boolean Whether to enable event notification content; default is not enabled (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 no-data event notification content; default is not enabled (uses no-data event content as notification content)
Example: False
Allow Empty: False
jsonScript.noDataNotificationMessage string No-data event notification content
Example: status: {{status}}, title:{{title}}
Allow Empty: False
Allow Empty String: True
jsonScript.noDataRecoverTitle string Template for no-data recovery event title
Example: Monitor: {{monitor_name}} Checker:{{monitor_checker_name}} Trigger Value:{{M1}}
Allow Empty: False
Allow Empty String: True
jsonScript.noDataRecoverMessage string Template for no-data recovery event message
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.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 mutation detection, unit s
Example: 3600
Allow Empty: False
jsonScript.range_2 integer Range_2 parameter for advanced detection and mutation detection, unit s; special note: (-1 represents month-over-month, 0 means use periodBefore field)
Example: 600
Allow Empty: False
jsonScript.periodBefore integer PeriodBefore parameter for advanced detection and mutation detection (yesterday/one hour ago), unit s
Example: 600
Allow Empty: False
jsonScript.recoverNeedPeriodCount integer Specify the number of check cycles after an anomaly to generate a recovery event. If the check frequency is a custom crontab, this field represents the time length in seconds; otherwise, it represents the number of check frequencies.
Example: 60
Allow Empty: False
jsonScript.noDataInterval integer Duration of no data before generating 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::SoldierInfo:(AVG(PotentialValue)) [::auto] by Gender', '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 monitoring
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 graded recovery; default is disabled (false)
Example: True
jsonScript.checkerOpt.openMatchTimes boolean Enable continuous trigger judgment; default is disabled (false)
Example: True
jsonScript.checkerOpt.infoEvent boolean Whether to generate info events when continuously 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 List of judgment operands
jsonScript.checkerOpt.diffMode string Difference mode for mutation detection in advanced detection; enum values: value, percent
Example: value
Optional Values: ['value', 'percent']
jsonScript.checkerOpt.direction string Trigger condition direction for mutation detection or 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 mutation detection
Allow Empty: False
jsonScript.checkerOpt.threshold.status boolean Y Whether the trigger prerequisite is enabled for mutation detection
Example: True
jsonScript.checkerOpt.threshold.operator string Y Trigger prerequisite operator for mutation detection
Example:
jsonScript.checkerOpt.threshold.value float Y Trigger prerequisite detection value for mutation detection
Example: 90
Allow Empty: True
jsonScript.checkerOpt.combineExpr string Combination monitoring combination method
Example: A && B
Allow Empty String: False
jsonScript.checkerOpt.ignoreNodata boolean Combination monitoring: whether to ignore no-data results (true means 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 conditions
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 rules treat 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 main 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 Query statement for event chart
Example: M::cpu:(avg(load5s)) BY host
Allow Empty: False
openPermissionSet boolean Enable custom permission configuration (default false: not enabled). When enabled, operation permissions for this rule are based on permissionSet.
Allow Empty: False
permissionSet array Operation permission configuration; configurable (roles (except owner), member UUIDs, team UUIDs)
Example: ['wsAdmin', 'acnt_xxxx', 'group_yyyy']
Allow Empty: False

Parameter Supplementary Notes

Request Example

curl 'https://openapi.truewatch.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"
}