Creates a Redis Community Edition classic instance, a Redis Community Edition cloud-native architecture instance, or a Tair memory-optimized classic instance. To create a cloud-native architecture Tair instance, call the CreateTairInstance operation.
Operation description
Before you invoke this operation, make sure that you fully understand the billing methods and pricing of ApsaraDB for Tair (Redis® OSS-Compatible).
This operation creates Redis Community Edition instances and Tair memory-optimized classic instances. To create a Tair cloud-native instance, invoke the CreateTairInstance operation.
For the corresponding console operations and instance selection recommendations, see Create a Redis instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kvstore:CreateInstance |
create |
*DBInstance
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query available regions. Use this parameter to specify the region in which to create the instance. |
cn-hangzhou |
| Token |
string |
No |
The client token that is used to ensure the idempotence of the request. The token value is generated by the client and must be unique among different requests. The token is case-sensitive and cannot exceed 64 ASCII characters in length. |
ETnLKlblzczshOTUbOCz**** |
| InstanceName |
string |
No |
The name of the instance. The name must be 2 to 80 characters in length and must start with a letter or a Chinese character. The name cannot contain |
apitest |
| Password |
string |
No |
The password of the instance. The password must be 8 to 32 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, special characters, and digits. The following special characters are supported: |
Pass!123456 |
| Capacity |
integer |
No |
The storage capacity of the instance. Unit: MB. Note
You must specify at least one of the Capacity and InstanceClass parameters when you call this operation. |
16384 |
| InstanceClass |
string |
No |
The instance type. For example, redis.master.small.default specifies a Community Edition (classic) standard architecture dual-replica 1 GB instance. For more information, see Instance type overview. Note
You must specify at least one of the Capacity and InstanceClass parameters when you call this operation. |
redis.master.small.default |
| ZoneId |
string |
No |
The primary zone ID. You can invoke DescribeRegions to query active zones. Use this parameter to specify the zone in which to create the instance. Note
You can also specify the SecondaryZoneId parameter to set the secondary zone. The primary and secondary nodes are deployed in the specified primary and secondary zones respectively, which implements a dual-center primary/secondary architecture in the same city. For example, set ZoneId to "cn-hangzhou-h" and SecondaryZoneId to "cn-hangzhou-g". |
cn-hangzhou-h |
| SecondaryZoneId |
string |
No |
The secondary zone ID. You can call DescribeZones to query available zones. Note
The value of this parameter must be different from the value of ZoneId. You cannot set this parameter to the ID of a multi-zone. |
cn-hangzhou-g |
| ChargeType |
string |
No |
The billing method. Valid values:
|
PostPaid |
| NodeType |
string |
No |
The node type. Valid values:
Note
For cloud-native instances, set this parameter to MASTER_SLAVE or STAND_ALONE. For classic instances, set this parameter to double or single. |
STAND_ALONE |
| NetworkType |
string |
No |
The network type. Valid values:
|
VPC |
| VpcId |
string |
No |
The ID of the VPC. |
vpc-bp1nme44gek34slfc**** |
| VSwitchId |
string |
No |
The ID of the vSwitch. |
vsw-bp1e7clcw529l773d**** |
| Period |
string |
No |
The subscription period. Unit: months. Valid values: 1 to 9, 12, 24, 36, and 60. Note
This parameter is available and required only when ChargeType is set to PrePaid. |
12 |
| BusinessInfo |
string |
No |
The activity ID and business information. |
000000000 |
| CouponNo |
string |
No |
The coupon code. Default value: |
youhuiquan_promotion_option_id_for_blank |
| SrcDBInstanceId |
string |
No |
To create an instance from a backup set of an existing instance, specify the instance ID of the source instance in this parameter. Note
Then use the BackupId, ClusterBackupId (recommended for cloud-native cluster instances), or RestoreTime parameter to specify the backup set or point in time. This parameter must be used together with one of the preceding three parameters. The value is a string, not an array. |
r-bp1zxszhcgatnx**** |
| BackupId |
string |
No |
The ID of the backup set of the source instance. The system uses the data stored in the backup set to create the instance. You can invoke DescribeBackups to query the BackupId. If the source instance is a cluster instance, specify the backup set IDs of all shards of the source instance, separated by commas (,). Example: "10**,11**,15**". Note
If your instance is a cloud-native architecture cluster instance, use DescribeClusterBackupList to query the cluster backup set ID, such as "cb-xx", and specify it in the ClusterBackupId request parameter to clone the cluster instance. This eliminates the need to specify individual shard backup set IDs. |
111111111 |
| InstanceType |
string |
No |
The instance type. Valid values:
|
Redis |
| EngineVersion |
string |
No |
Redis classic engine version. Valid values:
Redis cloud-native engine version. Valid values:
Note
Default value: 5.0. Valid values:
|
5.0 |
| PrivateIpAddress |
string |
No |
The internal network IP address of the new instance. Note
The internal network IP address must be within the vSwitch CIDR block to which the instance belongs. |
172.16.0.*** |
| AutoUseCoupon |
string |
No |
Specifies whether to use a coupon. Valid values:
|
false |
| AutoRenew |
string |
No |
Specifies whether to enable auto-renewal. Valid values:
|
true |
| AutoRenewPeriod |
string |
No |
The auto-renewal epoch. Unit: months. Valid values: 1, 2, 3, 6, and 12. Note
This parameter is required when AutoRenew is set to true. |
3 |
| ResourceGroupId |
string |
No |
The resource group ID. |
rg-resourcegroupid1 |
| RestoreTime |
string |
No |
If flashback is enabled for the source instance, you can specify a point in time within the backup retention period. The system uses the backup data of the source instance at the specified point in time to create the instance. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. |
2019-06-19T16:00:00Z |
| DedicatedHostGroupId |
string |
No |
The ID of the dedicated cluster. This parameter is required when you create an instance in a dedicated cluster. |
dhg-uv4fnk6r7zff**** |
| ShardCount |
integer |
No |
The number of shards. This parameter is applicable only to cloud-native instances. You can use this parameter to customize the number of shards.
|
4 |
| ReplicaCount |
integer |
No |
The number of replica nodes in the primary zone. This parameter is applicable only to cloud-native cluster multi-replica instances. You can use this parameter to customize the number of replica nodes. Valid values: 1 to 4. Note
If you create a multi-zone instance, you can use this parameter together with the SlaveReplicaCount parameter to customize the number of replica nodes in the primary and secondary zones. The sum of this parameter and the SlaveReplicaCount parameter cannot exceed 4. |
2 |
| SlaveReplicaCount |
integer |
No |
The number of replica nodes in the secondary zone. |
2 |
| ReadOnlyCount |
integer |
No |
The number of read-only nodes in the primary zone. This parameter is applicable only to cloud-native read/write splitting instances.
Note
If you create a multi-zone instance, you can use this parameter together with the SlaveReadOnlyCount parameter to customize the number of read-only nodes in the primary and secondary zones.
|
2 |
| SlaveReadOnlyCount |
integer |
No |
The number of read-only nodes in the secondary zone. |
2 |
| GlobalInstanceId |
string |
No |
The instance ID of the distributed instance. This parameter is applicable only to Chinese site (aliyun.com). |
gr-bp14rkqrhac**** |
| GlobalInstance |
boolean |
No |
Specifies whether to use the new instance as the first child instance of a distributed instance. This allows you to create a distributed instance. Valid values:
Note
|
false |
| Port |
string |
No |
The service port of the instance. Valid values: 1 to 65535. Default value: 6379. |
6379 |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run for this instance creation request. Valid values:
|
false |
| GlobalSecurityGroupIds |
string |
No |
The global IP whitelist templates for the instance. Separate multiple templates with commas (,). Duplicates are not allowed. Important This parameter is applicable only to cloud-native instances. Classic instances do not support the whitelist template feature. |
g-zsldxfiwjmti0kcm**** |
| Appendonly |
string |
No |
The Append Only File (AOF) persistence parameter settings for the new instance. Valid values:
Note
This parameter is applicable to classic instances. Cloud-native instances do not support specifying the AOF parameter. Valid values:
|
yes |
| ConnectionStringPrefix |
string |
No |
The prefix of the endpoint. The prefix must consist of lowercase letters and digits, start with a lowercase letter, and be 8 to 40 characters in length. Note
The endpoint is in the format of: |
r-bp1zxszhcgatnx**** |
| ParamGroupId |
string |
No |
The ID of the parameter template. The ID is globally unique. Important This parameter is applicable only to cloud-native instances. |
rpg-test** |
| Tag |
array<object> |
No |
The tags of the instance. |
|
|
object |
No |
The object. |
||
| Key |
string |
No |
The key of the tag. Note
|
testkey |
| Value |
string |
No |
The value of the tag. Note
N specifies the sequence number of the tag. For example, Tag.1.Value specifies the value of the first tag, and Tag.2.Value specifies the value of the second tag. |
testvalue |
| ClusterBackupId |
string |
No |
The cluster backup set ID, which is supported by some new cluster architecture instances. You can call DescribeClusterBackupList to obtain the ID.
|
cb-hyxdof5x9kqb**** |
| RecoverConfigMode |
string |
No |
Specifies whether to restore the account, kernel parameter (config), or whitelist information from the original backup set when you create an instance from a specified backup set. For example, to restore account information, set this parameter to The default value is empty, which indicates that the account, kernel parameter, and whitelist information is not restored from the original backup set. Note
This parameter is applicable only to cloud-native instances, and the original backup set must contain the account, kernel parameter, or whitelist information. You can call DescribeBackups to check whether the RecoverConfigMode parameter of the specified backup set contains the preceding information. |
whitelist,config,account |
| InstanceEndpointType |
string |
No |
The endpoint type used when you create a cloud-native dual-zone deployment read/write splitting instance. If this parameter is not explicitly committed, the default value is AzIndependentEndpoint.
Important This parameter is applicable only to cloud-native dual-zone deployment read/write splitting instances. For other instance types, only zone-independent endpoints are supported. Even if UnifiedEndpoint is specified, it does not take effect. Important The UnifiedEndpoint option is available only to users on the whitelist. If you are not on the whitelist and specify this parameter, the invocation returns an error. To request access, submit a ticket. |
AzIndependentEndpoint |
| MaintainStartTime |
string |
No |
The start time of the maintenance window. Specify the time in the HH:mmZ format in UTC. For example, to set the start time to 01:00 (UTC+8), specify Note
If this parameter is not specified, the default value is 02:00 (UTC+8), which is 18:00Z in UTC. |
03:00Z |
| MaintainEndTime |
string |
No |
The end time of the maintenance window. Specify the time in the HH:mmZ format in UTC. For example, to set the end time to 02:00 (UTC+8), specify Note
The interval between the start time and end time must be at least 1 hour. Note
If this parameter is not specified, the default value is 06:00 (UTC+8), which is 22:00Z in UTC. |
07:00Z |
The following example shows a request to create a Redis 7.0 cluster instance.
{
"RegionId": "ap-southeast-1",
"InstanceName": "apitest",
"Password": "D****23",
"ZoneId": "ap-southeast-1a",
"ChargeType": "PrePaid",
"InstanceClass": "redis.shard.with.proxy.small.ce",
"NetworkType": "VPC",
"Period": "1",
"InstanceType": "Redis",
"EngineVersion": "7.0",
"ShardCount": 4,
"SourceIp": "10.10.10.10"
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| VpcId |
string |
The ID of the VPC. |
vpc-bp1nme44gek34slfc**** |
| QPS |
integer |
The queries per second (QPS). This value is the theoretical maximum for the current instance type. |
100000 |
| Capacity |
integer |
The storage capacity of the instance. Unit: MB. |
16384 |
| ConnectionDomain |
string |
The internal network endpoint of the Redis instance. |
r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com |
| ChargeType |
string |
The billing method. Valid values:
|
PostPaid |
| NetworkType |
string |
The network type. Valid values:
|
VPC |
| InstanceId |
string |
The instance ID, which is globally unique. |
r-bp1zxszhcgatnx**** |
| Port |
integer |
The Redis service port. |
6379 |
| Config |
string |
The detailed configuration of the instance. |
{\"EvictionPolicy\":\"volatile-lru\",\"hash-max-ziplist-entries\":512,\"zset-max-ziplist-entries\":128,\"zset-max-ziplist-value\":64,\"set-max-intset-entries\":512,\"hash-max-ziplist-value\":64} |
| RegionId |
string |
The region ID of the instance. |
cn-hongkong |
| EndTime |
string |
The time when the subscription instance expires. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2019-01-18T16:00:00Z |
| VSwitchId |
string |
The vSwitch ID. |
vsw-bp1e7clcw529l773d**** |
| RequestId |
string |
The request ID. |
5DEA3CC9-F81D-4387-8E97-CEA40F09**** |
| NodeType |
string |
The node type. Valid values:
|
MASTER_SLAVE |
| Connections |
integer |
The maximum number of connections supported by the instance. |
10000 |
| Bandwidth |
integer |
The bandwidth limit of the instance. Unit: MB/s. |
32 |
| InstanceName |
string |
The name of the instance. |
apitest |
| ZoneId |
string |
The zone ID of the instance. |
cn-hangzhou-b |
| InstanceStatus |
string |
The current status of the instance. The return value is fixed as Creating. |
Creating |
| PrivateIpAddr |
string |
The internal IP address of the instance. |
172.16.0.10 |
| UserName |
string |
The account used to connect to the Redis instance. By default, an account named after the instance ID is included. |
r-bp1zxszhcgatnx**** |
| OrderId |
integer |
The order ID. |
2084452111111 |
Examples
Success response
JSON format
{
"VpcId": "vpc-bp1nme44gek34slfc****",
"QPS": 100000,
"Capacity": 16384,
"ConnectionDomain": "r-bp1zxszhcgatnx****.redis.rds.aliyuncs.com",
"ChargeType": "PostPaid",
"NetworkType": "VPC",
"InstanceId": "r-bp1zxszhcgatnx****",
"Port": 6379,
"Config": "{\\\"EvictionPolicy\\\":\\\"volatile-lru\\\",\\\"hash-max-ziplist-entries\\\":512,\\\"zset-max-ziplist-entries\\\":128,\\\"zset-max-ziplist-value\\\":64,\\\"set-max-intset-entries\\\":512,\\\"hash-max-ziplist-value\\\":64}",
"RegionId": "cn-hongkong",
"EndTime": "2019-01-18T16:00:00Z",
"VSwitchId": "vsw-bp1e7clcw529l773d****",
"RequestId": "5DEA3CC9-F81D-4387-8E97-CEA40F09****",
"NodeType": "MASTER_SLAVE",
"Connections": 10000,
"Bandwidth": 32,
"InstanceName": "apitest",
"ZoneId": "cn-hangzhou-b",
"InstanceStatus": "Creating",
"PrivateIpAddr": "172.16.0.10",
"UserName": "r-bp1zxszhcgatnx****",
"OrderId": 2084452111111
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ZoneIdNotFound | Specify iz not support switch network. | Unable to find Availability Zone |
| 400 | InvalidShardInfo.Format | Shard total number is out of range. | |
| 400 | InvalidInstancelevel | Specified Instance level dose not match gdc other member instance level. | |
| 400 | InvalidBackupLogStatus | Backup logs are not enabled for the specified source instance. | |
| 400 | InvalidStatus | Specified instance status is Modifying. | Specified instance status is Modifying. |
| 400 | SecurityRisk.AuthVerification | we have detected a risk with your default payment method. An email and notification has been sent to you. Please re-submit your order before after verificaiton. | |
| 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. | |
| 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 | InvalidvSwitchId | The vpc does not cover the vswitch. | |
| 400 | InvalidIzNo.NotSupported | The Specified vpc zone not supported. | |
| 400 | InvalidAccountPassword.Format | Specified account password is not valid. | |
| 400 | InstanceClass.NotMatch | Current instance class and instance type is not match. | |
| 400 | InvalidVPCId.NotFound | Specified virtual vpc is not found. | The specified VPC is not found. Check whether the VPC ID is correct. |
| 400 | AccountMoneyValidateError | Account money validate error. | |
| 400 | RequestTokenConflict | Specified request token conflict. | |
| 400 | InvalidIPNotInSubnet | Error ip not in subnet. | |
| 400 | InvalidEngineVersion.Malformed | Specified engine version is not valid. | The error message returned because the instance engine version is invalid. |
| 400 | Zone.Closed | The specified zone is closed. | |
| 400 | VSwithNotBelongToNotVpcFault | The vSwitch does not belong to current vpc. | |
| 400 | PayIllegalAgreement | Pay mayi with holding agreement illegal. | |
| 400 | IllegalParamError | validateSaleConditionWithSubArticle failed. | |
| 400 | CASH_BOOK_INSUFFICIENT | No payment method is specified for your account. We recommend that you add a payment method or maitain a minimum prepayment balance of INR 1000. | |
| 400 | InvalidRegion.Format | Specified Region is not valid. | The specified region is invalid. |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | The request performs the pre-check operation and has passed the pre-check, and does not create an instance. |
| 400 | ResourceGroupNotExist | The Specified ResourceGroupId does not exist. | |
| 403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | |
| 403 | AuthorizationFailure | The request processing has failed due to authorization failure. | |
| 403 | TokenServiceError | The specified token is duplicated, please change it. | |
| 404 | InvalidCapacity.NotFound | The Capacity provided does not exist in our records. | The specified storage specification does not exist. |
| 404 | InvalidvSwitchId | The Specified vSwitchId zone not supported. | |
| 404 | InvalidVpcIdOrVswitchId.NotSupported | The Specified vpcId or vSwitchId not supported. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.