You need to enable JavaScript to run this app.
文档中心
云服务器

云服务器

复制全文
下载 pdf
监控
CreateSubscription - 订阅事件通知
复制全文
下载 pdf
CreateSubscription - 订阅事件通知
调用 CreateSubscription 接口,订阅系统事件通知。​
注意事项​
同一Type(订阅类型)仅支持使用本接口订阅一次事件通知。如需调整该Type订阅的EventTypes.N(事件类型),请调用ModifySubscriptionEventTypes接口,传入本接口返回的SubscriptionId(订阅ID)完成操作。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:CreateSubscription​
要执行的操作,取值:CreateSubscription。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
EventTypes.N string[] 必选 示例值:EventTypes.1=SystemFailure.Stop:Succeeded&EventTypes.2=SystemFailure.Stop:Succeeded​
事件类型,最多支持100个。​
  • 参数 - N:表示事件类型的序号。​
  • 多个事件类型之间用&分隔。​
​
Type string 必选 示例值:Notification​
订阅类型,取值:​
  • Notification:消息通知,通知渠道为短信、邮件、站内信、飞书。​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
SubscriptionId string 示例值:s-4shu38sa4mjx******​
订阅ID。​
​
​
请求示例​
​
GET /?Action=CreateSubscription&Version=2020-04-01&EventTypes.1=SystemFailure.Stop:Succeeded&EventTypes.2=SystemFailure.Stop:Succeeded&Type=Notification HTTP/1.1​
Host: open.volcengineapi.com​
Region: cn-beijing​
ServiceName: ecs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20210611144510010225243100005******",​
"Action": "CreateSubscription",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"SubscriptionId": "s-4shu38sa4mjx******"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidArgument​
The specified argument is invalid.​
指定的参数不合法。​
400​
InvalidEventTypes.Malformed​
The specified EventTypes is malformed.​
指定的EventTypes不合法。​
400​
InvalidType.Malformed​
The specified Type is malformed.​
指定的Type不合法。​
400​
LimitExceeded.MaximumEventTypes​
The number of specified EventTypes exceeds the maximum limit.​
指定的EventTypes超过最大限制。​
400​
LimitExceeded.MaximumSubscriptions​
You've reached the limit on the number of subscriptions that you can create.​
订阅数量超过最大限制,同类型订阅仅允许创建一个。​
400​
MissingParameter.EventTypes​
The required parameter EventTypes is not supplied.​
参数EventTypes不能为空。​
400​
MissingParameter.Type​
The required parameter Type is not supplied.​
参数Type不能为空。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2025.06.30 17:39:22
这个页面对您有帮助吗?
有用
有用
无用
无用