Updated on 2025-11-14 GMT+08:00

Deleting a SQL Alarm Rule

Function

This API is used to delete a SQL alarm rule.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    lts:alarmRule:deleteSqlAlarmRule

    Write

    alarmRule *

    -

    • lts:sqlalarmrules:delete

    -

URI

DELETE /v2/{project_id}/lts/alarms/sql-alarm-rule/{sql_alarm_rule_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. It can be obtained by calling an API or from the console. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

sql_alarm_rule_id

Yes

String

Definition

SQL alarm rule ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token obtained from IAM. For details about how to obtain it, see Obtaining a User Token.

Constraints

N/A

Range

N/A

Default Value

N/A

Content-Type

Yes

String

Definition

Message body format. Set this parameter to application/json;charset=utf8.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

The request is successful.

Status code: 500

Table 3 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code. For details, see Error Codes.

Range

N/A

error_msg

String

Definition

Error message.

Range

N/A

Example Requests

Delete a SQL alarm rule based on its ID.

POST https://{endpoint}/v2/{project_id}/lts/alarms/sql-alarm-rule/{sql_alarm_rule_id}

/v2/{project_id}/lts/alarms/sql-alarm-rule/{sql_alarm_rule_id}

Example Responses

Status code: 500

The server has received the request but encountered an internal error.

{
  "error_code" : "LTS.2002",
  "error_msg" : "Failed to delete alarm rule."
}

Status Codes

Status Code

Description

200

The request is successful.

500

The server has received the request but encountered an internal error.

Error Codes

See Error Codes.