查询ACL规则列表
更新时间:2023-08-14
接口描述
本接口用于查询ACL规则列表。
请求结构
JSON
1GET /v2/vpc/acl/rule?subnetId={subnetId}&marker={marker}&maxKeys={maxKeys} HTTP/1.1
2Host: bec.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
---|---|---|---|---|
marker | 标记查询的起始位置 | query | 否 | string |
maxKeys | 每页包含的最大数量,1-1000,默认1000 | query | 否 | integer |
subnetId | 子网ID | query | 是 | string |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 参数说明 | 类型 |
---|---|---|
aclRules | ACL规则列表 | List<BecAclRule> |
id | ACL规则ID | string |
action | 策略。允许allow,拒绝deny | string |
description | 备注 | string |
destinationIpAddress | 目的IP | string |
destinationPort | 目的端口 | string |
direction | 方向。入站ingress,出站egress | string |
position | 优先级。数值越小,优先级越高,规则匹配顺序为按优先级由高到低匹配 | integer |
protocol | 协议类型 | string |
sourceIpAddress | 源IP | string |
sourcePort | 源端口 | string |
subnetId | 子网ID | string |
isTruncated | true表示后面还有数据,false表示已经是最后一页 | boolean |
marker | 标记查询的起始位置 | string |
maxKeys | 每页包含的最大数量 | integer |
nextMarker | 获取下一页所需要传递的marker值。当isTruncated为false时,该域不出现 | string |
错误码
请参照错误返回章节的内容。
请求示例
JSON
1GET /v2/vpc/acl/rule?subnetId=sbn-qstqimne HTTP/1.1
2Host: bec.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
响应示例
JSON
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3Date: Wed, 08 Jul 2015 03:28:11 GMT
4x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
5Server: BWS
6
7{
8 "isTruncated": false,
9 "maxKeys": 1000,
10 "aclRules": [
11 {
12 "id": "ar-fdxefg3r",
13 "subnetId": "sbn-qstqimne",
14 "description": "默认",
15 "protocol": "all",
16 "sourceIpAddress": "0.0.0.0/0",
17 "destinationIpAddress": "0.0.0.0/0",
18 "sourcePort": "0-65535",
19 "destinationPort": "0-65535",
20 "position": 32769,
21 "direction": "ingress",
22 "action": "allow"
23 },
24 {
25 "id": "ar-rcefg1h1",
26 "subnetId": "sbn-qstqimne",
27 "description": "默认",
28 "protocol": "all",
29 "sourceIpAddress": "0.0.0.0/0",
30 "destinationIpAddress": "0.0.0.0/0",
31 "sourcePort": "0-65535",
32 "destinationPort": "0-65535",
33 "position": 32769,
34 "direction": "egress",
35 "action": "allow"
36 },
37 {
38 "id": "ar-02qghmio",
39 "subnetId": "sbn-qstqimne",
40 "description": "",
41 "protocol": "all",
42 "sourceIpAddress": "0.0.0.0/0",
43 "destinationIpAddress": "10.0.1.0/24",
44 "sourcePort": "0-65535",
45 "destinationPort": "0-65535",
46 "position": 1,
47 "direction": "ingress",
48 "action": "allow"
49 }
50 ]
51}