Creates an ApsaraDB for Redis instance.
Operation Description
Before you call this operation, make sure that you are familiar with the billing methods and pricing of ApsaraDB for Redis.
You can call this operation to create an ApsaraDB for Redis instance that uses local or cloud disks or an ApsaraDB for Redis Enhanced Edition (Tair) DRAM-based instance that uses local disks. To create a Tair instance that uses cloud disks, call the CreateTairInstance operation.
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:CreateInstance | WRITE |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region where you want to create the instance. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
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 the token 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**** |
InstanceName | string | No | The name of the instance. The name must be 2 to 80 characters in length and must start with a letter. It cannot contain spaces or specific special characters. These special characters include | apitest |
Password | string | No | The password that is used to connect to 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, digits, and specific special characters. These special characters include | Pass!123456 |
Capacity | long | 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 of the instance. Example: redis.master.small.default. A redis.master.small.default instance is a 1 GB standard master-replica instance of the Community Edition that uses local disks. For more information, see 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 | Yes | The primary zone ID of the instance. You can call the DescribeRegions operation to query the most recent zone list. | cn-hangzhou-e |
ChargeType | string | No | The billing method of the instance. Default value: PrePaid. Valid values:
| PostPaid |
NetworkType | string | No | The network type of the instance. Default value: VPC. Valid values:
| VPC |
VpcId | string | No | The ID of the virtual private cloud (VPC). | vpc-bp1nme44gek34slfc**** |
VSwitchId | string | No | The ID of the vSwitch to which you want the instance to connect. | vsw-bp1e7clcw529l773d**** |
Period | string | No | 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 available and required only if the ChargeType parameter is set to PrePaid.
| 12 |
BusinessInfo | string | No | The ID of the promotional event or business information. | 000000000 |
CouponNo | string | No | The coupon code. Default value: | youhuiquan_promotion_option_id_for_blank |
SrcDBInstanceId | string | No | The ID of the original instance. If you want to create an instance based on a backup file of a specified instance, you can specify this parameter and use the BackupId or RestoreTime parameter to specify the backup file. | r-bp1zxszhcgatnx**** |
BackupId | string | No | The ID of the backup file of the original instance. If you want to create an instance based on a backup file of a specified instance, you can specify this parameter after you specify the SrcDBInstanceId parameter. Then, the system creates an instance based on the backup file that is specified by this parameter. You can call the DescribeBackups operation to query the IDs of backup files. Note
After you specify the SrcDBInstanceId parameter, you must use the BackupId or RestoreTime parameter to specify the backup file.
| 111111111 |
InstanceType | string | No | The category of the instance. Default value: Redis. Valid values:
| Redis |
EngineVersion | string | No | The database engine version of the instance. Valid values: 4.0, 5.0, 6.0, and 7.0. Note
The default value is 5.0.
Enumeration Value:
| 4.0 |
PrivateIpAddress | string | No | The private IP address of the instance. Note
The private IP address must be available within the CIDR block of the vSwitch to which to connect the instance.
| 172.16.0.*** |
AutoUseCoupon | string | No | Specifies whether to use a coupon. Default value: false. Valid values:
| false |
AutoRenew | string | No | Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:
| true |
AutoRenewPeriod | string | No | The subscription duration that is supported by auto-renewal. Unit: months. Valid values: 1, 2, 3, 6, and 12. Note
This parameter is required only if the AutoRenew parameter is set to true.
| 3 |
ResourceGroupId | string | No | The ID of the resource group. | rg-resourcegroupid1 |
RestoreTime | string | No | The point in time at which the specified original instance is backed up. The point in time must be within the retention period of backup files of the original instance. If you want to create an instance based on a backup file of a specified instance, you can set this parameter to specify a point in time after you set the SrcDBInstanceId parameter. Then, the system creates an instance based on the backup file that was created at the specified point in time for the original instance. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
After you specify the SrcDBInstanceId parameter, you must use the BackupId or RestoreTime parameter to specify the backup file.
| 2019-06-19T16:00:00Z |
DedicatedHostGroupId | string | No | The ID of the dedicated cluster. This parameter is required if you create an instance in a dedicated cluster. | dhg-uv4fnk6r7zff**** |
ShardCount | integer | No | The number of data shards. This parameter is available only if you create a cluster instance that uses cloud disks. You can use this parameter to specify a custom number of data shards. | 4 |
ReadOnlyCount | integer | No | The number of read-only nodes in the instance. This parameter is available only if you create a read/write splitting instance that uses cloud disks. Valid values: 1 to 5. | 5 |
GlobalInstanceId | string | No | The ID of the distributed instance. This parameter is available only on the China site (aliyun.com). | gr-bp14rkqrhac**** |
GlobalInstance | boolean | No | Specifies whether to use the new instance as the first child instance of the distributed instance. Default value: false. Valid values:
Note
| false |
SecondaryZoneId | string | No | The secondary zone ID of the instance. You can call the DescribeZones operation to query the most recent zone list. Note
If you specify this parameter, the master node and replica node of the instance can be deployed in different zones and disaster recovery is implemented across zones. The instance can withstand failures in data centers.
| cn-hangzhou-h |
Port | string | No | The port number that is used to connect to the instance. Valid values: 1024 to 65535. Default value: 6379. | 6379 |
DryRun | boolean | No | Specifies whether to perform a dry run. Default value: false. Valid values:
| false |
GlobalSecurityGroupIds | string | No | The global IP whitelist template for the instance. Multiple IP whitelist templates should be separated by English commas (,) and cannot be duplicated. | g-zsldxfiwjmti0kcm**** |
Tag | object [] | No | The tags of the instance. | |
Key | string | No | The keys of the tags that are added to the instance. Note
| testkey |
Value | string | No | The values of the tags that are added to the instance. Note
N specifies the serial 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 |
Response parameters
Examples
Sample success responses
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. | - |
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. | - |
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. | 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 instance capacity is invalid. |
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 | 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. | - |
400 | DryRunOperation | Request validation has been passed with DryRun flag set. | - |
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. |
403 | AuthorizationFailure | The request processing has failed due to authorization failure. | - |
403 | TokenServiceError | The specified token is duplicated, please change it. | - |
404 | InvalidvSwitchId | The Specified vSwitchId zone not supported. | - |
404 | InvalidVpcIdOrVswitchId.NotSupported | The Specified vpcId or vSwitchId not supported. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-08-24 | The error codes of the API operation change.,The input parameters of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2023-06-26 | The error codes of the API operation change.,The input parameters of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2023-04-23 | The error codes of the API operation change.,The input parameters of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2023-04-03 | The error codes of the API operation change.,The input parameters of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2022-06-15 | The error codes of the API operation change.,The response structure of the API operation changes. | see changesets | ||||||||||||
| ||||||||||||||
2022-03-01 | The error codes of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2022-03-01 | The error codes of the API operation change.,The input parameters of the API operation change. | see changesets | ||||||||||||
| ||||||||||||||
2022-02-22 | The error codes of the API operation change. | see changesets | ||||||||||||
|