CreateInstances

Last updated: 2019-12-05 19:09:44

PDF

1. API Description

Domain name for API request: redis.tencentcloudapi.com.

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: redis.ap-shanghai-fsi.tencentcloudapi.com

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 ID of the AZ where the instance resides
TypeId Yes Integer Instance type. 2: Redis 2.8 master-slave edition; 3: Redis 3.2 master-slave edition (CKV master-slave edition); 4: Redis 3.2 cluster edition (CKV cluster edition); 5: Redis 2.8 standalone edition; 6: Redis 4.0 master-slave edition; 7: Redis 4.0 cluster edition
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. Rules: 1. It can contain 8-16 characters; 2. It must contain at least two of the following three types of characters: letters, digits, and special characters !@^*(). (When creating a password-free instance, you can leave this field along and it will be ignored.)
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 blank, 6379 will be used by default
RedisShardNum No Integer Number of instance shards. This parameter can be left blank for Redis 2.8 master-slave edition, CKV master-slave edition, Redis 2.8 standalone edition, and Redis 4.0 master-slave edition
RedisReplicasNum No Integer Number of instance replicas. This parameter can be left blank for Redis 2.8 master-slave edition, CKV master-slave edition, and Redis 2.8 standalone edition
ReplicasReadonly No Boolean Whether to support read-only replicas. This parameter can be left blank for Redis 2.8 master-slave edition, CKV master-slave edition, and Redis 2.8 standalone edition |
InstanceName No String Instance name
NoAuth No Boolean Whether to support the password-free feature. Value range: true (password-free instance); false (password-enabled instance). Default value: false

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 Request Sample

Input Example

https://redis.tencentcloudapi.com/?Action=CreateInstances
&ZoneId=100002
&TypeId=2
&MemSize=1024
&GoodsNum=1
&Period=1
&Password=********
&BillingMode=1
&<Common request parameter>

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.

SDK

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
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: master-slave edition, i.e., the legacy master-slave 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.
LimitExceeded.InvalidMemSize The requested capacity is out of the purchasable specification range (memSize should be an integral 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 requested type of 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 whitelist.