Creates multiple ApsaraDB for Redis instances at a time.
Operation description
Before you call this operation, make sure that you understand the billing methods and pricing of ApsaraDB for Redis.
-
CreateInstance : creates an ApsaraDB for Redis instance or a Tair DRAM-based classic instance.
-
CreateTairInstance : creates a Tair cloud-native instance. The instance can be a DRAM-based, persistent memory-optimized, or ESSD/SSD-based instance.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
kvstore:CreateInstances | create | *DBInstance acs:kvstore:{#regionId}:{#accountId}:instance/* |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Instances | string | Yes | The JSON-formatted configurations of the instance. For more information, see the "Description of the Instances parameter" section of this topic. | [{ "RegionId": "cn-hangzhou", "izNo": "cn-hangzhou-b", "quantity": 2, "instanceType": "Redis", "instanceClass": "redis.master.small.default", "EngineVersion": "5.0", "ChargeType": "PostPaid"}] |
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 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. | ETnLKlblzczshOTUbOCz**** |
AutoPay | boolean | No | Specifies whether to enable automatic payment. Valid values:
Note
This parameter is valid only if the value of the ChargeType field in the Instances parameter is set to PrePaid.
| true |
BusinessInfo | string | No | The additional business information about the instance. | 000000000 |
CouponNo | string | No | The coupon code. Default value: | youhuiquan_promotion_option_id_for_blank |
EngineVersion | string | No | The database engine version of the instance. Valid values: 4.0 and 5.0. Note
The default value is 5.0.
Valid values:
| 5.0 |
RebuildInstance | boolean | No | Specifies whether to restore the source instance from the recycle bin. Valid values:
Note
This parameter is valid only if the SrcDBInstanceId field in the Instances parameter is specified.
| false |
AutoRenew | string | No | Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:
Note
This parameter is available only if ChargeType in the Instances parameter is set to PrePaid.
| false |
ResourceGroupId | string | No | The ID of the resource group to which to assign the instance. | rg-resourcegroupid1 |
Additional description of the Instances parameter
Parameter | 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. |
IzNo | String | Yes | cn-hangzhou-b | The primary zone ID. You can call the DescribeRegions operation to query the most recent zone list. |
Quantity | Integer | No | 1 | The number of instances that you want to create. Valid values: 1 to 300. Default value: 1. |
InstanceType | String | No | Redis | The database engine of the instance. Valid values:
|
InstanceClass | String | No | redis.master.small.default | The instance type. For example, redis.master.small.default indicates a Community Edition standard master-replica instance that has 1 GB of memory. For more information, see Overview .Note You must specify this parameter or Capacity. |
Capacity | Long | No | 16384 | The storage capacity of the instance. Unit: MB. For more information, see Overview .Note You must specify this parameter or InstanceClass. |
EngineVersion | String | No | 5.0 | The major version of the instance. Valid values:
|
ChargeType | String | No | PrePaid | The billing method of the instance. Valid values:
|
Period | Long | No | 12 | The subscription duration. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24,36, and 60. Unit: months.Note This parameter is valid and required only if you set ChargeType to PrePaid. |
AutoRenew | String | No | true | Specifies whether to enable auto-renewal for the instance. Valid values:
|
InstanceName | String | No | apitest | The name of the instance.
|
Password | String | No | Pass!123456 | The password that is used to connect to the instance.
|
NetworkType | String | No | VPC | The network type of the instance. Set the value to VPC, which is the default value. |
VpcId | String | No | vpc-bp1nme44gek34slfc**** | The ID of the virtual private cloud (VPC). You can call the DescribeVpcs operation to query VPC IDs. |
VSwitchId | String | No | vsw-bp1e7clcw529l773d**** | The ID of the vSwitch that belongs to the VPC. You can call the DescribeVpcs operation to query vSwitch IDs. |
NodeType | String | No | MASTER_SLAVE | The type of the node. Valid values:
|
SrcDBInstanceId | String | No | r-bp1zxszhcgatnx**** | The ID of the source instance. You can call the DescribeInstances operation to query instance IDs.Note This parameter is required only if you want to create an instance from the backup set of a specified instance. |
BackupId | String | No | 111111111 | The ID of the backup set. You can call the DescribeBackups operation to query the backup set IDs.Note If you want to create an instance from the backup set of a specified instance, you must specify the source instance in SrcDBInstanceId. You must also specify the ID of the backup set that was created based on the source instance. Then, the system creates an instance based on the specified back set. |
RebuildInstance | String | No | false | Specifies whether to restore the source instance from the recycle bin. Valid values:
|
Sample request with the Instances parameter configured
[{
"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"
}]
Response parameters
Examples
Sample success responses
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. | An error has occurred while authenticating the token. |
400 | InvalidInstanceName.Malformed | The Specified parameter "InstanceName" is not valid. | The instance name is invalid. |
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. | Your account balance is insufficient. Add funds to your account and try again. |
400 | QuotaExceed.AfterpayInstance | Living afterpay instances quota exceeded. | The maximum number of instances has been reached. |
400 | InvalidCapacity.NotFound | The Capacity provided does not exist in our records. | The specified storage specification does not exist |
400 | ResourceNotAvailable | Resource you requested is not available for finance user. | The requested resource is unavailable to users of Alibaba Finance Cloud. |
400 | PaymentMethodNotFound | No payment method has been registered on the account. | No payment methods are specified for your account. |
400 | IdempotentParameterMismatch | Request uses a client token in a previous request but is not identical to that request. | The current request uses a token that was already used in a different request. |
400 | QuotaNotEnough | Quota not enough in this zone. | The number of instances specified for this region is insufficient. |
400 | QuotaExceed | Living afterpay instances quota exceed. | The maximum number of instances has been reached. |
400 | VpcServiceError | Invoke vpc service failed. | - |
400 | IzNotSupportVpcError | Specify iz not support vpc. | The specified iz does not support VPCs. |
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. | Your account has not completed real-name verification. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-02-22 | The Error code has changed | View Change Details |