Create gateway bandwidth limiting rules
Updated at:2025-10-16
Description
Define gateway bandwidth control rules.
Request structure
Text
1POST /v{version}/gateway/limitrule?clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Content-Type: application/json
4Authorization: authorization string
5{
6 "ipVersion":"4",
7 "name":"create-fromapi-test-pc",
8 "description":"test-createfrom-api-description",
9 "serviceType":"peerconn",
10 "resourceId":"qpif-1p7qybe3hd1i",
11 "direction":"egress",
12 "cidr": "192.168.0.7/32",
13 "bandwidth":1
14}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| clientToken | String | No | Query | Idempotency Token, with length no more than 64 characters. |
| ipVersion | String | Yes | RequestBody | IP protocol version, with current value being 4 |
| name | String | Yes | RequestBody | Specify a rule name that adheres to the naming standards. It can include uppercase and lowercase letters, numbers, and the special characters -, _, /, and ., must begin with a letter, and have a length of 1-65 characters. |
| description | String | No | RequestBody | Provide a description with a length of 0-200 characters. |
| serviceType | String | Yes | RequestBody | Service type (peerconn, et, csn) peerconn - Peering connections et - Dedicated gateway csn - Cloud smart network |
| subServiceType | String | No | RequestBody | Sub-service type, mandatory when serviceType="csn". LOCAL (Network instance bandwidth type). PEER_CLOUD-Cross-region bandwidth for inter-cloud connection PEER_EDGE-Cloud-edge connection |
| peerRegion | String | No | RequestBody | Required when the subServiceType is PEER_CLOUD or PEER_EDGE. Specify the peer region, such as "bj" for North China-Beijing or "bd" for North China-Baoding. |
| resourceId | String | Yes | RequestBody | Provide the Resource ID, peering connection ID, or Gateway ID. For subServiceType="LOCAL", resourceId="csnId:vpcId". For subServiceType="PEER_CLOUD", this value should be csnId. |
| direction | String | Yes | RequestBody | Bandwidth limiting direction: egress |
| cidr | String | Yes | RequestBody | Define the source CIDR range (the bandwidth control rule applies to the specified source CIDR range). |
| bandwidth | Integer | Yes | RequestBody | Specify the bandwidth in Mbps (with an upper limit determined by the maximum bandwidth of the specific gateway). |
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| glrId | String | ID of gateway bandwidth limiting rule |
Request example
Text
1POST /v1/gateway/limitrule?clientToken=be31b98a-5e41-4838-9830-9be700de5a20 HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5{
6 "ipVersion":"4",
7 "name":"create-fromapi-test-pc",
8 "description":"test-createfrom-api-description",
9 "serviceType":"peerconn",
10 "resourceId":"qpif-1p7qybe3hd1i",
11 "direction":"egress",
12 "cidr": "192.168.0.7/32",
13 "bandwidth":1
14}
Response example
Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "glrId": "glr-pw7dwtfupegj"
8}
