You need to enable JavaScript to run this app.
导航

DescribeSubscriptions

最近更新时间2023.11.20 19:40:49

首次发布时间2023.01.06 07:41:48

调用 DescribeSubscriptions 接口,查询事件通知订阅列表。

调试

请求参数

名称类型是否必填示例值描述
ActionStringDescribeSubscriptions要执行的操作,取值:DescribeSubscriptions。
VersionString2020-04-01API的版本,取值: 2020-04-01。

SubscriptionIds.N

String

SubscriptionIds.1=s-9ks1al1y9630lp******&SubscriptionIds.2=s-9ks1al1y9630lp******

订阅ID,最多支持100个ID。您可以调用CreateSubscription接口订阅事件通知,或调用本接口查询已订阅通知列表获取。

  • 参数 - N:表示订阅ID的序号。
  • 多个订阅ID之间用&分隔。

Type

String

Notification

订阅类型,取值:

  • Notification:消息通知,通知渠道为短信、邮件、站内信、飞书。
NextTokenString3tiegs1y963vj0******分页查询凭证,用于标记分页的位置,初次调用该接口时无需设置。下次查询时,取值为上一次API调用返回的NextToken参数值。
MaxResultsInteger20分页查询时每页的行数,取值范围为1~100,默认值为20。

返回数据

名称类型示例值说明
NextTokenString6y6ug5ua2is5j0******本次调用返回的查询凭证值,返回为空表示该页为末页。
SubscriptionsArray of struct-订阅列表。具体请参见下表“Subscriptions 结构”。

Subscriptions 结构

名称类型示例值说明
IdStrings-7uw3fs5vj0******订阅ID。
EventTypesList["AccountUnbalanced.Stop:Succeeded", "FileSystemReadOnly.Change:Succeeded"]事件类型列表。
TypeStringNotification订阅类型。
CreatedAtString2022-11-18T19:11:46+08:00创建时间。
UpdatedAtString2022-11-18T20:11:57+08:00更新时间。

请求示例

GET /?Action=DescribeSubscriptions&Version=2020-04-01 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
ServiceName: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202106111445100102252431000052****",
        "Action": "DescribeSubscriptions",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {
        "Subscriptions": [
            {
                "Id": "s-7uw3fs5vj0******",
                "EventTypes": ["AccountUnbalanced.Stop:Succeeded", "FileSystemReadOnly.Change:Succeeded"],
                "Type": "Notification",
                "CreatedAt": "2022-11-18T19:11:46+08:00",
                "UpdatedAt": "2022-11-18T20:11:57+08:00"
            }
        ],
        "NextToken": ""
    }
}

错误码

HttpCode错误码错误信息描述
400InvalidArgumentThe specified argument is invalid.指定的参数不合法。
400InvalidType.MalformedThe specified Type is malformed.指定的Type不合法。
400LimitExceeded.MaximumMaxResultsThe number of specified MaxResults exceeds the maximum limit.指定的MaxResults超过最大限制。
400LimitExceeded.MinimumMaxResultsThe number of specified MaxResults exceeds the minimum limit.指定的MaxResults超过最小限制。
400LimitExceeded.MaximumSubscriptionIdsThe number of specified SubscriptionIds exceeds the maximum limit.指定的SubscriptionIds超过最大限制。
500InternalErrorAn internal error has occurred.内部错误,请重试。如果多次尝试失败,请提交工单。