GetHostGroup - Get a host group

Updated at:

Retrieves a host group by calling OpenAPI.

Supported versions

Central edition and Region edition

Service endpoints and authorization information

Product

Resource

Required permission

Pipeline

Host group

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/flow/organizations/{organizationId}/hostGroups/{id}

Region edition

GET https://{domain}/oapi/v1/flow/hostGroups/{id}

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

A personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The enterprise ID.

5ebbc0228123212b59xxxxx

id

integer

path

Yes

The host group ID.

11222

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/hostGroups/11222' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/flow/hostGroups/11222' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

object

aliyunRegion

string

The Alibaba Cloud region.

cn-hangzhou

createTime

integer

The creation time.

1586863220000

creatorAccountId

string

The creator's account ID.

1111111111111

description

string

The host group description.

Host group description

ecsLabelKey

string

The ECS label key.

ecs

ecsLabelValue

string

The ECS label value.

ecs

ecsType

string

The ECS type. Only ECS_ALIYUN is supported.

ECS_ALIYUN

hostInfos

array

-

object

aliyunRegion

string

The Alibaba Cloud region.

cn-hangzhou

createTime

integer

The creation time.

1586863220000

creatorAccountId

string

The creator's Alibaba Cloud account ID.

1111111111111

instanceName

string

The hostname.

ceshi

ip

string

The IP address of the instance.

127.0.0.1

machineSn

string

The machine serial number.

1ssasa

modifierAccountId

string

The modifier's Alibaba Cloud account ID.

1111111111111

objectType

string

Fixed value: MachineInfo.

MachineInfo

status

string

The Runner status.

ok

updateTime

integer

The update time.

1586863220000

hostNum

integer

The number of hosts.

1

id

integer

The host group ID.

1234

modifierAccountId

string

The modifier's account ID.

1111111111111

name

string

The host group name.

Host group name

serviceConnectionId

integer

The service connection ID.

1234

type

string

The host group type.

ECS

updateTime

integer

The update time.

1586863220000

uuid

string

The host group UUID.

KxqtcgPp7y5ROZdd

Response example

{
    "aliyunRegion": "cn-hangzhou",
    "createTime": 1586863220000,
    "creatorAccountId": "1111111111111",
    "description": "Host group description",
    "ecsLabelKey": "ecs",
    "ecsLabelValue": "ecs",
    "ecsType": "ECS_ALIYUN",
    "hostInfos": [
        {
            "aliyunRegion": "cn-hangzhou",
            "createTime": 1586863220000,
            "creatorAccountId": "1111111111111",
            "instanceName": "ceshi",
            "ip": "127.0.0.1",
            "machineSn": "1ssasa",
            "modifierAccountId": "1111111111111",
            "objectType": "MachineInfo",
            "status": "ok",
            "updateTime": 1586863220000
        }
    ],
    "hostNum": 1,
    "id": 1234,
    "modifierAccountId": "1111111111111",
    "name": "Host group name",
    "serviceConnectionId": 1234,
    "type": "ECS",
    "updateTime": 1586863220000,
    "uuid": "KxqtcgPp7y5ROZdd"
}

Error codes

For more information, see the error code center.