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

ListCommandControlPolicies

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

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

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

请求说明

  • 请求方式:POST
  • 请求地址:https://open.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排序条件。

PolicyFilter

参数类型是否必选示例值描述
KeywordStringpolicy策略名关键字,会进行模糊查询

OrderBy

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

Desc

Boolean

true

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

  • true:降序
  • false:升序

请求示例

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

CommandControlPolicy

参数类型示例值描述
IdString91f5****0-16d9-4fbb-9dca-0bf5*****883策略 ID。
KindInteger1类型。
NameStringpolicy策略名称。
CommandsArray of String["ls"]命令列表。

Priority

String

1

策略优先级,取值范围 1~100。

说明

  • 取值越低,优先级越高。
  • 同一个优先级只能有一个策略。
CreatedAtString2023-09-12 10:34:30策略创建时间。
UpdatedAtString2023-09-12 10:34:30策略修改时间。
UserCountInteger2关联用户数量。
InstanceIdStringvbh-14****0042-wdk*****z关联堡垒机实例 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
    }
}

错误码

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