This topic describes the details of the Instances parameter and provides a sample request. If you call the CreateInstances operation to create one or more ApsaraDB for Redis instances, you must specify the Instances parameter to specify the instances that you want to create.

Related API operations

CreateInstances

Subparameters of the Instances request parameter

Subparameter Type Required Example Description
RegionId String Yes cn-hangzhou The ID of the region where you want to create the instances. You can call the DescribeRegions operation to query the most recent region list.
IzNo String Yes cn-hangzhou-b The ID of the primary zone where you want to create the instances. 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. Default value: Redis. Valid values:
  • Redis: ApsaraDB for Redis
  • Memcache: ApsaraDB for Memcache
InstanceClass String No redis.master.small.default The instance type of the instance. Example: redis.master.small.default. This value indicates a 1 GB standard master-replica instance of the Community Edition that uses local disks. For more information, see Overview.
Note You must specify this parameter or the Capacity parameter.
Capacity Long No 16384 The storage capacity of the instance. Unit: MB. For more information, see Overview.
Note You must specify this parameter or the InstanceClass parameter.
EngineVersion String No 5.0 The major version of the instance. Valid values: 4.0 and 5.0. Default value: 5.0.
ChargeType String No PrePaid The billing method of the instance. Default value: PostPaid. Valid values:
  • PrePaid: subscription
  • PostPaid: pay-as-you-go
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 the ChargeType parameter to PrePaid.
AutoRenew String No true Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:
  • true: enables auto-renewal.
  • false: disables auto-renewal.
Note This parameter is valid only if you set the ChargeType parameter to PrePaid.
InstanceName String No apitest The name of the instance. The name must meet the following requirements:
  • The name must be 2 to 80 characters in length and start with a letter.
  • Spaces and special characters are not supported. Special characters include @ / : = " < > { [ ] }.
Password String No Pass!123456 The password of the instance. The password must meet the following requirements:
  • The password must be 8 to 32 characters in length.
  • The password must contain at least three of the following character types: uppercase letters, lowercase letters, special characters, and digits.
  • Special characters include ! @ # $ % ^ & * ( ) _ + - =
NetworkType String No VPC The network type of the instance. Default value: CLASSIC. Valid values:
  • CLASSIC: classic network
  • VPC: Virtual Private Cloud (VPC)
VpcId String No vpc-bp1nme44gek34slfc**** The ID of the VPC. You can call the DescribeVpcs operation to query the most recent list of 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 the most recent list of vSwitch IDs.
NodeType String No MASTER_SLAVE The type of the node. Default value: MASTER_SLAVE. Valid values:
  • STAND_ALONE: standalone
  • MASTER_SLAVE: master-replica
SrcDBInstanceId String No r-bp1zxszhcgatnx**** The ID of the source instance. You can call the DescribeInstances operation to query the 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 the SrcDBInstanceId parameter. You must also specify the ID of the backup set that was created based on the source instance. The system creates an instance based on the backup set that is specified by this parameter.
RebuildInstance String No false Specifies whether to restore the source instance from the recycle bin. Default value: false. Valid values:
  • true: restores the source instance from the recycle bin.
  • false: does not restore the source instance from the recycle bin.
Note If you specify this parameter, you must also specify the SrcDBInstanceId parameter.

Sample request in which the Instances parameter is specified

[{
    "RegionId": "cn-hangzhou",
    "izNo": "cn-hangzhou-b",
    "quantity": 2,
    "instanceType": "Redis",
    "instanceClass": "redis.master.small.default",
    "EngineVersion": "5.0",
    "ChargeType": "PostPaid"
}]