Creates one or more hosts in a dedicated cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateDedicatedHost |
The operation that you want to perform. Set the value to CreateDedicatedHost. |
RegionId | String | No | cn-hangzhou |
The region ID of the dedicated cluster in which you want to create the host. For more information, see Region IDs. |
DedicatedHostGroupId | String | Yes | dhg-6w7q18iwt5jo**** |
The ID of the dedicated cluster. You can view the ID of the dedicated cluster on the Dedicated Clusters page in the ApsaraDB MyBase console. |
HostName | String | No | test |
The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter. |
ZoneId | String | Yes | cn-hangzhou-i |
The ID of the zone. You can call the DescribeRegions operation to query the zone ID. For more information, see DescribeRegions. |
VSwitchId | String | Yes | vsw-bp133c8ifzxd3iv6q**** |
The ID of the vSwitch to which to connect the host. You can view the ID of the vSwitch in the Virtual Private Cloud (VPC) console. |
HostClass | String | Yes | rds.g6.4xlarge |
The instance type of the host. For more information about the supported instance types of hosts, see Host specification details. |
PayType | String | Yes | Prepaid |
The billing method of the host. Set the value to PrePaid. |
Period | String | No | Month |
The unit of the subscription duration. Valid values:
|
UsedTime | String | No | 1 |
The subscription duration of the host.
|
ClientToken | String | Yes | ETnLKlblzczshOTUbOCzSBZH8**** |
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 make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
AutoRenew | String | No | false |
Specifies whether to enable the auto-renewal feature. Valid values:
Note If you leave this parameter empty, the default value false is used.
|
ImageCategory | String | No | AliLinux |
The image of the host. Valid values:
|
OsPassword | String | No | Test123456 |
The password of the host. This parameter is available only when the database engine is Tair-PMem. The password must meet the following requirements:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
OrderId | Long | 102565235 |
The ID of the order. |
RequestId | String | C860658E-68A6-46C1-AF6E-3AE7C4D32375 |
The ID of the request. |
DedicateHostList | Array of DedicateHostList |
The hosts in the dedicated cluster. |
|
DedicateHostList | |||
DedicatedHostId | String | ch-bp108dki3wdl6**** |
The ID of the host in the dedicated cluster. |
Examples
Sample requests
http(s)://cddc.aliyuncs.com/?Action=CreateDedicatedHost
&RegionId=cn-hangzhou
&DedicatedHostGroupId= dhg-6w7q18iwt5jo****
&HostName=test
&ZoneId=cn-hangzhou-i
&VSwitchId=vsw-bp133c8ifzxd3iv6q****
&HostClass=rds.g6.4xlarge
&PayType=Prepaid
&Period=Month
&UsedTime=1
&ClientToken=ETnLKlblzczshOTUbOCzSBZH8****
&AutoRenew=false
&ImageCategory=AliLinux
&OsPassword=Test123456
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDedicatedHostResponse>
<OrderId>102565235</OrderId>
<RequestId>C860658E-68A6-46C1-AF6E-3AE7C4D32375</RequestId>
<DedicateHostList>
<DedicatedHostId> ch-bp108dki3wdl6****</DedicatedHostId>
</DedicateHostList>
</CreateDedicatedHostResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"OrderId" : 102565235,
"RequestId" : "C860658E-68A6-46C1-AF6E-3AE7C4D32375",
"DedicateHostList" : [ {
"DedicatedHostId" : " ch-bp108dki3wdl6****"
} ]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidAccountPassword.Format | The account password format is invalid. | The error message returned because the specified OsPassword parameter is invalid. |
400 | InsufficientResourceCapacity | No host is available for the requested instance. | The error message returned because no hosts are created due to insufficient resources in the dedicated cluster. |
For a list of error codes, visit the API Error Center.