Help Center> CodeArts Deploy> API Reference> APIs> Host Management> Querying Host Details (Recommended)
Updated on 2023-11-28 GMT+08:00

Querying Host Details (Recommended)

Function

This API is used to query host details of a specified ID.

URI

GET /v1/resources/host-groups/{group_id}/hosts/{host_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

group_id

Yes

String

Host cluster ID.

host_id

Yes

String

Host ID.

Request Parameters

Table 2 Request header 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.

Minimum: 0

Maximum: 20000

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Request status.

result

HostInfoDetail object

Host details.

Table 4 HostInfoDetail

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

Whether a proxy host is used.

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.

Table 5 HostAuthorizationBody

Parameter

Type

Description

username

String

Username. The value can contain letters, digits, and hyphens (-).

Minimum: 3

Maximum: 128

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.

Minimum: 1

Maximum: 5000

trusted_type

Integer

Authentication type. 0 indicates password authentication, and 1 indicates key authentication.

Enumeration values:

  • 0

  • 1

Table 6 PermissionHostDetailNew

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 deletion permission.

can_add_host

Boolean

Whether you have the permission to add hosts.

can_copy

Boolean

Specifies whether the user has the permission to copy 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 succeeded",
    "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.