Skip to content

Modify



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

Overview

Modify the specified monitor information based on rule_uuid

Route Parameters

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

Body Request Parameters

Parameter Name Type Required Description
extend json Additional information
Allow empty: True
status integer Monitor status field, 0 for enabled, 2 for disabled, default is enabled, (added in 2025-02-19 iteration)
Allow empty: False
Optional values: [0, 2]
monitorUUID string Group ID
Allow empty: False
Allow empty string: True
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 Unique secret identifier for Webhook URL
Allow empty: False
Example: secret_xxxxx
jsonScript json Rule configuration
Allow empty: False
jsonScript.targetWorkspaceUUID None Target workspace, cross-workspace query, only supports 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 Event title
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 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 Recovery event message template
Example: status: {status}, title:{title}
Allow empty: False
Allow empty string: True
jsonScript.noDataTitle string 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 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 is disabled (use 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 disabled (use 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 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 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.interval integer Query interval, i.e., the time range difference for one query
Example: 60
Allow empty: False
jsonScript.range integer For advanced detection, mutation detection range parameter, unit s
Example: 3600
Allow empty: False
jsonScript.range_2 integer For advanced detection, mutation detection range_2 parameter, unit s, special note (-1 represents chain ratio, 0 represents using periodBefore field)
Example: 600
Allow empty: False
jsonScript.periodBefore integer For advanced detection, mutation detection (yesterday/one hour ago) parameter, unit s
Example: 600
Allow empty: False
jsonScript.recoverNeedPeriodCount integer Specify the number of check periods after which a recovery event is generated, if the check frequency is customCrontab, this field represents the time length, unit s, otherwise, it represents the number of check frequencies
Example: 60
Allow empty: False
jsonScript.noDataInterval integer How long without data will generate a no data event
Example: 60
Allow empty: False
jsonScript.noDataAction string No data processing operation
Allow empty: False
Optional values: ['none', 'checkAs0', 'noDataEvent', 'criticalEvent', 'errorEvent', 'warningEvent', 'okEvent', 'noData', 'recover']
jsonScript.checkFuncs array Check function information list
Example: [{'funcId': 'xxx', 'kwargs': {}}]
Allow empty: False
jsonScript.groupBy array Trigger dimension
Example: ['Hospital']
Allow empty: False
jsonScript.targets array Check target
Example: [{'dql': 'M::Soldier Information:(AVG(Potential Value)) [::auto] by Gender', 'alias': 'M1'}]
Allow empty: False
jsonScript.checkerOpt json Check condition settings
Allow empty: False
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 event when continuously normal, default false
Example: True
jsonScript.checkerOpt.diffMode string In advanced detection, mutation detection difference mode, enum value, value, percent
Example: value
Optional values: ['value', 'percent']
jsonScript.checkerOpt.direction string In advanced detection, mutation detection, interval detection trigger condition direction
Example: up
Optional values: ['up', 'down', 'both']
jsonScript.checkerOpt.eps float Distance parameter, value range: 0 ~ 3.0
Example: 0.5
jsonScript.checkerOpt.threshold json Mutation detection trigger prerequisite settings
Allow empty: False
jsonScript.checkerOpt.threshold.status boolean Y Mutation detection, whether to enable trigger prerequisite,
Example: True
jsonScript.checkerOpt.threshold.operator string Y Mutation detection, trigger prerequisite operator
Example:
jsonScript.checkerOpt.threshold.value float Y Mutation detection, trigger prerequisite check value
Example: 90
Allow empty: True
jsonScript.checkerOpt.combineExpr string Combined monitoring, combination method
Example: A && B
Allow empty string: False
jsonScript.checkerOpt.ignoreNodata boolean Combined monitoring, whether to ignore no data results (true means need to ignore),
Example: True
jsonScript.checkerOpt.confidenceInterval integer Interval detection V2 new parameter, confidence interval range value 1-100,
Example: 10
jsonScript.channels array Channel UUID list
Example: ['Name1', 'Name2']
Allow empty: False
jsonScript.atAccounts array Normal detection @ account UUID list
Example: ['xx1', 'xx2']
Allow empty: False
jsonScript.atNoDataAccounts array No data @ account UUID list
Example: ['xx1', 'xx2']
Allow empty: False
jsonScript.subUri string Webhook URL suffix
Example: datakit/push
Allow empty: False
jsonScript.disableCheckEndTime boolean Whether to disable end time limit
Example: True
Allow empty: False
jsonScript.eventChartEnable boolean Whether to enable event chart, default is disabled (note only effective when 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 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, configurable (role (except owner), member UUID, team UUID)
Example: ['wsAdmin', 'acnt_xxxx', 'group_yyyy']
Allow empty: False

Parameter Supplementary Description

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 '{"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>Recommendation: 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>Recommendation: 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? ×