Creates one or more simple application servers.
Description
- Before you call this operation, we recommend that you understand the billing of Simple Application Server. For more information, see Billable items.
- A maximum of 20 simple application servers can be created within an Alibaba Cloud account.
- When you call this operation to create simple application servers, make sure that the balance in your account is sufficient to pay for the servers. If the balance in your account is insufficient, the servers cannot be created.
QPS limits
The queries per second (QPS) limit for a single user for the API operation is 10 calls per minute. If the number of calls to the API operation per minute exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limit.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateInstances |
The operation that you want to perform. Set the value to CreateInstances. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the simple application servers. You can call the ListRegions operation to query the most recent region list. |
ImageId | String | Yes | e2c9c365024a44369c9b955a998a**** |
The ID of the image. You can call the ListImages operation to query the available images in the specified region. |
PlanId | String | Yes | swas.s1.c1m1s40b3t05 |
The ID of the plan. You can call the ListPlans operation to query all the plans provided by Simple Application Server in the specified region. |
Period | Integer | Yes | 1 |
The subscription period. Unit: months Valid values: 1, 3, 6, 12, 24, and 36. |
AutoRenew | Boolean | No | false |
Specifies whether to enable auto-renewal. Valid values:
Default value: false. |
AutoRenewPeriod | Integer | No | 1 |
The auto-renewal period. This parameter is required only when you set |
DataDiskSize | Long | No | 20 |
The size of the data disk. Unit: GB. Valid values: 0 to 16380. The value must be an integral multiple of 20.
Default value: 0. |
Amount | Integer | No | 1 |
The number of simple application servers that you want to create. Valid values: 1 to 20. Default value: 1. |
ChargeType | String | No | PrePaid |
The billing method of the simple application server. Set the value to PrePaid, which indicates the subscription billing method. Only the subscription billing method is supported. Default value: PrePaid. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-426655440000 |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 30637AD6-D977-4833-A54C-CC89483E1FEE |
The ID of the request. |
InstanceIds | Array of String | ["3a658ca270df4df39f22e289b338fbf4"] |
The IDs of the simple application servers. |
Examples
Sample requests
https://swas.cn-hangzhou.aliyuncs.com/?Action=CreateInstances
&ImageId=e2c9c365024a44369c9b955a998a****
&Period=1
&PlanId=swas.s1.c1m1s40b3t05
&AutoRenew=false
&DataDiskSize=20
&Amount=1
&ChargeType=PrePaid
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateInstancesResponse>
<RequestId>30637AD6-D977-4833-A54C-CC89483E1FEE</RequestId>
<InstanceIds>3a658ca270df4df39f22e289b338****</InstanceIds>
</CreateInstancesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "30637AD6-D977-4833-A54C-CC89483E1FEE",
"InstanceIds" : [ "3a658ca270df4df39f22e289b338****" ]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | NotEnoughStock | The stock is insufficient. | The error message returned because the resources are insufficient. |
400 | PlatformNotMatch | The platform of specified ImageId and PlanId does not match. | The error message returned because the specified plan is not applied to the image. |
400 | InvalidPeriod.ValueNotSupported | The specified parameter Period is invalid. | The error message returned because the specified Period parameter is invalid. |
400 | InvalidDataDiskSize.ValueNotSupported | The specified parameter DataDiskSize is invalid. | The error message returned because the specified DataDiskSize parameter is invalid. |
400 | InvalidAmount.ValueNotSupported | The specified parameter Amount is invalid. | The error message returned because the specified Amount parameter is invalid. |
400 | InvalidChargeType.ValueNotSupported | The specified parameter ChargeType is invalid. | The error message returned because the specified ChargeType parameter is invalid. |
400 | InvalidAutoRenewPeriod.ValueNotSupported | The specified parameter AutoRenewPeriod is invalid. | The error message returned because the specified AutoRenewPeriod parameter is invalid. |
400 | InvalidPlanIdSize.ValueNotSupported | The system disk size in the specified planId does not support the image. | The error message returned because the size of the system disk included in the specified plan does not support the current image. |
403 | PaymentFailed | Payment failed. Please check your account balance. | The error message returned because the payment failed. Check whether you have a sufficient balance within your account. |
403 | InvalidInstance.UnPaidOrder | The specified Instance has an unpaid order. | The error message returned because you have an unpaid order. Settle the payment and try again. |
403 | InvalidParam | The specified parameter value is invalid. | The error message returned because a specified parameter is invalid. |
404 | InvalidImageId.NotFound | The specified ImageId does not exist. | The error message returned because the specified ImageId parameter is invalid. |
404 | InvalidPlanId.NotFound | The specified PlanId does not exist. | The error message returned because the specified PlanId parameter is invalid. |
500 | InternalError | An error occurred while processing your request. | The error message returned because an internal error has occurred. Try again later. If the problem persists, submit a ticket. |
500 | NotEnoughUpgradeStock | The upgrade stock is insufficient. | The error message returned because the inventory is insufficient when you attempt to upgrade the configurations of resources. |
For a list of error codes, visit the API Error Center.