Skip to content

Modify v2



POST /api/v1/alert_policy/{alert_policy_uuid}/modify_v2

Overview

Modify the specified alert strategy configuration information based on alert_policy_uuid. Version 2 supports synchronous updates of associated monitors/intelligent monitors/intelligent inspections/slos, and security monitoring.

Route Parameters

Parameter Name Type Required Description
alert_policy_uuid string Y Alert Strategy UUID

Body Request Parameters

Parameter Name Type Required Description
name string Monitor name
Allow to be empty: False
desc string Description
Allow to be empty: False
Allow empty string: True
Maximum length: 256
openPermissionSet boolean Enable custom permission configuration (default false: not enabled), after enabling, operation permissions for this rule are based on permissionSet
Allow to be empty: False
permissionSet array Operation permission configuration, configurable (roles (except owner), member UUIDs, team UUIDs)
Example: ['wsAdmin', 'acnt_xxxx', 'group_yyyy']
Allow to be empty: False
checkerUUIDs array Monitor/Intelligent monitor/Intelligent inspection/SLO UUID (added in iteration on December 11, 2024)
Example: ['rule_xxx', 'monitor_xxx']
Allow to be empty: False
securityRuleUUIDs array Security monitoring (CSPM, SIEM) UUID
Example: ['srul_xxx', 'srul_xxx', 'srul_xxx']
Allow to be empty: False
ruleTimezone str Y Alert strategy time zone
Example: Asia/Shanghai
Allow to be empty: False
alertOpt json Alert settings
Allow to be empty: False
alertOpt.aggType string Alert aggregation type, default old version logic if this field is not passed (iteration added on December 25, 2024)
Allow to be empty: True
Possible values: ['byFields', 'byCluster', 'byAI']
alertOpt.alertType string Alert strategy notification type, level (status)/member (member), default is level
Allow to be empty: False
Possible values: ['status', 'member']
alertOpt.silentTimeout integer Alert settings
Allow to be empty: False
alertOpt.alertTarget array Trigger actions, note trigger times, parameter handling
Example: [{'name': 'Notification Configuration 1', 'targets': [{'to': ['acnt_xxxx32'], 'status': 'critical', 'tags': {'pod_name': ['coredns-7769b554cf-w95fk']}, 'upgradeTargets': [{'to': ['acnt_xxxx32'], 'duration': 600}, {'to': ['group_xxxx32'], 'duration': 6000}]}], 'crontabDuration': 600, 'crontab': '0 9 * * 0,1,2,3,4'}, {'name': 'Notification Configuration 2', 'targets': [{'status': 'error', 'to': ['group_xxxx32'], 'upgradeTargets': [{'to': ['acnt_xxxx32'], 'duration': 600}, {'to': ['group_xxxx32'], 'duration': 6000}]}], 'customDateUUIDs': ['ndate_xxxx32'], 'customStartTime': '09:30:10', 'crontabDuration': 600}]
Allow to be empty: False
alertOpt.aggInterval integer Y Alert aggregation interval, unit seconds, 0 means no aggregation
Allow to be empty: False
$minValue: 0
$maxValue: 1800
alertOpt.aggFields array Aggregation field list, keep an empty list [] to represent "Aggregation Rule: All", df_monitor_checker_id: Monitors/Intelligent Inspection/SLO, df_dimension_tags: Detection Dimensions, df_label: Labels, CLUSTER: Intelligent Aggregation
Example: ['CLUSTER']
Allow to be empty: False
alertOpt.aggLabels array List of label values when aggregating by labels, takes effect only if df_label is specified in aggFields
Allow to be empty: False
alertOpt.aggClusterFields array Field list for intelligent aggregation, takes effect only if CLUSTER is specified in aggFields, possible values "df_title": Title, "df_message": Content
Example: ['df_title']
Allow to be empty: False

Parameter Additional Explanation

Request Example

curl 'https://openapi.guance.com/api/v1/alert_policy/altpl_xxxx32/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"name":"jj_modify","ruleTimezone":"Asia/Shanghai","alertOpt":{"alertTarget":[{"targets":[{"status":"warning","to":["notify_xxxx32"]}]}],"silentTimeout":21600,"aggInterval":120,"aggFields":["df_monitor_checker_id"]}}' \
--compressed

Response

{
    "code": 200,
    "content": {
        "alertOpt": {
            "aggFields": [
                "df_monitor_checker_id"
            ],
            "aggInterval": 120,
            "alertTarget": [
                {
                    "targets": [
                        {
                            "status": "warning",
                            "to": [
                                "notify_xxxx32"
                            ]
                        }
                    ]
                }
            ],
            "silentTimeout": 21600
        },
        "createAt": 1706152082,
        "creator": "xxxx",
        "declaration": {},
        "deleteAt": -1,
        "id": 4100,
        "name": "jj_modify",
        "ruleTimezone": "Asia/Shanghai",
        "score": 0,
        "status": 0,
        "updateAt": 1706152339.7920609,
        "updator": "xxx",
        "uuid": "altpl_xxxx32",
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-D38C6668-6F44-45E8-B8A4-BD28EBF142DE"
} 

Feedback

Is this page helpful? ×