You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Monitoring
CreateSubscription - Subscribes to event notifications
Copy page
Download PDF
CreateSubscription - Subscribes to event notifications
Call the CreateSubscription operation to subscribe to system event notifications.​
Usage notes​
For one Type (which indicates the subscription type), you can only subscribe to event notifications once by using this operation. To modify EventTypes.N (event type) of the specified Type, call the ModifySubscriptionEventTypes operation and pass in the subscription ID, which is the value of SubscriptionId in this operation.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
Only the request parameters specific to this operation and some common parameters are listed below. For more information, refer to Common parameters.​
Action string required Sample value: CreateSubscription​
The operation that you want to perform. Value: CreateSubscription.​
​
Version string required Sample value: 2020-04-01​
The version of the API. Valid value: 2020-04-01.​
​
EventTypes.N string[] required Sample value: EventTypes.1=SystemFailure.Stop:Succeeded&EventTypes.2=SystemFailure.Stop:Succeeded​
The event type. A maximum of 100 types is supported.​
  • Argument - N: specifies the serial number of the event type.​
  • Separate multiple event types with &.​
​
Type string required Sample value: Notification​
The subscription type. Value:​
  • Notification: Message notification. Notification channels include SMS, email, internal message, and Feishu.​
​
​
​
Response parameters​
Only the response parameters specific to this operation are listed below. For more information, refer to the response structure.​
SubscriptionId string Sample value: s-4shu38sa4mjx******​
The subscription ID.​
​
​
​
Sample request​
​
GET /?Action=CreateSubscription&Version=2020-04-01&EventTypes.1=SystemFailure.Stop:Succeeded&EventTypes.2=SystemFailure.Stop:Succeeded&Type=Notification HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
ServiceName: ecs​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "20210611144510010225243100005******",​
"Action": "CreateSubscription",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"SubscriptionId": "s-4shu38sa4mjx******"​
}​
}​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error code​
Error message​
Description​
400​
InvalidArgument​
The specified argument is invalid.​
The specified parameter is invalid.​
400​
InvalidEventTypes.Malformed​
The specified EventTypes is malformed.​
The specified value of EventTypes is invalid.​
400​
InvalidType.Malformed​
The specified Type is malformed.​
The specified value of Type is invalid.​
400​
LimitExceeded.MaximumEventTypes​
The number of specified EventTypes exceeds the maximum limit.​
The number of specified event types exceeds the upper limit.​
400​
LimitExceeded.MaximumSubscriptions​
You've reached the limit on the number of subscriptions that you can create.​
The number of subscriptions exceeds the upper limit. Only one subscription of the same type can be created.​
400​
MissingParameter.EventTypes​
The required parameter EventTypes is not supplied.​
The parameter EventTypes cannot be left empty.​
400​
MissingParameter.Type​
The required parameter Type is not supplied.​
The parameter Type cannot be left empty.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Try again. If multiple attempts fail, submit a ticket.​
​
​
Last updated: 2026.04.17 10:57:31