开发者社区> 问答> 正文

创建事件通知




描述


创建弹性伸缩事件及资源变化通知(CreateNotificationConfiguration)。您可以设置由 云监控系统事件消息服务 MNS 队列 或者 MNS 主题 接收消息通知。当伸缩组发生指定类型的伸缩事件或者资源变化时,弹性伸缩会发送消息通知云监控或 MNS。
目前,有部分阿里云地域暂未部署 MNS 队列 和 MNS 主题服务,具体详情,请访问 MNS 管理控制台 或者参阅 MNS 常见问题

请求参数

名称类型是否必需描述
ActionString系统规定参数。取值:CreateNotificationConfiguration
ScalingGroupIdString伸缩组 ID。
NotificationArnString通知对象标识符。格式为 acs:ess:{region}:{account-id}:{resource-relative-id},其中:
  • region:伸缩组所在地域 ID。更多详情,请参阅 地域与可用区
  • account-id:您的账号 ID。
  • resource-relative-id :通知方式,可选值包括云监控cloudmonitor,MNS 队列 queue/{queuename} 和 MNS 主题 topic/{topicname}。
NotificationType.NString一类或者多类弹性伸缩事件及资源变化通知。N 的取值范围:[1, 5],多个取值使用重复列表的形式。您可以通过接口 DescribeNotificationTypes 查询参数取值。


返回参数

名称类型描述
RequestIdString请求 ID


示例



请求示例

  1. http://ess.aliyuncs.com/?Action=CreateNotificationConfiguration
  2. &ScalingGroupId=AG6CQdPU8OKdwLjgZcJ2eaQ
  3. &NotificationArn=acs:ess:cn-hangzhou:123456:cloudmonitor
  4. &NotificationType.1=AUTOSCALING:SCALE_OUT_SUCCESS
  5. &NotificationType.2=AUTOSCALING:SCALE_IN_SUCCESS
  6. &NotificationType.3=AUTOSCALING:SCALE_OUT_ERROR
  7. &NotificationType.4=AUTOSCALING:SCALE_IN_ERROR
  8. &NotificationType.5=AUTOSCALING:SCALE_REJECT
  9. &<公共请求参数>


返回示例


XML 格式
  1. <CreateNotificationConfigurationResponse>
  2.     <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
  3. </CreateNotificationConfigurationResponse>

JSON 格式
  1. {
  2.     "requestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
  3. }


错误码

错误代码错误信息HTTP 状态码说明
InvalidNotificationArnThe specified param “notificationArn” is invalid.400指定的 NotificationArn 不合法。
InvalidNotificationTypesThe specified notificationType is invalid.400指定的 NotificationType.N不合法。
NotificationConfigurationExistThe specified notificationConfiguration already exist for the scalingGroup.400指定的事件通知已经存在于当前伸缩组中。
NotificationConfigurationQuotaExceed.ForScalingGroupNotificationConfiguration num exceed for the specified scalingGroup.400当前伸缩组配置的通知功能超出允许的上限值。
QueueNotExistThe specified queue “queuename” does not exist.400指定的 MNS 队列不存在。
TopicNotExistThe specified topic “topicname” does not exist.400指定的 MNS 主题不存在。
UnsupportedNotificationType.CurrentRegionThe notificationNotificationType “notificationType” is not supported in the special region which scalingGroup belong to.400当前地域不支持该通知方式。
InvalidScalingGroupId.NotFoundThe specified scaling group does not exist.404指定的伸缩组不存在。

展开
收起
青蛙跳 2018-08-17 13:58:19 1297 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载