开发者社区 问答 正文

查询事件通知




描述


查询您创建的弹性伸缩事件及资源变化通知(DescribeNotificationConfigurations)。

请求参数

名称类型是否必需描述
ActionString系统规定参数。取值:DescribeNotificationConfigurations
ScalingGroupIdString伸缩组 ID。


返回参数

名称类型描述
RequestIdString请求 ID
NotificationConfigurationModelsArray of NotificationConfigurationModelSet事件及资源变化通知集合


NotificationConfigurationModelSet

名称类型描述
ScalingGroupIdString伸缩组 ID
NotificationArnString通知对象标识符
NotificationTypesArray of NotificationTypeSet弹性伸缩事件及资源变化通知类型列表


NotificationTypeSet

名称类型描述
NotificationTypeString弹性伸缩事件及资源变化通知类型。您可以通过接口 DescribeNotificationTypes 查询参数取值。


示例



请求示例

  1. http://ess.aliyuncs.com/?Action=DescribeNotificationConfigurations
  2. &ScalingGroupId=AG6CQdPU8OKdwLjgZcJ2eaQ
  3. &<公共请求参数>


返回示例


XML 格式
  1. <DescribeNotificationConfigurationsResponse>
  2.     <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
  3.     <NotificationConfigurationModels>
  4.         <NotificationConfigurationModel>
  5.             <NotificationArn>xxxxxxxxx</NotificationArn>
  6.             <ScalingGroupId>xxxxxxxxxxx</ScalingGroupId>
  7.             <NotificationTypes>
  8.                 <NotificationType>AUTOSCALING:SCALE_IN_SUCCESS</NotificationType>
  9.                 <NotificationType>AUTOSCALING:SCALE_IN_ERROR</NotificationType>
  10.             </NotificationTypes>
  11.         </NotificationConfigurationModel>
  12.         <NotificationConfigurationModel>
  13.             <NotificationArn>xxxxxxxxx</NotificationArn>
  14.             <ScalingGroupId>xxxxxxxxxxx</ScalingGroupId>
  15.             <NotificationTypes>
  16.                 <NotificationType>AUTOSCALING:SCALE_IN_SUCCESS</NotificationType>
  17.                 <NotificationType>AUTOSCALING:SCALE_IN_ERROR</NotificationType>
  18.             </NotificationTypes>
  19.         </NotificationConfigurationModel>
  20.     </NotificationConfigurationModels>
  21. </DescribeNotificationConfigurationsResponse>

JSON 格式
  1. {
  2.     "notificationConfigurationModels": [
  3.     {
  4.       "notificationArn": "xxxxxxxxxx",
  5.       "notificationTypes": [
  6.         "AUTOSCALING:SCALE_OUT_SUCCESS",
  7.         "AUTOSCALING:SCALE_OUT_ERROR",
  8.         "AUTOSCALING:SCALE_IN_SUCCESS",
  9.         "AUTOSCALING:SCALE_IN_ERROR",
  10.         "AUTOSCALING:SCALE_REJECT"
  11.       ],
  12.       "scalingGroupId": "xxxxxxxxxx"
  13.     },
  14.     {
  15.       "notificationArn": "xxxxxxxxxx",
  16.       "notificationTypes": [
  17.         "AUTOSCALING:SCALE_OUT_SUCCESS",
  18.         "AUTOSCALING:SCALE_OUT_ERROR",
  19.         "AUTOSCALING:SCALE_IN_SUCCESS",
  20.         "AUTOSCALING:SCALE_IN_ERROR",
  21.         "AUTOSCALING:SCALE_REJECT"
  22.       ],
  23.       "scalingGroupId": "xxxxxxxxxx"
  24.     }
  25.   ],
  26.   "requestId": "EEAB83FF-318A-41CA-8EB6-BB9614256BA9"
  27. }


错误码

错误代码错误信息HTTP 状态码说明
InvalidScalingGroupId.NotFoundThe specified scaling group does not exist.404指定的伸缩组不存在。

展开
收起
青蛙跳 2018-08-17 13:59:10 1369 分享 版权
阿里云 AI 助理回答

为了查询您创建的弹性伸缩事件及资源变化通知,您需要调用阿里云Elastic Scaling Service (ESS) API中的DescribeNotificationConfigurations方法。以下是执行此操作的详细说明:

请求参数

  • Action: 必需参数,固定值为DescribeNotificationConfigurations,表示要执行的操作类型。
  • ScalingGroupId: 必需参数,指定想要查询其通知配置的伸缩组ID。

返回参数概述

API调用成功后,您将收到以下结构的响应数据:

  • RequestId: 响应请求的唯一标识符。
  • NotificationConfigurationModels: 一个集合,包含多个NotificationConfigurationModelSet对象,每个对象代表一种通知配置详情:
    • ScalingGroupId: 与通知配置关联的伸缩组ID。
    • NotificationArn: 通知对象的标识符,可以是云监控、MNS队列或MNS主题的ARN。
    • NotificationTypes: 一个列表,包含该配置下关注的弹性伸缩事件及资源变化通知类型。

其中,每个NotificationTypeSetNotificationTypes列表中定义了具体的事件类型,例如扩容成功、缩容成功等。

示例请求

通过构造如下格式的HTTP请求,您可以查询指定伸缩组的通知配置:

http://ess.aliyuncs.com/?Action=DescribeNotificationConfigurations&ScalingGroupId=您的伸缩组ID

请替换您的伸缩组ID为实际的伸缩组ID值。

注意事项

  • 确保您已具备调用ess:DescribeNotificationConfigurations操作的权限。
  • 如果您想了解所有可能的NotificationType取值,可以通过调用DescribeNotificationTypes接口获取。
  • 考虑到API版本更新,请参考最新的官方文档以获取最准确的操作指导和参数信息。

通过上述步骤,您可以有效地查询到指定弹性伸缩组的事件及资源变化通知配置详情。

有帮助
无帮助
AI 助理回答生成答案可能存在不准确,仅供参考
0 条回答
写回答
取消 提交回答