Skip to content

Modify (This interface will be deprecated on 2025-12-30, v2 version is recommended)



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

Overview

Modify the configuration information of the specified alert policy based on the alert_policy_uuid.

Route Parameters

Parameter Name Type Required Description
alert_policy_uuid string Y Alert policy UUID

Body Request Parameters

Parameter Name Type Required Description
name string Monitor name
Allow null: False
desc string Description
Allow null: False
Allow empty string: True
Max length: 256
openPermissionSet boolean Enable custom permission configuration, (default false: disabled). When enabled, the operation permissions for this rule are based on permissionSet.
Allow null: False
permissionSet array Operation permission configuration, configurable (role (except owner), member uuid, team uuid).
Example: ['wsAdmin', 'acnt_xxxx', 'group_yyyy']
Allow null: False
ruleTimezone str Y Alert policy timezone.
Example: Asia/Shanghai
Allow null: False
alertOpt json Alert settings.
Allow null: False
alertOpt.alertType string Alert policy notification type, level(status)/member(member), default is level.
Allow null: False
Optional values: ['status', 'member']
alertOpt.silentTimeout integer Repeat alert configuration.
Allow null: False
alertOpt.silentTimeoutByStatusEnable boolean Whether to enable setting repeat alerts by level, default false, uses silentTimeout configuration.
Allow null: False
alertOpt.silentTimeoutByStatus array Setting repeat alerts by level, configuration for minimum alert interval by level.
Allow null: False
alertOpt.alertTarget array Trigger actions, note the parameter handling for trigger times.
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 null: False
alertOpt.aggInterval integer Y Alert aggregation interval, in seconds, 0 means no aggregation.
Allow null: False
$minValue: 0
$maxValue: 1800
alertOpt.aggFields array Aggregation field list, keep empty list [] to indicate "Aggregation rule: All", df_monitor_checker_id: monitor/intelligent inspection/SLO, df_dimension_tags: detection dimension, df_label: label, CLUSTER: intelligent aggregation.
Example: ['CLUSTER']
Allow null: False
alertOpt.aggLabels array Label value list for aggregation by label, only takes effect when df_label is specified in aggFields.
Allow null: False
alertOpt.aggClusterFields array Field list for intelligent aggregation, only takes effect when CLUSTER is specified in aggFields, optional values "df_title": title, "df_message": content.
Example: ['df_title']
Allow null: False

Parameter Supplementary Description

Request Example

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