Creates multiple ApsaraDB for Tair (Redis OSS-compatible) database Classic Edition instances.
Operation description
Make sure that you fully understand the billing methods and pricing of the ApsaraDB for Tair (Redis OSS-compatible) database before you call this API operation.
This API operation only supports creating Classic Edition instances. Use the following operations to create a single instance:
CreateInstance: creates an open-source Redis instance or a Tair memory-optimized Classic Edition instance.
CreateTairInstance: creates a Tair cloud-native instance (including memory-optimized, persistent memory-optimized, and disk-optimized instances).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kvstore:CreateInstances |
create |
*DBInstance
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Instances |
string |
Yes |
The configuration information of the new instances. The value must be in JSON format. For more information, see the supplementary description of the Instances parameter. |
[{ "RegionId": "cn-hangzhou", "izNo": "cn-hangzhou-b", "quantity": 1, "instanceType": "Redis", "instanceClass": "redis.logic.sharding.1g.2db.0rodb.4proxy.default", "EngineVersion": "5.0", "ChargeType":"PrePaid", "Period":"1", "networkType": "VPC" , "vpcId": "vpc-2zex6u1nu32k3ux35oxxx", "vSwitchId": "vsw-2zesk464e647104kw3xxx" }] |
| Token |
string |
No |
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 and can be up to 64 ASCII characters in length. |
ETnLKlblzczshOTUbOCz**** |
| AutoPay |
boolean |
No |
Specifies whether to enable automatic payment. Valid values:
Note
This parameter is available only when the ChargeType parameter in the Instances array is set to PrePaid. |
true |
| BusinessInfo |
string |
No |
The extended business information. |
000000000 |
| CouponNo |
string |
No |
The coupon code. Default value: |
youhuiquan_promotion_option_id_for_blank |
| EngineVersion |
string |
No |
The Redis-compatible engine version of the instance. Valid values: 4.0 and 5.0. Note
Default value: 5.0. Valid values:
|
5.0 |
| RebuildInstance |
boolean |
No |
Specifies whether to rebuild and restore the source instance from the recycle bin. Valid values:
Note
This parameter is available only when the SrcDBInstanceId parameter is specified in the Instances array. |
false |
| AutoRenew |
string |
No |
Specifies whether to enable auto-renewal. Valid values:
Note
This parameter is available only when the ChargeType parameter in the Instances array is set to PrePaid. |
false |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-resourcegroupid1 |
Supplementary description of the Instances parameter
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| RegionId | String | Yes | cn-hangzhou | The region ID. You can call the DescribeRegions operation to query the most recent region list. Use this parameter to specify the region where you want to create the instance. |
| IzNo | String | Yes | cn-hangzhou-b | The primary zone ID. You can call the DescribeRegions operation to query the most recent zone list. Use this parameter to specify the zone where you want to create the instance. |
| Quantity | Integer | No | 1 | The number of instances to create. Valid values: 1 to 300. Default value: 1. |
| InstanceType | String | No | Redis | The instance type. Valid values:
|
| InstanceClass | String | No | redis.master.small.default | The instance type. For example, redis.master.small.default indicates a 1 GB Community Edition (Classic Edition) standard master-replica instance. For more information, see Instance types. Note You must specify this parameter or the Capacity parameter. |
| Capacity | Long | No | 16384 | The storage capacity of the instance. Unit: MB. For more information, see Instance types. Note You must specify this parameter or the InstanceClass parameter. |
| EngineVersion | String | No | 5.0 | The Redis-compatible engine version of the instance. Valid values:
|
| ChargeType | String | No | PrePaid | The billing method. Valid values:
|
| Period | Long | No | 12 | The upfront period. Unit: months. Valid values: 1 to 9, 12, 24, 36, and 60. Note This parameter is active and required only when the ChargeType parameter is set to PrePaid. |
| AutoRenew | String | No | true | Specifies whether to enable auto-renewal. Valid values:
|
| InstanceName | String | No | apitest | The name of the instance. The name must meet the following requirements:
|
| Password | String | No | Pass!123456 | The password of the instance. The password must meet the following requirements:
|
| NetworkType | String | No | VPC | The network type. Valid value: VPC (Virtual Private Cloud). Currently, only VPC instances can be created. |
| VpcId | String | No | vpc-bp1nme44gek34slfc**** | The ID of the VPC. You can call the DescribeVpcs operation to query the VPC ID. |
| VSwitchId | String | No | vsw-bp1e7clcw529l773d**** | The ID of the vSwitch in the VPC. You can call the DescribeVpcs operation to query the vSwitch ID. |
| NodeType | String | No | MASTER_SLAVE | The node type. Valid values:
|
| SrcDBInstanceId | String | No | r-bp1zxszhcgatnx**** | The ID of the source instance. You can call the DescribeInstances operation to query the instance ID. Note Specify this parameter only when you want to create an instance based on the backup data of the source instance. |
| BackupId | String | No | 111111111 | The ID of the backup set. You can call the DescribeBackups operation to query the backup set ID. Note If you want to create an instance based on the backup data of a specific instance, you must specify the SrcDBInstanceId parameter to identify the source instance and specify this parameter to identify the backup set. The system creates the instance based on the data in the backup set. |
| RebuildInstance | String | No | false | Specifies whether to rebuild and recover the source instance from the revoke bin. Valid values:
|
Sample request for the Instances parameter
[{
"RegionId": "cn-hangzhou",
"izNo": "cn-hangzhou-b",
"quantity": 1,
"instanceType": "Redis",
"instanceClass": "redis.logic.sharding.1g.2db.0rodb.4proxy.default",
"EngineVersion": "5.0",
"ChargeType": "PrePaid",
"Period":"1",
"networkType": "VPC" ,
"vpcId": "vpc-2zex6u1nu32k3ux35xxxx",
"vSwitchId": "vsw-2zesk464e647104kwxxxx"
}]
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| OrderId |
string |
The ID of the order. |
20905403119**** |
| RequestId |
string |
The ID of the request. |
561AFBF1-BE20-44DB-9BD1-6988B53E**** |
| InstanceIds |
object |
||
| InstanceId |
array |
The list of instance IDs of the created instances. |
|
|
string |
The instance ID. |
r-bp16e70a4338**** |
Examples
Success response
JSON format
{
"OrderId": "20905403119****",
"RequestId": "561AFBF1-BE20-44DB-9BD1-6988B53E****",
"InstanceIds": {
"InstanceId": [
"r-bp16e70a4338****"
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Zone.Closed | Specified zone is closed. | The specified Availability Zone is closed |
| 400 | MissingParameter | Period is mandatory for this action. | |
| 400 | InvalidToken.Malformed | The Specified parameter "Token" is not valid. | |
| 400 | InvalidInstanceName.Malformed | The Specified parameter "InstanceName" is not valid. | |
| 400 | InvalidPassword.Malformed | The Specified parameter "Password" is not valid. | The specified Password parameters do not meet the requirements |
| 400 | InvalidInstances.Malformed | The Specified parameter "Instances" is not valid. | The Instances parameter passed in is invalid. |
| 400 | InsufficientBalance | Your account does not have enough balance. | |
| 400 | QuotaExceed.AfterpayInstance | Living afterpay instances quota exceeded. | |
| 400 | InvalidCapacity.NotFound | The Capacity provided does not exist in our records. | |
| 400 | ResourceNotAvailable | Resource you requested is not available for finance user. | |
| 400 | PaymentMethodNotFound | No payment method has been registered on the account. | |
| 400 | IdempotentParameterMismatch | Request uses a client token in a previous request but is not identical to that request. | Idempotent check. |
| 400 | QuotaNotEnough | Quota not enough in this zone. | |
| 400 | QuotaExceed | Living afterpay instances quota exceed. | |
| 400 | VpcServiceError | Invoke vpc service failed. | |
| 400 | IzNotSupportVpcError | Specify iz not support vpc. | |
| 400 | InvalidVpcIdRegion.NotSupported | The Specified vpcId or vSwitchId not supported. | |
| 400 | ResourceGroupNotExist | The Specified ResourceGroupId does not exist. | |
| 403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | |
| 404 | InvalidCapacity.NotFound | The Capacity provided does not exist in our records. | The specified storage specification does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.