描述
创建弹性伸缩事件及资源变化通知(CreateNotificationConfiguration)。您可以设置由
云监控系统事件、
消息服务 MNS 队列 或者
MNS 主题 接收消息通知。当伸缩组发生指定类型的伸缩事件或者资源变化时,弹性伸缩会发送消息通知云监控或 MNS。
目前,有部分阿里云地域暂未部署 MNS 队列 和 MNS 主题服务,具体详情,请访问
MNS 管理控制台 或者参阅
MNS 常见问题。
请求参数
名称 | 类型 | 是否必需 | 描述 |
Action | String | 是 | 系统规定参数。取值:CreateNotificationConfiguration |
ScalingGroupId | String | 是 | 伸缩组 ID。 |
NotificationArn | String | 是 | 通知对象标识符。格式为 acs:ess:{region}:{account-id}:{resource-relative-id},其中:
|
NotificationType.N | String | 是 | 一类或者多类弹性伸缩事件及资源变化通知。N 的取值范围:[1, 5],多个取值使用重复列表的形式。您可以通过接口 DescribeNotificationTypes 查询参数取值。 |
名称 | 类型 | 描述 |
RequestId | String | 请求 ID |
XML 格式
JSON 格式
错误代码 | 错误信息 | HTTP 状态码 | 说明 |
InvalidNotificationArn | The specified param “notificationArn” is invalid. | 400 | 指定的 NotificationArn 不合法。 |
InvalidNotificationTypes | The specified notificationType is invalid. | 400 | 指定的 NotificationType.N不合法。 |
NotificationConfigurationExist | The specified notificationConfiguration already exist for the scalingGroup. | 400 | 指定的事件通知已经存在于当前伸缩组中。 |
NotificationConfigurationQuotaExceed.ForScalingGroup | NotificationConfiguration num exceed for the specified scalingGroup. | 400 | 当前伸缩组配置的通知功能超出允许的上限值。 |
QueueNotExist | The specified queue “queuename” does not exist. | 400 | 指定的 MNS 队列不存在。 |
TopicNotExist | The specified topic “topicname” does not exist. | 400 | 指定的 MNS 主题不存在。 |
UnsupportedNotificationType.CurrentRegion | The notificationNotificationType “notificationType” is not supported in the special region which scalingGroup belong to. | 400 | 当前地域不支持该通知方式。 |
InvalidScalingGroupId.NotFound | The specified scaling group does not exist. | 404 | 指定的伸缩组不存在。 |
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
创建弹性伸缩事件及资源变化通知(CreateNotificationConfiguration)是阿里云弹性伸缩服务(Auto Scaling)提供的一项功能,旨在帮助用户实时监控和自动化管理其伸缩组的动态。通过配置该通知,当指定的伸缩事件或资源变化发生时,系统会自动向预设的通知渠道发送消息,支持的通知渠道包括:
CreateNotificationConfiguration
,表示创建通知配置的操作。acs:ess:{region}:{account-id}:cloudmonitor
;对于MNS队列则是 acs:mns:{region}:{account-id}:queue/{queuename}
;MNS主题为 acs:mns:{region}:{account-id}:topic/{topicname}
。其中 {region}
为地域ID,{account-id}
为您的阿里云账号ID,{queuename}
或 {topicname}
为具体的队列名或主题名。DescribeNotificationTypes
接口查询可选的事件类型列表,并以重复列表形式指定多个类型。http://ess.aliyuncs.com/
?Action=CreateNotificationConfiguration
&ScalingGroupId=asg-bp1igpak5ft1flypxxxxx
&NotificationArn=acs:ess:{region}:{account-id}:cloudmonitor
&NotificationType.1=SCALE_OUT_SUCCESS
&NotificationType.2=SCALE_IN_SUCCESS
请注意,部分阿里云地域可能尚未部署MNS队列和MNS主题服务,具体可用性请查阅MNS管理控制台或MNS常见问题文档以获取最新信息。
参考资料: - CreateNotificationConfiguration API 文档 - MNS 服务相关文档