Querying Host Details (Recommended)
Function
This API is used to query host details by ID.
Calling Method
For details, see Calling APIs.
URI
GET /v1/resources/host-groups/{group_id}/hosts/{host_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| group_id | Yes | String | Host cluster ID |
| host_id | Yes | String | Host ID |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| status | String | Request success or failure status |
| result | HostInfoDetail object | Host details |
| Parameter | Type | Description |
|---|---|---|
| host_id | String | Host ID |
| ip | String | Host IP address |
| os | String | Host OS |
| port | Integer | Port number |
| authorization | HostAuthorizationBody object | Log in to the host for authentication by password or key. |
| permission | PermissionHostDetailNew object | Host-related permission details |
| group_id | String | Host cluster ID |
| host_name | String | Host name |
| as_proxy | Boolean | Proxy or not |
| proxy_host_id | String | Proxy ID |
| owner_name | String | Host owner name |
| proxy_host | HostInfoDetail object | Proxy details |
| connection_status | String | Connectivity status |
| create_time | String | Creation time |
| update_time | String | Update time |
| lastest_connection_time | String | Last connection time |
| connection_result | String | Connectivity verification result |
| install_icagent | Boolean | Application Operations Management (AOM) is enabled for free to provide metric monitoring, log query, and alarm functions. (The ICAgent is automatically installed and supports only Huawei Cloud Linux hosts.) |
| nick_name | String | Creator alias |
| Parameter | Type | Description |
|---|---|---|
| username | String | Username. The value can contain letters, digits, hyphens (-), underscores (_), and periods (.). |
| password | String | Password. When the authentication type is 0, the password is mandatory. |
| private_key | String | Key. When the authentication type is 1, the key is mandatory. |
| trusted_type | Integer | Authentication type. 0 indicates password authentication, and 1 indicates key authentication. |
| Parameter | Type | Description |
|---|---|---|
| can_view | Boolean | Whether you have the view permission |
| can_edit | Boolean | Whether you have the edit permission |
| can_delete | Boolean | Whether you have the delete permission |
| can_add_host | Boolean | Whether you have the permission to add hosts |
| can_copy | Boolean | Whether you have the permission to clone hosts |
Example Requests
https://{endpoint}/v1/resources/host-groups/ab7647b0863c4e969c8949d38d591339/hosts/300d6d2e53624d0da08b182099ad10f7 Example Responses
Status code: 200
OK: The request is successful.
{
"result" : {
"host_id" : "300d6d2e53624d0da08b182099ad10f7",
"ip" : "100.101.28.215",
"port" : 22,
"os" : "linux",
"authorization" : {
"username" : "root",
"password" : null,
"private_key" : null,
"trusted_type" : 0
},
"permission" : {
"can_view" : true,
"can_edit" : true,
"can_delete" : true,
"can_add_host" : true,
"can_copy" : true
},
"group_id" : "ab7647b0863c4e969c8949d38d591339",
"host_name" : "100.101.28.215",
"as_proxy" : false,
"proxy_host_id" : null,
"owner_name" : "devcloud_devcloud_l00490255_01",
"proxy_host" : null,
"connection_status" : "success",
"install_icagent" : false,
"create_time" : "2021-05-13 09:35:41",
"update_time" : "2021-05-13 09:35:41",
"connection_result" : "Connection established",
"lastest_connection_time" : "2021-05-13 09:36:11",
"nick_name" : "A/B Side Account"
},
"status" : "success"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK: The request is successful. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.