Creates one or more ApsaraDB for Redis instances at a time.

Before you call this operation, make sure that you understand the billing methods and pricing of ApsaraDB for Redis.

Note For more information about how to create an instance that meets your requirements in the ApsaraDB for Redis console, see Step 1: Create an ApsaraDB for Redis instance.

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 No cn-hangzhou

The ID of the region in which to create the instance. You can call the DescribeRegions operation to query the most recent region list.

Instances String Yes [{"RegionId": "cn-hangzhou", "izNo": "cn-hangzhou-b", "quantity": 2, "instanceType": "Redis", "instanceClass": "redis.master.small.default", "EngineVersion": "5.0", "ChargeType": "PostPaid"}]

The JSON-formatted configurations of the instance. For more information, see Description of the Instances parameter.

Token String No ETnLKlblzczshOTUbOCz****

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 make sure that it is unique among different requests. The token is case-sensitive. The token can contain only ASCII characters and cannot exceed 64 characters in length.

AutoPay Boolean No true

Specifies whether to enable automatic payment. Default value: true. Valid values:

  • true: enables automatic payment.
  • false: disables automatic payment. If automatic payment is disabled, you must perform the following steps to complete the payment in the ApsaraDB for Redis console: In the top navigation bar, choose Expenses > Renewal Management. In the left-side navigation pane, click Orders. On the Orders page, find the order and complete the payment.
Note This parameter is valid only when the value of the ChargeType field in the Instances parameter is set to PrePaid.
BusinessInfo String No 000000000

The ID of the promotion event or the business information.

CouponNo String No youhuiquan_promotion_option_id_for_blank

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

EngineVersion String No 5.0

The database engine version of the instance. Valid values: 4.0 and 5.0.

Note Default value: 5.0.
RebuildInstance Boolean No false

Specifies whether to restore the source instance from the recycle bin. Default value: false. Valid values:

  • true: restores the source instance from the recycle bin.
  • false: does not restore the source instance from the recycle bin.
Note This parameter is valid only when the SrcDBInstanceId field in the Instances parameter is set.
AutoRenew String No false

Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:

  • true: enables auto-renewal.
  • false: disables auto-renewal.
Note This parameter is valid only when the value of the ChargeType field in the Instances parameter is set to PrePaid.
ResourceGroupId String No rg-resourcegroupid1

The ID of the resource group to which to assign the instance.

Response parameters

Parameter Type Example Description
OrderId String 20905403119****

The ID of the order.

RequestId String 561AFBF1-BE20-44DB-9BD1-6988B53E****

The ID of the request.

InstanceIds Array of String { "InstanceId": [ "r-bp16e70a4338****", "r-bp178c19293a****" ] }

The IDs of instances that were created.

Examples

Sample requests

http(s)://r-kvstore.aliyuncs.com/?Action=CreateInstances
&Instances=[{    "RegionId": "cn-hangzhou",    "izNo": "cn-hangzhou-b",    "quantity": 2,    "instanceType": "Redis",    "instanceClass": "redis.master.small.default",    "EngineVersion": "5.0",    "ChargeType": "PostPaid"}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateInstancesResponse>
    <RequestId>561AFBF1-BE20-44DB-9BD1-6988B53E****</RequestId>
    <OrderId>20905403119****</OrderId>
    <InstanceIds>
        <InstanceId>r-bp16e70a4338****</InstanceId>
        <InstanceId>r-bp178c19293a****</InstanceId>
    </InstanceIds>
</CreateInstancesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "561AFBF1-BE20-44DB-9BD1-6988B53E****",
  "OrderId" : "20905403119****",
  "InstanceIds" : {
    "InstanceId" : [ "r-bp16e70a4338****", "r-bp178c19293a****" ]
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidToken.Malformed The Specified parameter "Token" is not valid. The error message returned because the token is invalid.
400 InvalidInstanceName.Malformed The Specified parameter "InstanceName" is not valid. The error message returned because the instance name is invalid.
400 InvalidPassword.Malformed The Specified parameter "Password" is not valid. The error message returned because the password is invalid.
400 InvalidInstances.Malformed The Specified parameter "Instances" is not valid. The error message returned because the specified value for the Instances parameter is invalid.
400 InsufficientBalance Your account does not have enough balance. The error message returned because your account balance is insufficient. Add funds to your Alibaba Cloud account and try again.
400 QuotaExceed.AfterpayInstance Living afterpay instances quota exceeded. The error message returned because the maximum number of instances has been reached.
400 InvalidCapacity.NotFound The Capacity provided does not exist in our records. The error message returned because the specified capacity is invalid.
400 ResourceNotAvailable Resource you requested is not available for finance user. The error message returned because the requested resource is unavailable to users of Alibaba Finance Cloud.
400 PaymentMethodNotFound No payment method has been registered on the account. The error message returned because no payment method is specified for your account.
400 IdempotentParameterMismatch Request uses a client token in a previous request but is not identical to that request. The error message returned because the current request uses a token that has been used in an earlier request but the two requests are not identical.
400 QuotaNotEnough Quota not enough in this zone. The error message returned because the maximum number of instances in this zone has been reached.
400 QuotaExceed Living afterpay instances quota exceed. The error message returned because the maximum number of instances has been reached.
400 IzNotSupportVpcError Specify iz not support vpc. The error message returned because the specified iz does not support virtual private clouds (VPCs).
403 RealNameAuthenticationError Your account has not passed the real-name authentication yet. The error message returned because your Alibaba Cloud account has not completed real-name verification.

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