Create permission group rules
Updated at:2025-11-11
Description
Create a new rule for the specified permission group
Request
Request structure
Plain Text
1POST /v{version}/accessGroup/{agName}
2Host: cfs.bj.baidubce.com
3Authorization: authorization string
4{
5 "ip": ip,
6 "mask": mask,
7 "writeAccess": write,
8 "userAccess": user,
9 "priority": priority
10}
Request headers: No special headers beyond common headers
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | The current API version number is 1. |
| agName | String | Yes | URL parameter | Specify the permission group name for the created rule. |
| ip | String | Yes | RequestBody | Authorize IP addresses and virtual VPC IPs, allow single IPs or set network segments combined with the mask parameter, support both IPv4 and IPv6, such as 10.10.1.123 or 2001::/16 |
| mask | int | Yes | RequestBody | Specify a network segment combined with IP parameters; for a single IP, set it to 32 (IPv4) or 128 (IPv6) |
| writeAccess | String | Yes | RequestBody | Read-write rules. The "read_only" indicates read-only access, while "read_write" indicates read-write access. |
| userAccess | String | Yes | RequestBody | User permission rules. The "no_squash" indicates no restrictions on root users, the "root_squash" indicates restrictions on root users, and "all_squash" indicates restrictions on all users |
| priority | int | Yes | RequestBody | Rule priority. The optional priority range is from 1 to 100, with 1 being the highest priority |
Response
Response status code: Respond with 200 after successful operation, and respond with error codes after failed operation, as shown in Error Codes
Response headers: No special headers beyond common headers
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| accessRuleId | int | Identifier of permission group rule |
Example
Request:
Plain Text
1POST /v1/accessGroup/ag_test HTTP/1.1
2HOST cfs.bj.baidubce.com
3Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
4{
5 "ip": "10.10.1.123"
6 "mask": 32
7 "writeAccess": "read_write"
8 "userAccess": "all_squash"
9 "priority": 99
10}
Response:
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
3Date: Wed, 10 Apr 2016 08:26:52 GMT
4Transfer-Encoding: chunked
5Content-Type: application/json;charset=UTF-8
6Server: BWS
7{
8 "accessRuleId": 2
9}
