You need to enable JavaScript to run this app.
导航
ListHostGroups
最近更新时间:2025.05.23 17:57:31首次发布时间:2023.12.15 10:45:21
我的收藏
有用
有用
无用
无用

获取云堡垒机的主机组列表,可根据分页及主机组 ID、名称关键字等筛选条件查询云堡垒机中已存在的主机组列表,并且能够按字段进行排序。

请求说明

  • 请求方式:POST
  • 请求地址:https://vbh.{RegionID}.volcengineapi.com/?Action=ListHostGroups&Version=2021-06-01

请求参数

参数类型是否必选示例值描述
ActionStringListHostGroups接口名称。当前 API 的名称为 ListHostGroups
VersionString2021-06-01接口版本。当前 API 的版本为 2021-06-01
PageNumberInteger2分页查询时的起始页码,从 1 开始,默认为 1。

PageSize

Integer

10

分页查询时每页显示的记录数.

  • 最小值:1
  • 最大值:100
  • 默认值:10
FilterObject of ListHostGroupsFilter{"Keyword": "word"}筛选条件。
OrderByObject of OrderBy{"Key": "some key", "Desc": true}排序信息。
InstanceIdStringvbh-14****0042-bhjml9w7云堡垒机 ID。

ListHostGroupsFilter

参数类型是否必选示例值描述
KeywordStringkeyword模糊搜索
HostGroupIdsArray of String["2e7d77da-af08-4101-867d-e44259701efb"]主机组ID筛选

OrderBy

参数类型是否必选示例值描述
KeyStringkey字段
DescBooleantrue or false倒序

请求示例

POST https://vbh.{RegionID}.volcengineapi.com/?Action=ListHostGroups&Version=2021-06-01
Content-Type: application/json
{
    "PageNumber": 2,
    "PageSize": 10,
    "Filter": {
        "HostGroupIds": [
            "2e7d77da-af08-41**-****-e44259701efb"
        ],
        "Keyword": "vbh"
    },
    "OrderBy": {
        "Key": "Name",
        "Desc": true
    },
    "InstanceId": "vbh-14****0042-bhjml9w7"
}

返回参数

参数类型示例值描述
ItemsArray of HostGroup主机组列表。
TotalCountLong22返回数据列表的总量。
PageNumberInteger2当前页数。
PageSizeInteger10每页显示的数量。

HostGroup

参数类型示例值描述
CreateTimeString2022-12-12 22:22:22创建时间
UpdateTimeString2022-12-12 22:22:22修改时间
HostGroupNameStringtest节点组名称
InstanceIdStringvbh-1400000042-bhjml9w7堡垒机Id
HostGroupIdStringa47aa7c9-438d-11ec-a6f0-4ad9529a3e36Id
DescriptionStringdescription节点组名称

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208****",
        "Action": "ListHostGroups",
        "Version": "2021-06-01",
        "Service": "vbh",
        "Region": "cn-beijing"
    },
    "Result": {
        "Items": [
            {
                "CreateTime": "2023-09-12 10:34:30",
                "UpdateTime": "2023-09-12 10:34:30",
                "HostGroupName": "beijing-center",
                "InstanceId": "vbh-14****0042-bhjml9w7",
                "HostGroupId": "a47aa7c9-438d-11**-****-4ad9529a3e36",
                "Description": "host group for vbh"
            }
        ],
        "TotalCount": 22,
        "PageNumber": 1,
        "PageSize": 10
    }
}

错误码

当前接口暂无独立错误码,若接口调用返回异常,可参考 公共错误码 进行故障排查。