Skip to content

Delete



POST /api/v1/aggs_to_metric/delete

Overview

Soft-delete Generate Metrics rules in batches and clean up the corresponding periodic schedules and resource relationships.

Before Calling and Usage Steps

First verify each target UUID; operate only on non-deleted rules in the current Workspace. If the request array has no matches (including []), ObjectNotExists is returned; partially unmatched UUIDs do not return per-item errors. On success, true is returned, the rules are set to deleted status, the corresponding schedules and resource associations are cleaned up, and generated historical metric data is not deleted.

These entry points share generic rule handling, and some target queries do not additionally restrict type=aggs; use only the UUIDs returned by this module's list to avoid misreading or modifying other rules.

Schedule deletion, database soft deletion, and association cleanup are executed in separate steps. On error, the schedule may already be deleted or the rule may already be saved; query the rule and relationship status before deciding whether to retry. Deletion does not guarantee that tasks already started will terminate immediately.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y Workspace OpenAPI authentication credential.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with the required operation permission from API Key Management in the target Workspace.

Body Request Parameters

Parameter Type Required Description
ruleUUIDs[*] string A single complete UUID; whitespace is not automatically trimmed.
Example: rul_aggs_example
How to obtain or enter: Obtain a single aggs rule UUID from the Generate Metrics rule list.
ruleUUIDs array Y Required string array; non-empty is recommended; it is not a comma-separated string; use only aggs UUIDs from this module's list, and do not rely on the same rul_ prefix to determine the type.
Allowed null: False
Example: ["rul_aggs_example"]
How to obtain or enter: Obtain each rule UUID from the Generate Metrics rule list.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/aggs_to_metric/delete' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"ruleUUIDs":["rul_aggs_example"]}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content boolean True when deletion processing is complete; per-item match results are not returned.
{
  "code": 200,
  "content": true,
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

See Common Error Definitions for authentication, rate limiting, and common request errors.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field missing, or field value violates declared validation conditions Parameter parsing failed Check 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 JSON top level is not an object Some JSON file format error Submit a JSON object according to the example.
404 ft.ObjectNotExists No non-deleted rules corresponding to any requested UUID in the current Workspace, including [] Specified object does not exist Obtain valid rule UUIDs from this module's list.
403 ft.Forbidden Current identity has no permission for deletion/resource operations You do not have permission to perform this operation Use an API Key with the corresponding operation permission.
400 ft.OuterFuncFailed Downstream schedule deletion returns failure External function call failed Check the schedule and rule status first; if it persists, provide traceId.
500 ft.InternalServerError Downstream timeout/normal 5xx, database, or subsequent metadata processing failure Internal error First read the rule and its status, output metrics, and current schedule state, then decide whether to retry; provide traceId.

Feedback

Is this page helpful?