Help Center> CodeArts Deploy> API Reference> APIs> Host Cluster Management> Querying a Host Cluster (Recommended)
Updated on 2023-09-21 GMT+08:00

Querying a Host Cluster (Recommended)

Function

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

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

group_id

Yes

String

Host cluster 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.

Minimum: 0

Maximum: 1000

result

HostClusterInfoDetailDetail object

Host cluster information.

Table 4 HostClusterInfoDetailDetail

Parameter

Type

Description

id

String

Host cluster ID.

Minimum: 32

Maximum: 32

name

String

Host cluster name.

os

String

Operating system: windows and linux.

slave_cluster_id

String

Slave cluster ID. If the value is null, the default slave cluster is used. If slave is user-defined, the slave cluster ID is used.

created_by

UserInfo object

User information.

description

String

Description.

Minimum: 0

Maximum: 500

permission

PermissionClusterDetail object

Host cluster permission details.

nick_name

String

Creator name.

is_proxy_mode

Integer

Whether the proxy mode is used.

created_time

String

Creation time.

updated_time

String

Update time.

Table 5 UserInfo

Parameter

Type

Description

user_id

String

User ID.

user_name

String

Username.

Table 6 PermissionClusterDetail

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_manage

Boolean

Whether you have permission to edit the host cluster permission matrix.

Example Requests

https://{endpoint}/v1/resources/host-groups/ab7647b0863c4e969c8949d38d591339

Example Responses

Status code: 200

OK: The request is successful.

{
  "status" : "success",
  "result" : {
    "id" : "ab7647b0863c4e969c8949d38d591339",
    "name" : "test",
    "description" : "11122211",
    "os" : "linux",
    "created_by" : {
      "user_id" : "6baa7454109d47c192f22078fe6cda20",
      "user_name" : "devcloud_devcloud_l00490255_01"
    },
    "permission" : {
      "can_view" : true,
      "can_edit" : true,
      "can_delete" : true,
      "can_add_host" : true,
      "can_manage" : true
    },
    "is_proxy_mode" : 0,
    "slave_cluster_id" : "",
    "nick_name" : "A-B Side Account",
    "created_time" : "2021-04-01 17:05:53",
    "updated_time" : "2021-04-21 14:29:14"
  }
}

Status Codes

Status Code

Description

200

OK: The request is successful.

Error Codes

See Error Codes.