Enabling or Disabling an Alarm Rule
Function
This API is used to enable or disable an alarm rule.

For API V1, only an alarm rule can be configured for a single resource. You are advised to use Enabling or Disabling Alarm Rules in Batches to work with the console.
Debugging
You can debug the API in API Explorer which supports automatic authentication. API Explorer can automatically generate and debug example SDK code.
URI
PUT /V1.0/{project_id}/alarms/{alarm_id}/action
- Parameter description
Table 1 Parameter description Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID. It is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details about how to obtain the project ID, see Obtaining a Project ID.
Constraints
N/A
Range
1 to 64 characters
Default Value
N/A
alarm_id
Yes
Definition
Alarm rule ID.
Constraints
N/A
Range
The value starts with al and is followed by 22 characters of letters, digits, or a combination of both. The value can contain a maximum of 24 characters.
Default Value
N/A
- Example
PUT https://{Cloud Eye endpoint}/V1.0/{project_id}/alarms/al1441967036681YkazZ0deN/action
Request
- Request parameters
Table 2 Request parameters Parameter
Mandatory
Type
Description
alarm_enabled
Yes
Boolean
Definition
Whether to enable the alarm rule.
Constraints
N/A
Range
A boolean value. The value can be true (enabled) or false (disabled).
Default Value
N/A
- Example request
{ "alarm_enabled":true }
Response
The response has no message body.
Returned Values
- Normal
- Abnormal
Returned Value
Description
400 Bad Request
Request error.
401 Unauthorized
The authentication information is not provided or is incorrect.
403 Forbidden
Access to the requested page is forbidden.
408 Request Timeout
The request timed out.
429 Too Many Requests
Concurrent requests are excessive.
500 Internal Server Error
Failed to complete the request because of an internal service error.
503 Service Unavailable
The service is currently unavailable.
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot