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 configure 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 ApsaraDB for Redis instances. You can call the DescribeRegions operation to query region IDs.
IzNo String Yes cn-hangzhou-b The ID of the primary zone where you want to create ApsaraDB for Redis instances. You can call the DescribeRegions operation to query zone IDs.
Quantity Integer No 1 The number of ApsaraDB for Redis instances that you want to create. Valid values: 1 to 300. Default value: 1.
InstanceType String No Redis The engine type of the ApsaraDB for Redis instance. Valid values:
  • Redis: an ApsaraDB for Redis instance. This is the default value.
  • Memcache: an ApsaraDB for Memcache instance.
InstanceClass String No redis.master.small.default For more information about instance types, see Overview.
Note You must specify this parameter or the Capacity parameter.
Capacity Long No 16384 The storage capacity of the ApsaraDB for Redis 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 ApsaraDB for Redis instance. Valid values: 2.8, 4.0, and 5.0. Default value: 5.0.
ChargeType String No PrePaid The billing method. Valid values:
  • PrePaid: subscription.
  • PostPaid: pay-as-you-go.This is the default value.
Period Long No 12 The subscription duration. Valid values: 1 to 9, 12, 24, and 36. 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. Valid values:
  • true: enables auto-renewal.
  • false: disables auto-renewal. This is the default value.
Note This parameter is valid only if you set the ChargeType parameter to PrePaid.
InstanceName String No apitest The name of the instance. The format of the name must meet the following requirements:
  • The name must be 2 to 128 characters in length and must start with a letter.
  • Space characters and the following special characters are not supported: @ / : = " < > { [ ] }.
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 types of characters: uppercase letters, lowercase letters, special characters, and digits.
  • Supported special characters include !@#$%^&*()_+-=
NetworkType String No VPC The network type of the ApsaraDB for Redis instance. Valid values:
  • CLASSIC: a classic network. This is the default value.
  • VPC: a virtual private cloud (VPC).
VpcId String No vpc-bp1nme44gek34slfc**** The ID of the VPC. You can call the DescribeVpcs operation to query 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 vSwitch IDs.
NodeType String No MASTER_SLAVE The node type of the ApsaraDB for Redis instance. Valid values:
  • STAND_ALONE: standalone
  • MASTER_SLAVE: master-replica
SrcDBInstanceId String No r-bp1zxszhcgatnx**** The ID of the source ApsaraDB for Redis instance. You can call the DescribeInstances operation to query instance IDs.
Note This parameter is required only if you want to create a new instance from the backup 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 ApsaraDB for Redis 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 is 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. Valid values:
  • true: restores the source instance from the recycle bin.
  • false: does not restore the source instance from the recycle bin. This is the default value.
Note If you configure this parameter, you must also configure 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"
}]