You can call this operation to configure notifications for scaling events and resource changes.

Description

You can configure CloudMonitor system events, MNS queues, or MNS topics to send notifications to. When a scaling event or resource change of a specified type occurs in a scaling group, Auto Scaling sends notifications to CloudMonitor or MNS.

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
NotificationArn String Yes acs:ess:cn-hangzhou:123456:cloudmonitor

The Alibaba Cloud Resource Name (ARN) of the notification object. The value must be in acs:ess:{region}:{account-id}:{resource-relative-id} format.

  • region: the region ID of the scaling group. For more information, see Regions and zones.
  • account-id: the ID of your account.
  • resource-relative-id: the notification method. Valid values:
    • cloudmonitor
    • MNS queue: queue/{queuename}. Replace the queuename with the specific MNS queue name.
    • MNS topic: topic/{topicname}. Replace the topicname with the specific MNS topic name.
NotificationType.N RepeatList Yes AUTOSCALING:SCALE_OUT_SUCCESS

The notification types for scaling events and resource changes. Valid values of N: 1 to 8. Multiple values must be displayed in a repeated list format.

You can call the DescribeNotificationTypes operation to query parameter values.

ScalingGroupId String Yes AG6CQdPU8OKdwLjgZcJ****

The ID of the scaling group.

Action String No CreateNotificationConfiguration

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

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests


http://ess.aliyuncs.com/?Action=CreateNotificationConfiguration
&ScalingGroupId=AG6CQdPU8OKdwLjgZcJ****
&NotificationArn=acs:ess:cn-hangzhou:123456:cloudmonitor
&NotificationType.1=AUTOSCALING:SCALE_OUT_SUCCESS
&NotificationType.2=AUTOSCALING:SCALE_IN_SUCCESS
&NotificationType.3=AUTOSCALING:SCALE_OUT_ERROR
&NotificationType.4=AUTOSCALING:SCALE_IN_ERROR
&NotificationType.5=AUTOSCALING:SCALE_REJECT
&<Common request parameters>

Sample success responses

XML format

<CreateNotificationConfigurationResponse>
      <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</CreateNotificationConfigurationResponse>

JSON format

{
	"requestId":"473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

For more information about error codes, visit API Error Center.

HTTP status code

Error code

Error message

Description

400

InvalidNotificationArn

The specified parameter notificationArn is invalid.

The error message returned because the specified notification ARN is invalid.

400

InvalidNotificationTypes

The specified notificationType is invalid.

The error message returned because the specified notification type is invalid.

400

NotificationConfigurationExist

The specified notificationConfiguration already exist for the scalingGroup.

The error message returned because the specified event notification is already configured for the current scaling group.

400

NotificationConfigurationQuotaExceed.ForScalingGroup

NotificationConfiguration num exceed for the specified scalingGroup.

The error message returned because the maximum number of notification configurations set for the scaling group has been reached.

400

QueueNotExist

The specified queue queuename does not exist.

The error message returned because the specified MNS queue does not exist.

400

TopicNotExist

The specified template {name} does not exist.

The error message returned because the specified MNS topic does not exist.

400

UnsupportedNotificationType.CurrentRegion

The notificationType is not supported in the special region which scalingGroup belongs to.

The error message returned because the notification type is not supported in the region to which the scaling group belongs.

404

InvalidScalingGroupId.NotFound

The specified scaling group does not exist.

The error message returned because the specified scaling group does not exist.