Creates one or more ApsaraDB for Redis instances.

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 in the ApsaraDB for Redis console, see Create an 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.

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 configurations of the instance that you want to create in the JSON format. For more information, see Description of the Instances parameter.

RegionId String No cn-hangzhou

The ID of the region where you want to create the ApsaraDB for Redis instance. You can call the DescribeRegions operation to query region IDs.

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 ensure 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. Valid values:

  • true: enables automatic payment. This is the default value.
  • false: enables manual payment. In the top navigation bar, choose Expenses > Renewal Management. In the left-side navigation pane, click Orders. Find and pay for the order.
Note If the value of the ChargeType field in the Instances parameter is set to PrePaid, this parameter is valid.
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 major version of the ApsaraDB for Redis instance. Valid values: 2.8, 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. Valid values:

  • true: recreates the source instance from the recycle bin.
  • false: does not recreate the source instance from the recycle bin. This is the default value.
Note If the SrcDBInstanceId field in the Instances parameter is set, this parameter is valid.
AutoRenew String No false

Specifies whether to enable auto-renewal. Valid values:

  • true: enables auto-renewal.
  • false: disables auto-renewal. This is the default value.
Note If the value of the ChargeType field in the Instances parameter is set to PrePaid, this parameter is valid.

Response parameters

Parameter Type Example Description
InstanceIds List { "InstanceId": [ "r-bp16e70a4338****", "r-bp178c19293a****" ] }

The IDs of instances that are created.

OrderId String 20905403119****

The ID of the order.

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

The ID of the request.

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

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

JSON format

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

Error codes

HttpCode 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 Instances parameter is invalid.
400 InsufficientBalance Your account does not have enough balance. The error message returned because your account does not have a sufficient balance. Top up your account and try again.
403 RealNameAuthenticationError Your account has not passed the real-name authentication yet. The error message returned because your account has not passed the real-name verification.
400 QuotaExceed.AfterpayInstance Living afterpay instances quota exceeded. The error message returned because the number of instances that you created exceeds the quota.
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 is used in an earlier request and the two requests are not identical.
400 QuotaNotEnough Quota not enough in this zone. The error message returned because the number of instances that you created exceeds the quota for this zone.
400 QuotaExceed Living afterpay instances quota exceed. The error message returned because the number of instances that you created exceeds the quota.
400 IzNotSupportVpcError Specify iz not support vpc. The error message returned because the specified iz does not support VPCs.

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