Skip to content

Disable/Enable



POST /api/v1/slo/{slo_uuid}/set_disable

Overview

Set the enable/disable status of the specified SLO.

Before Calling and Usage Steps

The current API Key requires monitor.sloCfgManage; metric-based saving also requires query permission for the target metric namespace. SLO management permission alone is insufficient to pass this prerequisite check. The operation applies only to the workspace to which the Key belongs. For the path SLO UUID, use content.data[].uuid from Get SLO List (usually prefixed with monitor_), not the Rule UUID of the associated monitor or metricQueryInfo.sloId.

Enabling/disabling also adjusts the SLO, associated detection/calculation components, and remote scheduling. It returns only the array of SLO names whose status actually changed this time, not all requested UUIDs or a per-item success mapping. If the SLO is already in the target state, it returns [] and does not repeatedly modify the remote side; if the target is invalid/deleted/cross-workspace, NotFoundSLO is returned.

Disabling a metric-based SLO records the stop time; re-enabling from disabled resets validAfter, and statistics after recovery should not be directly merged into the old effective interval. Pausing a monitor-based SLO does not delete the original SLI monitor; this operation does not pause the original monitor itself. Creation, modification, and enabling/disabling are committed at the end of the local transaction; on failure, the system attempts to restore remote scheduling and caches. Remote compensation may also fail, so an HTTP failure does not mean no changes occurred in all systems. After a network timeout/500, first check the configuration and status via Get SLO Details; if necessary, ask the administrator to verify scheduling before retrying. A successful save does not mean detection results have been generated; wait for the detection frequency and check the actual data.

Route Parameters

Parameter Type Required Description
slo_uuid string Y Target SLO UUID; not the SLI monitor UUID or metricQueryInfo.sloId.
Example: monitor_example
How to obtain or fill: Read content.data[].uuid from Get SLO List.

Request Headers

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

Body Request Parameters

Parameter Type Required Description
isDisable boolean Y Required boolean; true disables, false enables. Strings or null are not accepted. Disabling does not delete the configuration.
Allow null: False
Example: true
How to obtain or fill: Choose based on whether to pause SLO detection.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/slo/monitor_example/set_disable' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"isDisable":true}'

Response

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

Field Type Description
content array<string> Names of SLOs whose status actually changed this time; [] if no change; order is not guaranteed.
content[] string Name of an SLO whose status changed.
{
  "code": 200,
  "content": [
    "支付服务可用性"
  ],
  "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 Request field is missing, or the 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 Fix 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 an object.
404 ft.NotFoundSLO The target is not in the current workspace, has been deleted, or is not an SLO; for modification, this also includes missing required detection/calculation components The specified SLO was not found Get the uuid from the SLO list in the current workspace; confirm the target still exists, and ask the administrator to repair missing components.
400 ft.OuterFuncFailed 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 current configuration state, then retry.
400 ft.SameSetTraggerExists Remote scheduling service reports that the same trigger configuration already exists A trigger with the same configuration already exists First check the SLO and remote scheduling, handle residual/duplicate configurations, and then submit again.
500 ft.InternalServerError Database/cache, task queue, invalid array member, or unhandled downstream exception; failure may also have remote changes Internal error First check the target SLO configuration and current scheduling state; for deletion failures, also verify the deleted state. Do not blindly repeat creation or batch overwrite.

Feedback

Is this page helpful?