Skip to content

Modify



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

Overview

Modify the information of the specified monitor based on rule_uuid.

Path Parameters

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

Body Request Parameters

Parameter Name Type Required Description
configVersion integer The current configuration version, required for V2 modification; returns 409 if expired; this field is not required for legacy OpenAPI.
$minValue: 1
generationId string Candidate credential created or regenerated by Front AI, obtained from the generation API response header
queryType string DQL frontend echo mode, used and validated when extend.querylist is not passed. simple means Studio parses and injects simple-mode fields, and dql means DQL text mode; defaults to dql. When extend.querylist is explicitly passed, it takes priority and 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 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, enabled by default (added in the 2025-02-19 release)
Allow Empty: False
Allowed 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 The unique 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, cross-workspace query, only supports threshold detection type (added in the 2025-08-13 release)
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 Template for the 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 the recovery event message
Example: status: {{status}}, title:{{title}}
Allow Empty: False
Allow Empty String: True
jsonScript.noDataTitle string Template for the 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 the no-data event message
Example: status: {{status}}, title:{{title}}
Allow Empty: False
Allow Empty String: True
jsonScript.openNotificationMessage boolean Whether to enable the event notification content; disabled by default (uses the event content as the 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 the no-data event notification content; disabled by default (uses the no-data event content as the 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 the 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 the 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 detection frequency
Example: 0 */12 * * *
Allow Empty: False
jsonScript.delaySeconds integer Data waiting window for regular monitors, in seconds; 0 means no waiting; not supported by Smart Monitoring.
Example: 60
Allow Empty: False
Allowed Values: [0, 60, 120, 180, 300, 600, 900, 1800]
jsonScript.interval integer Query interval, i.e., the time range span of a single query
Example: 60
Allow Empty: False
jsonScript.range integer The range parameter for sudden change detection in advanced detection, in seconds
Example: 3600
Allow Empty: False
jsonScript.range_2 integer The range_2 parameter for sudden change detection in advanced detection, in seconds. Special notes: -1 means period-over-period comparison, 0 means using the periodBefore field.
Example: 600
Allow Empty: False
jsonScript.periodBefore integer The (yesterday / one hour ago) parameter for sudden change detection in advanced detection, in seconds
Example: 600
Allow Empty: False
jsonScript.recoverNeedPeriodCount integer Specifies after how many check cycles a recovery event is generated for an anomaly. If the detection frequency is a custom customCrontab, this field represents a time length in seconds; otherwise, it represents the number of detection frequencies.
Example: 60
Allow Empty: False
jsonScript.noDataInterval integer The duration of no data after which a no-data event is generated
Example: 60
Allow Empty: False
jsonScript.noDataAction string No-data handling action
Allow Empty: False
Allowed Values: ['none', 'checkAs0', 'noDataEvent', 'fatalEvent', 'criticalEvent', 'errorEvent', 'warningEvent', 'okEvent', 'noData', 'recover']
jsonScript.checkFuncs array List of check function information
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.yamlConfig string V2 complete source YAML text, up to 256 KiB; not a JSON object, without Markdown fences
jsonScript.checkerOpt.disableLargeScaleEventProtect boolean Whether to disable large-scale event protection; defaults to false
Example: True
jsonScript.checkerOpt.script string Script content for programmable monitoring
Allow Empty: False
Allow Empty String: True
jsonScript.checkerOpt.rules array List of trigger conditions
Example: [{'status': 'warning', 'conditions': [{'operands': [60], 'operator': '>', 'alias': 'M1'}], 'conditionLogic': 'and', 'matchTimes': 10}]
Allow Empty: False
jsonScript.checkerOpt.openOkConditions boolean Enable tiered recovery; disabled (false) by default
Example: True
jsonScript.checkerOpt.openMatchTimes boolean Enable consecutive trigger evaluation; disabled (false) by default
Example: True
jsonScript.checkerOpt.infoEvent boolean Whether to generate an info event when the status remains normal; defaults to false
Example: True
jsonScript.checkerOpt.infoEventCondition json Conditions for generating info events, supported only by threshold monitors; an empty object means unconditional generation
Example: {'alias': 'M1', 'operator': '>=', 'operands': [60]}
Allow Empty: False
jsonScript.checkerOpt.infoEventCondition.alias string Alias of the evaluated object
jsonScript.checkerOpt.infoEventCondition.operator string Comparison operator
jsonScript.checkerOpt.infoEventCondition.operands array List of operands
jsonScript.checkerOpt.diffMode string Difference mode for sudden change detection in advanced detection; enumerated values: value, percent
Example: value
Allowed Values: ['value', 'percent']
jsonScript.checkerOpt.direction string Trigger condition direction for sudden change detection and interval detection in advanced detection
Example: up
Allowed Values: ['up', 'down', 'both']
jsonScript.checkerOpt.eps float Distance parameter, valid range: 0 ~ 3.0
Example: 0.5
jsonScript.checkerOpt.threshold json Precondition settings for sudden change detection
Allow Empty: False
jsonScript.checkerOpt.threshold.status boolean Y Whether the trigger precondition for sudden change detection is enabled
Example: True
jsonScript.checkerOpt.threshold.operator string Y Operator used by the trigger precondition for sudden change detection
Example:
jsonScript.checkerOpt.threshold.value float Y Detection value of the trigger precondition for sudden change detection
Example: 90
Allow Empty: True
jsonScript.checkerOpt.combineExpr string Composite monitor, combination expression
Example: A && B
Allow Empty String: False
jsonScript.checkerOpt.ignoreNodata boolean Composite monitor: whether to ignore no-data results (true means ignore them)
Example: True
jsonScript.checkerOpt.confidenceInterval integer New V2 parameter for interval detection; confidence interval range from 1 to 100
Example: 10
jsonScript.checkerOpt.category string AI monitor category metadata
Allow Empty: False
jsonScript.checkerOpt.userPrompt string AI user prompt; cannot be empty when provided, up to 20,000 characters
Allow Empty: False
Allow Empty String: True
Maximum Length: 20000
jsonScript.checkerOpt.systemPrompt string AI system prompt; cannot be empty when provided, up to 20,000 characters
Allow Empty: False
Allow Empty String: True
Maximum Length: 20000
jsonScript.checkerOpt.mentions array DQL reference list; each item must include type=dql, namespace, datasource; index is optional and filled in when logs are selected; up to 20,000 characters when serialized
Allow Empty: False
jsonScript.checkerOpt.mentions[*] None
jsonScript.checkerOpt.mentions[*].type string Y Data source type
Allowed Values: ['dql']
jsonScript.checkerOpt.mentions[*].namespace string Y DQL namespace
Allow Empty String: False
jsonScript.checkerOpt.mentions[*].index string DQL index; fill in when logs are selected
Allow Empty String: False
jsonScript.checkerOpt.mentions[*].datasource string Y DQL data source
Allow Empty String: False
jsonScript.checkerOpt.model string The model used for this detection
Allow Empty: False
jsonScript.checkerOpt.contextWindowLimit integer Context window token limit; must be greater than 0
Allow Empty: False
$minValue: 1
jsonScript.checkerOpt.maxChatRounds integer Maximum number of chat rounds; must be greater than or equal to 1
Allow Empty: False
$minValue: 1
jsonScript.checkerOpt.maxDQLQueries integer Maximum number of DQL queries; must be greater than or equal to 0
Allow Empty: False
$minValue: 0
jsonScript.checkerOpt.creditSoftBudget number Credit soft budget per detection; must be greater than 0
Allow Empty: False
jsonScript.channels array Channel UUID list
Example: ['Name1', 'Name2']
Allow Empty: False
jsonScript.atAccounts array List of account UUIDs to be @mentioned during normal detection
Example: ['xx1', 'xx2']
Allow Empty: False
jsonScript.atNoDataAccounts array List of account UUIDs to be @mentioned in no-data situations
Example: ['xx1', 'xx2']
Allow Empty: False
jsonScript.subUri string Webhook URL suffix of OuterEventChecker; required when creating, uniqueness not required
Example: datakit/push
Allow Empty: False
jsonScript.isChangeEvent boolean Whether OuterEventChecker is handled as a Change Event; defaults to false; if missing in existing rules, treated as false
Example: False
Allow Empty: False
jsonScript.disableCheckEndTime boolean Whether to disable the end time limit
Example: True
Allow Empty: False
jsonScript.eventChartEnable boolean Whether to enable event charts; disabled by default (note: only takes effect when the primary storage engine for 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 of the event chart
Example: M::cpu:(avg(load5s)) BY host
Allow Empty: False
openPermissionSet boolean Enable custom permission configuration (default false: not enabled). When enabled, the operation permissions of this rule are determined by permissionSet.
Allow Empty: False
permissionSet array Operation permission configuration; can be configured with roles (except owner), member UUIDs, and team UUIDs
Example: ['wsAdmin', 'acnt_xxxx', 'group_yyyy']
Allow Empty: False

Supplementary Parameter Notes

Smart Monitoring V2 uses the outer layer type=smartMonitor, jsonScript.type=smartMonitorV2Check, and checkerOpt.yamlConfig. It runs every 10 minutes by default, and queries come only from the YAML. Modification only exposes the DQL, existing threshold configuration, and existing public algorithm parameters; rule sets, algorithm types, dimensions, time, and templates cannot be modified. extend.smartMonitor stores the source, prompts, and server-side configuration version. Front rejects the creation, import, and editing of old versions; old instances can still be deleted and started or stopped. Legacy OpenAPI capabilities remain compatible.

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?