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.
  • Each Alibaba Cloud account can have up to 20 simple application servers.
  • When you call this operation to create a simple application server, make sure that you have sufficient balance within your account to pay for the server. Otherwise, the server cannot be created.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 server. 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:

  • true: enables auto-renewal.
  • false: does not enable auto-renewal.

Default value: false.

AutoRenewPeriod Integer No 1

The auto-renewal period. This parameter is required only when you set AutoRenew to true. Unit: months. Valid values: 1, 3, 6, 12, 24, and 36.

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.

  • A value of 0 indicates that no data disk is attached.
  • If the disk included in the specified plan is a standard SSD, the data disk must be 20 GB or larger in size.

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 token. Make sure that the token is unique among different requests. ClientToken can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see Ensure idempotence.

Response parameters

Parameter Type Example Description
InstanceIds List ["3a658ca270df4df39f22e289b338fbf4"]

The ID of the simple application server.

RequestId String 30637AD6-D977-4833-A54C-CC89483E1FEE

The ID of the request.

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

<CreateInstancesResponse>
      <RequestId>30637AD6-D977-4833-A54C-CC89483E1FEE</RequestId>
      <InstanceIds>3a658ca270df4df39f22e289b338****</InstanceIds>
</CreateInstancesResponse>

JSON format

{
  "RequestId": "30637AD6-D977-4833-A54C-CC89483E1FEE",
  "InstanceIds": [
    "3a658ca270df4df39f22e289b338****"
  ]
}

Error codes

HttpCode Error code Error message Description
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.
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. Pay for the order 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 does not exist.
404 InvalidPlanId.NotFound The specified PlanId does not exist. The error message returned because the specified PlanId parameter does not exist.
500 InternalError An error occurred while processing your request. The error message returned because an internal error has occurred. Try again later. If the error persists, submit a ticket.
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.
500 NotEnoughUpgradeStock The upgrade stock is insufficient. The error message returned because the resources used to create the servers are insufficient.

For a list of error codes, visit the API Error Center.