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

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

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

This parameter is used to ensure the idempotence of requests and prevent requests from being repeatedly submitted. You can use the client to generate the value of this parameter, and make sure that the parameter value is unique among different requests. The parameter value can contain a maximum of 64 ASCII characters in length and cannot contain non-ASCII characters.

ZoneId String Yes cn-hangzhou-e

The ID of the zone.

PayType String Yes drdsPost

The payment type. Valid values:

  • drdsPre: subscription (also called prepayment).
  • drdsPost: pay-as-you-go (also called post-payment).
  • drdsRo: By default, the pay-as-you-go mode is used when you create read-only instances.
Quantity Integer Yes 1

The number of instances to be created. You can pass only 1. This indicates you can create only one instance at a time.

RegionId String Yes cn-hangzhou

The ID of the region.

Specification String Yes drds.sn1.4c16g.8C32G

The specification code of the instance. The value consists of the instance series and the specified instance specification, for example, drds.sn1.4c8g.8C16G.

Type String Yes PRIVATE

The type of the instance. Only PRIVATE that indicates a dedicated instance is supported.

Note You can also pass 1 to indicate a dedicated instance.
Description String Yes test

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

  • Cannot start with http:// or https://.
  • Must start with a letter or a Chinese character, and can contain uppercase and lowercase letters, Chinese characters, digits, underscores (_), and hyphens (-).
  • Must be 2 to 256 characters in length.
InstanceSeries String No drds.sn1.4c16g

The parameter of the instance series. Valid values:

  • drds.sn2.4c16g: Starter Edition
  • drds.sn2.8c32g: Standard Edition
  • drds.sn2.16c64g: Enterprise Edition
VpcId String No vpc-**********

The ID of the virtual private cloud (VPC).

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

The ID of the VSwitch.

isHa Boolean No true

Specifies whether the instance is a high-availability instance.

PricingCycle String No month

Specifies the type of the subscription instance as yearly subscription or monthly subscription. Valid values:

  • year: yearly
  • month: monthly
Note This parameter is required if the payment type is drdsPre.
Duration Integer No 1

The purchase duration of the yearly or monthly subscription instance.

  • If PricingCycle is set to year, the value ranges from 1 to 3.
  • If PricingCycle is set to month, the value ranges from 1 to 9.
Note This parameter only takes effect when the payment type is drdsPre.
IsAutoRenew Boolean No true

Specifies whether to enable auto-renewal. Valid values:

  • true: Automatically renew monthly subscription instances for one month and yearly subscription instances for one year.
  • false: Disable auto-renewal.
Note This parameter only takes effect when the payment type is drdsPre.
MasterInstId String No drds***********

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

MySQLVersion Integer No 5

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

  • 5: fully compatible with MySQL 5.x. This is the default value.
  • 8: 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-************

The ID of the resource group.

Response parameters

Parameter Type Example Description
Data Struct

The details of the result.

DrdsInstanceIdList List drds************

The ID of the instance.

OrderId Long 111111111111111

The ID of the order.

RequestId String D99D4644-A70D-49A3-B8B4-767ACC50****

The ID of the request.

Success Boolean true

The result of the request.

Examples

Sample requests

http(s)://drds.aliyuncs.com/? Action=CreateDrdsInstance
&ClientToken=c1dd299c-10c6-11ea-bbbb-************
&ZoneId=cn-hangzhou-e
&PayType=drdsPost
&Quantity=1
&RegionId=cn-hangzhou
&Specification=drds.sn1.4c16g.8C32G
&Type=PRIVATE
&Description=test
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

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 authorized to perform this action. Perform Resource Access Management (RAM) authorization first.

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