edit-icon download-icon

CreateInstance

Last Updated: Apr 29, 2018

Description

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

Request parameters

Name Type Required Description
Public request parameters - Yes For more information, see Common request 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.
Note: 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.
The value is generated by a client, which must be unique among all requests. The value is case-sensitive and contains a maximum of 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

Name Parameter type Description
Public return parameters - For more information, see Common 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.

Example

Request example

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

Response example

  1. {
  2. "InstanceId":"736538d0a6894665",
  3. "InstanceName":"736538d0a6894665"
  4. }
Thank you! We've received your feedback.