Creates a host in an ApsaraDB for MyBase dedicated cluster.

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 CreateDedicatedHost

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

AutoRenew String Yes true

Specifies whether to enable auto-renewal. Valid values:

  • true: enables auto-renewal
  • false: disables auto-renewal
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. You must make sure that the value is unique among different requests. The value can contain only ASCII characters and can be up to 64 characters in length.

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 for MyBase console.

HostClass String Yes rds.g6.4xlarge

The specification code of the host. For more information about the supported specifications of hosts, see Instance types and specifications of hosts.

PayType String Yes Prepaid

The billing method of the host. Set the value to PrePaid. This specifies that the subscription billing method is used.

VSwitchId String Yes vsw-bp133c8ifzxd3iv6q****

The ID of the vSwitch. You can view the ID of the vSwitch in the Virtual Private Cloud (VPC) console.

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.

RegionId String No cn-hangzhou

The region ID of the dedicated cluster in which the host is created. For more information, see Region IDs.

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.

Period String No Month

The subscription type of the host. Valid values:

  • Year: a yearly subscription
  • Month: a monthly subscription
UsedTime String No 1

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.

Response parameters

Parameter Type Example Description
DedicateHostList Array of DedicateHostList

The hosts in the dedicated cluster.

DedicateHostList
DedicatedHostId String ch-bp108dki3wdl6****

The ID of the host in the dedicated cluster.

OrderId Long 102565235

The ID of the order.

RequestId String C860658E-68A6-46C1-AF6E-3AE7C4D32375

The ID of the request.

Examples

Sample requests

http(s)://cddc.aliyuncs.com/?Action=CreateDedicatedHost
&AutoRenew=true
&ClientToken=ETnLKlblzczshOTUbOCzSBZH8****
&DedicatedHostGroupId= dhg-6w7q18iwt5jo****
&HostClass=rds.g6.4xlarge
&PayType=Prepaid
&VSwitchId= vsw-bp133c8ifzxd3iv6q****
&ZoneId=cn-hangzhou-i
&<Common request parameters>

Sample success responses

XML format

<CreateDedicatedHostResponse>
  <RequestId>C860658E-68A6-46C1-AF6E-3AE7C4D32375</RequestId>
  <DedicateHostList>
        <DedicateHostList>
              <DedicatedHostId> ch-bp108dki3wdl6****</DedicatedHostId>
        </DedicateHostList>
  </DedicateHostList>
  <OrderId>102565235</OrderId>
</CreateDedicatedHostResponse>

JSON format

{"RequestId":"C860658E-68A6-46C1-AF6E-3AE7C4D32375",
 "DedicateHostList":{
    "DedicateHostList":[{
        "DedicatedHostId":" ch-bp108dki3wdl6****"}]
  },
 "OrderId":"102565235"
}

Error codes

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