Creates an instance.
Debugging
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:
|
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:
|
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:
|
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:
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.
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:
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:
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.