Creates an instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateDrdsInstance

Specifies the operation that you want to perform. Set the value to CreateDrdsInstance.

Description String Yes test

Specifies the description of the instance. The description must meet the following requirements:

  • The description cannot contain the prefix http:// or https://.
  • The description must start with a letter or a Chinese character, and can contain uppercase and lowercase letters, Chinese characters, digits, underscores (_), and hyphens (-).
  • The description must be 2 to 256 characters in length.
RegionId String Yes cn-hangzhou

Specifies the region ID of the instance.

ZoneId String Yes cn-hangzhou-e

Specifies the zone ID of the instance.

Type String Yes PRIVATE

Specifies the type of the instance. Set the value to PRIVATE. The value PRIVATE specifies that the instance is a dedicated instance.

Note You can also set the value to 1 to specify that the instance is a dedicated instance.
Quantity Integer Yes 1

Specifies the number of instances to be created. You can set the value only to 1. The value specifies that you can create one instance each time.

InstanceSeries String Yes drds.sn2.4c16g

Specifies the instance type of the instance. Valid values:

  • drds.sn2.4c16g: The instance is of the Starter Edition.
  • drds.sn2.8c32g: The instance is of the Standard Edition
  • drds.sn2.16c64g: The instance is of the Enterprise Edition.
Specification String Yes drds.sn2.4c16g.8C32g

Specifies the specification code of the instance. The value consists of the instance type and the specified instance specification. For example, you can set the value to drds.sn2.4c16g.8c32g.

ClientToken String Yes c1dd299c-10c6-11ea-bbbb-************

Specifies the client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

PayType String Yes drdsPost

Specifies the billing method of the instance. Valid values:

  • drdsPre: The instance uses the subscription billing method.
  • drdsPost: The instance uses the pay-as-you-go billing method.
  • drdsRo: By default, the pay-as-you-go billing method is used when you create read-only instances.
VpcId String No vpc-**********

Specifies the ID of the VPC.

VswitchId String No vsw-**********

Specifies the ID of the vSwitch.

isHa Boolean No true

Specifies whether the instance is a high-availability instance.

PricingCycle String No month

Specifies the unit of the subscription duration of the subscription instance. Valid values:

  • year: The unit of the subscription duration is year.
  • month: The unit of the subscription duration is month.
Note This parameter is required if you set the PayType parameter to drdsPre.
Duration Integer No 1

Specifies the purchase duration of the subscription instance.

  • If the PricingCycle parameter is set to year, the value range of the Duration parameter is 1 to 3.
  • If the PricingCycle parameter is set to month, the value range of the Duration parameter is 1 to 9.
Note This parameter only takes effect when the PayType parameter is set to drdsPre.
IsAutoRenew Boolean No true

Specifies whether to enable automatic renewal. Valid values:

  • true: If the PricingCycle parameter is set to month, the subscription is automatically renewed for one month. If the PricingCycle parameter is set to year, the subscription is automatically renewed for one year.
  • false: The auto-renewal feature is disabled for the instance.
Note This parameter only takes effect when the PayType parameter is set to drdsPre.
MasterInstId String No drds***********

Specifies the ID of the primary instance. This parameter is only required when you create a read-only instance.

MySQLVersion Integer No 5

Specifies the MySQL version that is supported by the instance. Valid values:

  • 5: The instance is fully compatible with MySQL 5.x. This value is the default value.
  • 8: The instance is fully compatible with MySQL 8.0.
Note This parameter only takes effect when you create a primary instance. By default, the MySQL version of the read-only instance is the same as that of the primary instance.
ResourceGroupId String No rg-************

Specifies the ID of the resource group.

Response parameters

Parameter Type Example Description
Success Boolean true

Indicates whether the request is successful.

RequestId String D99D4644-A70D-49A3-B8B4-767ACC50SE2R

Indicates the ID of the request.

Data Object

Indicates the details of the result.

OrderId Long 111111111111111

Indicates the ID of the order.

DrdsInstanceIdList Array of String drds************

Indicates the ID of the instance.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateDrdsInstance
&Description=test
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-e
&Type=PRIVATE
&Quantity=1
&InstanceSeries=drds.sn2.4c16g
&Specification=drds.sn2.4c16g.8C32g
&ClientToken=c1dd299c-10c6-11ea-bbbb-************
&PayType=drdsPost
&VpcId=vpc-**********
&VswitchId=vsw-**********
&isHa=true
&PricingCycle=month
&Duration=1
&IsAutoRenew=true
&MasterInstId=drds***********
&MySQLVersion=5
&ResourceGroupId=rg-************
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateDrdsInstanceResponse>
    <Success>true</Success>
    <RequestId>D99D4644-A70D-49A3-B8B4-767ACC50SE2R</RequestId>
    <Data>
        <OrderId>111111111111111</OrderId>
        <DrdsInstanceIdList>drds************</DrdsInstanceIdList>
    </Data>
</CreateDrdsInstanceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Success" : true,
  "RequestId" : "D99D4644-A70D-49A3-B8B4-767ACC50SE2R",
  "Data" : {
    "OrderId" : 111111111111111,
    "DrdsInstanceIdList" : [ "drds************" ]
  }
}

Error codes

HttpCode Error code Error message Description
400 ActionUnauthorized The specified action is not available for you The error message returned because you are not granted permissions to perform this operation. Grant the required permissions to the Resource Access Management (RAM) user that you want to use to perform this operation.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred.

For a list of error codes, visit the API Error Center.