Batch Delete¶
POST /api/v1/slo/batch_delete
Overview¶
Delete a batch of SLOs in the current workspace.
Before You Call and Usage Steps¶
The current API Key requires monitor.sloCfgManage; saving metric-type SLOs also requires query permission on the target metric namespace, so SLO management permission alone is not enough to pass this precondition check. Operations are limited to the workspace the key belongs to; the path SLO UUID comes from content.data[].uuid in Get SLO List (usually with a monitor_ prefix), not the Rule UUID of an associated monitor or metricQueryInfo.sloId.
This is a POST batch delete API with write side effects. Before calling it, back up the SLOs and their associations, and check whether references such as status pages need adjustment. It deletes the SLO itself, its detection/computation components, and its SLI/alert policy/tag associations; it does not delete the referenced original SLI monitors and alert policies, and it does not promise to clean up historical time series data. Remote scheduling is deleted first, then the local deletion is committed, and policy caches are cleaned up asynchronously after commit; these stages are not a cross-service transaction, so a failure may mean scheduling has already been stopped or the local deletion has already been committed.
If nothing matches in the current workspace, or only non-SLO items match, it returns []; when actual deletions occur it returns true (not per-item results or a deletion count); some invalid UUIDs are ignored, so you must read back the list item by item to verify. Submit only confirmed SLO UUIDs; do not mix in other resources such as regular monitor groups. After a network failure or a 500, check the SLO list and the current scheduling state first to avoid blind retries.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential of the workspace. Example: <DF-API-KEY>How to obtain or fill in: obtain an OpenAPI Key with the required permission from API Key management in the target workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| sloUUIDs[*] | string | A single SLO UUID string in the current workspace. Example: monitor_exampleHow to obtain or fill in: same source as the array. |
|
| sloUUIDs | array | Y | Required array; pass only real SLO UUIDs; [] with no targets returns []. Invalid/cross-workspace/already-deleted targets are not listed as local deletion objects; this API does not return per-item failures. Do not mix in regular monitor group UUIDs: as long as the batch contains a valid SLO, remote scheduling deletion still iterates over all submitted UUIDs.Allows null: False Example: ["monitor_example"]How to obtain or fill in: take each content.data[].uuid from the SLO list of the current workspace, and verify the names and dependencies first. |
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/slo/batch_delete' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"sloUUIDs":["monitor_example"]}'
Response¶
HTTP 200, application/json. The examples below show the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | boolean or array<string> |
true when actual deletions occur; [] when no deletable SLO matches, with no per-item results returned. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
{
"code": 200,
"content": [],
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
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 | Verify the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | The request JSON syntax is invalid | Request JSON format error | Fix the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | The top level of the JSON is not an object | Some json file format error | Submit an sloUUIDs array object. |
| 400 | ft.OuterFuncFailed | The remote scheduling service returned a failure | External function call failed (some branches use the downstream message) | Check message and traceId, ask the administrator to verify scheduling availability and the current configuration state, then retry. |
| 400 | ft.SameSetTraggerExists | The remote scheduling service reports that an identical trigger configuration already exists | A trigger with the same configuration already exists | Check the SLO and its remote scheduling first, handle the residual/duplicate configuration, then submit again. |
| 500 | ft.InternalServerError | Database/cache, task queue, invalid array members, or an unhandled downstream exception; a failure may also mean remote changes have already been made | Internal error | Check the target SLO configuration and current scheduling state first; for a deletion failure, also verify the deleted state, and do not blindly repeat creation or batch overwrite. |