Description

This API is used to create an instance. For more information about the instance types, see Instance type table.

Request parameters

Table 1. Request parameters
Name Type Required Description
<Public request parameters> - Yes For more information, see Public parameters.
Action String Yes Operation API name. Value: CreateInstance.
InstanceName String No Instance name. The name is a string of 2 to 128 characters and must start with a letter (uppercase or lowercase) or a Chinese character. Special characters, such as the at sign (@), slash (/), colon (:), equal sign (=), quotation mark (“), angle brackets (<>), braces ({}), and square brackets ([]) and space, are not supported.
Password String No Instance password. The password is a string of 8 to 30 characters and must contain uppercase letters, lowercase letters, and numbers.
Notice These special characters are not supported now: exclamation mark (!), angle brackets (<>), parentheses (()), square brackets ([]), braces ({}), comma (,), backquote (`), tilde (~), period (.), hyphen (-), underscore (_), at sign (@), number sign (#), dollar sign ($), percent sign (%), caret (^), ampersand (&), and asterisk (*).
InstanceClass String Yes Type of the applied ApsaraDB for Redis instance. For more information, see Instance type table.
RegionId String Yes Region of the applied ApsaraDB for Redis instance. You can use the DescribeRegions function to view available data centers.
ZoneId String No Lower-level zone of the RegionId. You can use the DescribeRegions function to view available zones.
ChargeType String No Billing method. Supported values: PrePaid and PostPaid. Default value: PostPaid.
Period Long No Payment cycle. Required if ChargeType is set to PrePaid. Unit: month. Supported values: 1-9, 12, 24, and 36.
Token String No This parameter is used to guarantee the idempotence of the request. This parameter value is generated by the client and must be unique. It cannot exceed 64 ASCII characters. For more information, see the section “How to guarantee idempotence”.
NetworkType String No

Network type:

  • Classic
  • VPC

The default value is CLASSIC.

VpcId String No VPC ID
VSwitchId String No VSwitch ID
PrivateIp String No Private IP address
SrcDBInstanceId String No If an instance created based on a backup set generated by another instance is valid, this parameter indicates the ID of the instance that generates the backup set.
BackupId String No If an instance created based on a backup set generated by another instance is valid, this parameter indicates the ID of the generated backup set. Query the value of BackupId by calling DescribeBackups.
InstanceType String No Instance type. Supported values: Redis and Memcache. Default value: Redis.
EngineVersion String No Engine version. Supported values: 2.8 and 4.0. Default value: 2.8.

Response parameters

Table 2. Response parameters
Name Parameter type Description
<Public return parameters> - For more information, see Public return parameters.
InstanceId String Instance ID (globally unique).
InstanceName String Instance name
Note In consideration of the historical compatibility, some returned fields (such as Config and Region) of the function are not mentioned in this document. Alibaba Cloud will delete these fields gradually in the future. In this case, do not rely on the returned fields not involved in this document when calling the APls.

Request example

https://r-kvstore.aliyuncs.com
<Common request parameters>
&Action=CreateInstance
&RegionId=cn-hangzhou
&Password=Qa123456
&InstanceClass= redis.master.small.default

Response example


"InstanceId":"736538d0a6894665",
"InstanceName":"736538d0a6894665"