You need to enable JavaScript to run this app.
导航

ListHostGroups

最近更新时间2024.04.16 19:47:30

首次发布时间2023.12.15 10:45:21

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

请求说明

  • 请求方式:POST
  • 请求地址:https://open.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筛选条件。
OrderByObject of OrderBy排序信息。
InstanceIdStringvbh-14****0042-bhjml9w7云堡垒机 ID。

ListHostGroupsFilter

参数类型是否必选示例值描述
HostGroupIdsArray of String["2e7d77da-af08-41**-****-e44259701efb"]主机组 ID 列表。
KeywordStringbeijing-center主机组名关键字,模糊匹配。

OrderBy

参数类型是否必选示例值描述
KeyStringName排序字段

Desc

Boolean

true

是否进行降序排列。取值:

  • true:降序
  • false:升序

请求示例

POST https://open.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返回数据列表的总量。
PageNumberInteger当前页数。
PageSizeInteger10每页显示的数量。

HostGroup

参数类型示例值描述
CreateTimeString2023-09-12 10:34:30主机组创建时间。
UpdateTimeString2023-09-12 10:34:30主机组修改时间。
HostGroupNameStringbeijing-center主机组名称。
InstanceIdStringvbh-14****0042-bhjml9w7云堡垒机 ID。
HostGroupIdStringa47aa7c9-438d-11**-****-4ad9529a3e36主机组 ID。
DescriptionStringhost group for vbh主机组描述信息。

返回示例

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
    }
}

错误码

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