Queries the information about dedicated hosts, including the physical performance specifications, machine codes, and status of the dedicated hosts, and Elastic Compute Service (ECS) instances that are created on the dedicated hosts.
Operation description
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:DescribeDedicatedHosts | get | *DedicatedHost acs:ecs:{#regionId}:{#accountId}:ddh/* *DedicatedHost acs:ecs:{#regionId}:{#accountId}:ddh/{#ddhId} |
| none |
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 number of entries per page. 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 | array<object> | No | The tags of the dedicated host. | |
object | No | |||
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 contain | TestKey |
Value | string | No | The value of tag N of 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 contain | TestValue |
DedicatedHostClusterId | string | No | The ID of the dedicated host cluster. | dc-bp12wlf6am0vz9v2**** |
SocketDetails | string | No | Specifies whether to display socket information. Valid values:
| true |
NextToken | string | No | The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken. | e71d8a535bd9cc11 |
MaxResults | integer | No | The maximum number of entries per page. If you specify this parameter, both MaxResults and NextToken are used for a paged query. Valid values: 1 to 100. Default value: 10. | 10 |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageSize": 1,
"RequestId": "7654525A-9964-4ABB-8BCD-98F8835E809A",
"PageNumber": 5,
"TotalCount": 3,
"NextToken": "e71d8a535bd9cc11",
"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 | View Change Details |
2023-03-16 | The Error code has changed. The response structure of the API has changed | View Change Details |