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

获取指定实例的命令控制策略列表,可根据策略名称关键字查询云堡垒机的命令控制策略列表,并且能够按字段进行排序。

请求说明

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

请求参数

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

PageSize

Integer

10

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

  • 最小值:1
  • 最大值:100
  • 默认值:10
FilterObject of PolicyFilter模糊查询参数。
InstanceIdStringvbh-14****0042-m2bkmjcc云堡垒机实例 ID。
OrderByObject of OrderBy{"Key": "some key", "Desc": true}排序条件。

PolicyFilter

参数类型是否必选示例值描述
KeywordStringtest模糊查询参数名称

OrderBy

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

请求示例

POST https://vbh.{RegionID}.volcengineapi.com/?Action=ListCommandControlPolicies&Version=2021-06-01
Content-Type: application/json
{
    "PageNumber": 1,
    "PageSize": 10,
    "Filter": {
        "Keyword": "policy"
    },
    "InstanceId": "vbh-14****0042-m2bkmjcc",
    "OrderBy": {
        "Key": "Name",
        "Desc": true
    }
}

返回参数

参数类型示例值描述
ItemsArray of CommandControlPolicy[{"Id": "id", "CreatedAt": "2022-12-12 22:22:22", "UpdatedAt": "2022-12-12 22:22:22", "Name": "test", "Description": "desc", "Priority": 1, "Kind": 1, "Commands": ["ls"], "InstanceId": "vbh-1400000042-m2bkmjcc", "UserCount": 1, "UserGroupCount": 1}]策略列表
TotalCountLong2返回数据列表的总量。
PageNumberInteger1当前页数。
PageSizeInteger10每页显示的数量。

CommandControlPolicy

参数类型示例值描述
IdStringidID
KindInteger1类型
NameStringtest策略名称
CommandsArray of String["ls"]命令列表
PriorityInteger1优先级
CreatedAtString2022-12-12 22:22:22创建时间
UpdatedAtString2022-12-12 22:22:22修改时间
UserCountInteger2关联用户数量
InstanceIdStringvbh-1400000042-m2bkmjcc关联堡垒机Id
DescriptionStringdescription策略描述
UserGroupCountInteger2关联用户组数量

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202211302208****",
        "Action": "ListCommandControlPolicies",
        "Version": "2021-06-01",
        "Service": "vbh",
        "Region": "cn-beijing"
    },
    "Result": {
        "Items": [
            {
                "Id": "7f****fc-c0b7-11ec-b792-e*****1bf10a",
                "CreatedAt": "2023-09-12 10:34:30",
                "UpdatedAt": "2023-09-12 10:34:30",
                "Name": "policy",
                "Description": "This is description",
                "Priority": ,
                "Kind": 1,
                "Commands": ["ls"],
                "InstanceId": "vbh-14****0042-wdk****z",
                "UserCount": 2,
                "UserGroupCount": 2
            }
        ],
        "TotalCount": 2,
        "PageNumber": 1,
        "PageSize": 10
    }
}

错误码

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