All Products
Search
Document Center

Auto Scaling:EnableAlarm

Last Updated:May 17, 2024

Enables an event-triggered task. If your business pattern is unpredictable or prone to unforeseen traffic spikes, you can create event-triggered tasks by associating CloudMonitor metrics to effectively monitor fluctuations in your business workload. Upon detecting that the criteria for alerts, as specified in event-triggered tasks, are fulfilled, Auto Scaling promptly issues alerts and executes the scaling rules predefined within those tasks. This process occurs within the predefined effective time windows of the tasks, thereby facilitating the automatic increase or decrease of Elastic Compute Service (ECS) instances or elastic container instances within your scaling groups. Ultimately, this mechanism ensures the dynamic optimization of resources based on real-time workload demands. If you want to reuse an event-triggered task that is in the Disabled state, you can call the EnableAlarm operation to enable it.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

EnableAlarm

The operation that you want to perform. Set the value to EnableAlarm.

RegionId

String

Yes

cn-qingdao

The region ID.

AlarmTaskId

String

Yes

asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****

The ID of the event-triggered task.

Response parameters

Parameter

Type

Example

Description

RequestId

String

688B18B8-FB1E-42EB-A1ED-7F55B090****

The request ID.

Examples

Sample requests

http(s)://ess.aliyuncs.com/?Action=EnableAlarm
&RegionId=cn-qingdao
&AlarmTaskId=asg-bp1hvbnmkl10vll5****_f95ce797-dc2e-4bad-9618-14fee7d1****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<EnableAlarmResponse>
    <RequestId>688B18B8-FB1E-42EB-A1ED-7F55B090****</RequestId>
</EnableAlarmResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "688B18B8-FB1E-42EB-A1ED-7F55B090****"
}

Error codes

For a list of error codes, see Service error codes.