Delete¶
POST /api/v1/alert_policy/delete
Overview¶
Bulk delete Alert Policies in the current Workspace, clean up the corresponding Monitor and Security Rule associations, and refresh the Cache.
Before You Call and Usage Steps¶
Obtain the target UUID from the Alert Policy List, and submit after confirming that the notification rule is no longer needed. Custom operation permissions are verified for each policy found; if no matching policy is found, ObjectNotExists is returned. Deleting a policy does not delete the Monitor/SLO/Security Rule resources themselves; the relationships currently explicitly cleaned up are regular Monitor and Security Rule relationships. SLO relationships cannot be assumed to be automatically removed in all cases, so verify the association page after deletion. On success, it returns true; Cache cleanup and some relationship Cache updates involve asynchronous steps; notifications already being processed are not guaranteed to be withdrawn. Saving and Cache refresh are not equivalent to notification delivery; actual sending depends on valid targets, event severity, time period, filters, duplicate suppression, and the alert execution service. After a failure or timeout, first read the policy and binding status to avoid duplicate creation or misjudging a partial update.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the Workspace. Example: <DF-API-KEY>How to obtain or fill in: Obtain an OpenAPI Key with this operation permission from API Key Management in the target Workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| alertPolicyUUIDs[*] | string | A single altpl_ Alert Policy UUID. Example: altpl_exampleHow to obtain or fill in: Copy a policy UUID from the Alert Policy List. |
|
| alertPolicyUUIDs | array | Y | Array of policy UUIDs to delete; required. Submit a non-empty array. Only undeleted policies in the current Workspace are processed. Allow null: False Example: ["altpl_example"]How to obtain or fill in: Obtain the target UUID in the same Workspace from content.data[].uuid in the Alert Policy List. |
Additional Parameter Notes¶
Individual UUIDs that do not exist in the batch are not guaranteed to return errors item by item; confirm the final result by re-reading the list and association information.
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/alert_policy/delete' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"alertPolicyUUIDs":["altpl_example"]}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | boolean | true if deletion processing succeeds; per-UUID results are not provided. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | A request field is missing, or a field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Invalid request JSON syntax | Request JSON format error | Correct the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | The JSON top level is not an object | Part of the JSON file format is incorrect | Submit a single JSON object. |
| 404 | ft.ObjectNotExists | No matching undeleted policy is found in the current Workspace, including when the array is empty | The specified object does not exist | Reconfirm the UUID and Workspace. |
| 403 | ft.ForbiddenAlertPolicyOperation | A policy does not allow the current identity to operate on it | You do not have operation permission for Alert Policy [{}] | First obtain operation authorization for these policies. |
| 403 | ft.Forbidden | The current identity lacks API operation permission | You do not have permission to perform this operation | Use an API Key with delete permission. |
| 500 | ft.InternalServerError | Relationship, Cache, or other deletion processing fails | Internal error | First check the policy and relationship status, then decide whether to retry; if the failure persists, provide the traceId. |