Last updated: 2020-09-10 18:01:34

1. API Description

Domain name for API request:

This API is used to create a Redis instance.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example:

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: CreateInstances.
Version Yes String Common parameter. The value used for this API: 2018-04-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
ZoneId Yes Integer AZ ID of instance
TypeId Yes Integer Instance type. Valid values: 2 (Redis 2.8 memory edition in standard architecture), 3 (Redis 3.2 memory edition in standard architecture), 4 (CKV 3.2 memory edition in standard architecture), 6 (Redis 4.0 memory edition in standard architecture), 7 (Redis 4.0 memory edition in cluster architecture), 8 (Redis 5.0 memory edition in standard architecture), 9 (Redis 5.0 memory edition in cluster architecture).
MemSize Yes Integer Instance capacity in MB. The actual value is subject to the specifications returned by the purchasable specification querying API |
GoodsNum Yes Integer Number of instances. The actual quantity purchasable at a time is subject to the specifications returned by the purchasable specification querying API
Period Yes Integer Length of purchase in months, which is required when creating a monthly subscribed instances. Value range: [1,2,3,4,5,6,7,8,9,10,11,12,24,36]. For pay-as-you-go instances, enter 1
BillingMode Yes Integer Billing method. 0: pay as you go
Password No String Instance password. It can contain 8-30 characters and must contain at least two of the following types of characters: lowercase letters, uppercase letters, digits, and special symbols (()`~!@#$%^&*-+=_|{}[]:;<>,.?/). It cannot stat with the symbol (/).
VpcId No String VPC ID such as vpc-sad23jfdfk. If this parameter is not passed in, the basic network will be selected by default. Please use the VPC list querying API to query.
SubnetId No String In a basic network, subnetId is invalid. In a VPC subnet, the value is the subnet ID, such as subnet-fdj24n34j2
ProjectId No Integer Project ID. The value is subject to the projectId returned by user account > user account-related querying APIs > project list
AutoRenew No Integer Auto-renewal flag. 0: default status (manual renewal); 1: auto-renewal enabled; 2: auto-renewal disabled
SecurityGroupIdList.N No Array of String Array of security group IDs
VPort No Integer User-defined port. If this parameter is left empty, 6379 will be used by default. Value range: [1024,65535]
RedisShardNum No Integer Number of shards in an instance. This parameter is required for cluster edition instances. Valid values: 3, 5, 8, 12, 16, 24, 32, 64, 96, 128.
RedisReplicasNum No Integer Number of replicas in an instance. Redis 2.8 standard edition and CKV standard edition support 1 replica. Standard/cluster edition 4.0 and 5.0 support 1-5 replicas.
ReplicasReadonly No Boolean Whether to support read-only replicas. Neither Redis 2.8 standard edition nor CKV standard edition supports read-only replicas. Read/write separation will be automatically enabled for an instance after it enables read-only replicas. Write requests will be directed to the primary node and read requests will be distributed on secondary nodes. To enable read-only replicas, we recommend you create 2 or more replicas.
InstanceName No String Instance name. It contains only letters, digits, underscores, and dashes with a length of up to 60 characters.
NoAuth No Boolean Whether to support the password-free feature. Valid values: true (password-free instance), false (password-enabled instance). Default value: false. Only instances in a VPC support the password-free access.

3. Output Parameters

Parameter Name Type Description
DealId String Transaction ID
InstanceIds Array of String Instance ID (this field is during beta test and is not displayed in some regions)
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Sample request

Input Example
&<Common request parameters>

Output Example

  "Response": {
    "DealId": "123456",
    "RequestId": "d4e2fd95-eac5-41ef-a7a9-7d30024d5507"

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.


TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.SystemError Internal system error, which is irrelevant to the business.
InternalError.InternalError Internal error.
InvalidParameter.OnlyVPCOnSpecZoneId Only VPCs are provided in the Shanghai Finance AZ.
InvalidParameter.PermissionDenied The API has no CAM permissions.
InvalidParameterValue.InvalidInstanceTypeId Incorrect type of instances requested for purchase (TypeId - 1: cluster edition; 2: primary-secondary edition, i.e., the legacy primary-secondary edition).
InvalidParameterValue.InvalidSubnetId In a VPC, vpcid or subnet ID is invalid.
InvalidParameterValue.PasswordEmpty The password is empty.
InvalidParameterValue.PasswordRuleError When the password is set, the old password passed in by MC does not match the previously set password.
InvalidParameterValue.SecurityGroupIdsNotExists Incorrect request parameter or security group ID.
InvalidParameterValue.UnVpcIdNotExists Invalid VPC subnet ID of uniqVpcId.
LimitExceeded.InvalidMemSize The requested capacity is out of the purchasable specification range (memSize should be an integer multiple of 1,024 in MB).
LimitExceeded.InvalidParameterGoodsNumNotInRange The number of instances requested for purchase at a time is out of the purchasable quantity range.
LimitExceeded.PeriodExceedMaxLimit The requested length of purchase is more than 3 years and exceeds the maximum value.
LimitExceeded.PeriodLessThanMinLimit The length of purchase is invalid. It must be at least one month.
ResourceNotFound.AccountDoesNotExists The uin value is blank.
ResourceNotFound.InstanceNotExists No Redis instance is found by the serialId.
ResourceUnavailable.InstanceDeleted The instance has already been repossessed.
ResourceUnavailable.NoEnoughVipInVPC Insufficient IP resources in the VPC.
ResourceUnavailable.NoRedisService The requested region currently does not provide the Redis service.
ResourceUnavailable.NoTypeIdRedisService The requested region currently does not provide the requested type of Redis service.
UnauthorizedOperation.NoCAMAuthed No CAM permissions.
UnauthorizedOperation.UserNotInWhiteList The user is not in the allowlist.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback