Disable/Enable¶
POST /api/v1/aggs_to_metric/set_disable
Overview¶
Batch disable or enable the Generate Metrics recurring tasks in the current Workspace.
Before You Call and Usage Steps¶
After verifying each aggs UUID in this module's list, submit isDisable together with the complete array. true disables and sets status=2; false enables and sets 0. The server synchronously updates matching rules and scheduling switches. If no rule is matched (including []), it can still return true and does not provide per-item results. Only non-deleted items in the current Workspace are updated; deleted rules are not restored.
These entry points share common rule processing, and some target queries do not additionally restrict type=aggs. Use only the UUIDs returned by this module's list to avoid misreading or changing other rules.
Enabling does not immediately backfill or return historical data, and disabling does not delete already generated metrics; running tasks are not guaranteed to be cancelled. Scheduling and the database are not in the same atomic transaction. After a failure, verify the status on both sides before retrying.
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 enter: Obtain an OpenAPI Key with the required operation permission from API Key management in the target Workspace. |
Request Body Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| ruleUUIDs[*] | string | A single complete UUID; whitespace is not automatically trimmed. Example: rul_aggs_exampleHow to obtain or enter: Get a single aggs rule UUID from the Generate Metrics rule list. |
|
| isDisable | boolean | Y | Required JSON boolean value; do not use the string "true". Allows null: False Example: trueHow to obtain or enter: true pauses subsequent recurring tasks, and false resumes recurring tasks. |
| ruleUUIDs | array | Y | Required string array; it is recommended to be non-empty and not a comma-separated string. Use only the aggs UUIDs in this module's list; do not rely on the same rul_ prefix to determine the type. Allows null: False Example: ["rul_aggs_example"]How to obtain or enter: Get each rule UUID from the Generate Metrics rule list. |
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/aggs_to_metric/set_disable' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"ruleUUIDs":["rul_aggs_example"],"isDisable":true}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | boolean | true on success; this does not mean all UUIDs were matched, nor is it an execution completion indicator. |
{
"code": 200,
"content": true,
"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 | Resolution |
|---|---|---|---|---|
| 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 | The request JSON syntax is invalid | 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 | Some JSON file format error | Submit a JSON object as shown in the example. |
| 403 | ft.Forbidden | The API operation permission is missing, or the matched rule does not allow the current identity to perform the operation | You do not have permission to perform this operation | Check the API Key permissions and the target rule. |
| 400 | ft.OuterFuncFailed | The batch scheduling switch call failed | External function call failed | Read back the actual rule status and scheduling status, then retry. |
| 400 | ft.SameSetTraggerExists | The scheduling service returned a duplicate configuration business error | A trigger with the same configuration already exists | Check the existing scheduling first; if the failure persists, provide the traceId. |
| 500 | ft.InternalServerError | Downstream timeout/general 5xx, or database or subsequent metadata processing failure | Internal error | First read the rule and its status, the output metrics, and the current scheduling state, then decide whether to retry; provide the traceId. |