Queries the information about dedicated hosts, including the physical performance specifications, machine codes, and service states of the dedicated hosts, and Elastic Compute Service (ECS) instances that are created on the dedicated hosts.
Operation description
You can use one of the following methods to query the information about dedicated hosts:
- Specify
DedicatedHostIds
to query the details of specified dedicated hosts. - Specify
DedicatedHostClusterId
to query the details of the dedicated hosts in a dedicated host cluster.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the dedicated host. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ZoneId | string | No | The zone ID of the dedicated host. You can call the DescribeZones operation to query the most recent zone list. | cn-hangzhou-g |
DedicatedHostIds | string | No | The IDs of dedicated hosts. You can specify up to 100 dedicated host IDs in a single request. Separate the IDs with commas (,). | ["dh-bp165p6xk2tlw61e****", "dh-bp1f9vxmno7emy96****"] |
DedicatedHostName | string | No | The name of the dedicated host. | MyDDHTestName |
Status | string | No | The service state of the dedicated host. Valid values:
Default value: Available. | Available |
DedicatedHostType | string | No | The dedicated host type. You can call the DescribeDedicatedHostTypes operation to query the most recent list of dedicated host types. | ddh.g5 |
LockReason | string | No | The reason why the dedicated host is locked. Valid values:
| financial |
PageNumber | integer | No | The number of entries per page. Default value: 1. | 1 |
PageSize | integer | No | The page number. Valid values: 1 to 100. Default value: 10. | 10 |
ResourceGroupId | string | No | The ID of the resource group to which the dedicated host belongs. When this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response. Note
Resources in the default resource group are displayed in the response regardless of how this parameter is set.
| rg-aek3b6jzp66**** |
Tag | object [] | No | The tags of the dedicated host. | |
Key | string | No | The key of tag N of the dedicated host. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with | TestKey |
Value | string | No | The value of tag N to add to the dedicated host. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with | TestValue |
DedicatedHostClusterId | string | No | The ID of the dedicated host cluster. | dc-bp12wlf6am0vz9v2**** |
SocketDetails | string | No | Whether to display socket capacity information | true |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageSize": 1,
"RequestId": "7654525A-9964-4ABB-8BCD-98F8835E809A",
"PageNumber": 5,
"TotalCount": 3,
"DedicatedHosts": {
"DedicatedHost": [
{
"CreationTime": "2018-01-01T12:00Z",
"SchedulerOptions.ManagedPrivateSpaceId": "mps-iq81z6pkbqjx61php46e",
"Status": "Available",
"Cores": 3,
"AutoPlacement": "on",
"GPUSpec": "gpu",
"AutoReleaseTime": "2017-01-01T12:00Z",
"ChargeType": "Prepaid",
"CpuOverCommitRatio": 1,
"ActionOnMaintenance": "Migrate",
"SaleCycle": "Month",
"PhysicalGpus": 10,
"RegionId": "cn-hangzhou",
"DedicatedHostName": "MyDDHTestName",
"Description": "this-is-my-DDH",
"DedicatedHostClusterId": "dc-bp12wlf6am0vz9v2****",
"ExpiredTime": "2019-01-01T12:00Z",
"DedicatedHostType": "ddh.g5",
"ResourceGroupId": "rg-aek3b6jzp66****",
"ZoneId": "cn-hangzhou-g",
"DedicatedHostId": "dh-bp165p6xk2tlw61e****",
"Sockets": 5,
"MachineId": "12aaa123456ff19dec12345d3026e****",
"Instances": {
"Instance": [
{
"InstanceType": "ecs.g5.large",
"InstanceId": "i-bp14ot0ykf8w13a1****",
"SocketId": "0,1",
"InstanceOwnerId": 0
}
]
},
"OperationLocks": {
"OperationLock": [
{
"LockReason": "financial"
}
]
},
"Tags": {
"Tag": [
{
"TagValue": "TestValue",
"TagKey": "TestKey"
}
]
},
"SupportedInstanceTypeFamilies": {
"SupportedInstanceTypeFamily": [
"ecs.g5"
]
},
"SupportedCustomInstanceTypeFamilies": {
"SupportedCustomInstanceTypeFamily": [
"ecs.ddh6s.custom"
]
},
"SupportedInstanceTypesList": {
"SupportedInstanceTypesList": [
"ecs.g5.large"
]
},
"Capacity": {
"AvailableMemory": 25,
"LocalStorageCategory": "i2",
"TotalMemory": 1024,
"TotalLocalStorage": 512,
"TotalVcpus": 56,
"TotalVgpus": 10,
"AvailableLocalStorage": 65,
"AvailableVcpus": 5,
"AvailableVgpus": 2,
"SocketCapacities": {
"SocketCapacity": [
{
"SocketId": 1,
"AvailableMemory": 65,
"TotalMemory": 128,
"AvailableVcpu": 64,
"TotalVcpu": 128
}
]
}
},
"NetworkAttributes": {
"UdpTimeout": 60,
"SlbUdpTimeout": 60
},
"HostDetailInfo": {
"SerialNumber": "null"
},
"DedicatedHostOwnerId": 0
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidStatus.ValueNotSupported | The pecified dedicated host status is not supported. | The host is in a state that does not support the current operation. |
400 | MissingParamter.RegionId | The regionId should not be null. | The RegionId parameter is required. |
400 | InvalidParameter.DedicatedHostIds | The specified parameter dedicatedHostIds is not valid. | The specified DedicatedHostIds parameter is invalid. |
400 | InvalidRegion.NotFound | The specified parameter RegionId is not valid. | The specified RegionId parameter is invalid. |
400 | InvalidZone.NotFound | The specified parameter ZoneId is not valid. | The specified ZoneId parameter is invalid. |
403 | InvalidDedicatedHostIds.Malformed | The amount of specified dedicatedHostIds exceeds the limit. | More than 100 dedicated host IDs are specified in the DedicatedHostIds value. |
404 | InvalidLockReason.NotFound | The specified LockReason is not found. | The specified lockout reason does not exist. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024-04-11 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||||||||||||
| ||||||||||||||||||
2023-03-16 | The Error code has changed. The response structure of the API has changed | see changesets | ||||||||||||||||
|