Update enterprise security group rules
Updated at:2025-10-16
Description
Update the rules for enterprise security groups.
Request structure
Plain Text
1PUT /v{version}/enterprise/security/rule/{enterpriseSecurityGroupRuleId}?clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "sourceIp":"10.0.0.1/24",
7 "portRange":"809",
8 "priority":5,
9 "protocol":"tcp",
10 "remark":"test"
11}
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 | For API version No., the current value is 1 |
| clientToken | String | No | Query | Idempotence Token, which is an ASCII string with a length not exceeding 64 bits, see details in [ClientToken Idempotence Support](VPC/API Reference/General Description.md#Idempotence). |
| enterpriseSecurityGroupRuleId | String | Yes | URL parameter | Enterprise security group rule ID |
| remark | String | No | RequestBody | Description |
| portRange | String | No | RequestBody | Destination port range |
| sourcePortRange | String | No | RequestBody | Source port range |
| sourceIp | String | No | RequestBody | Ingress rule source IP, used only for ingress rules. Select one among the three options: remoteIpSet, remoteIpGroup, or this value |
| destIp | String | No | RequestBody | Egress rule destination IP, used only for egress rules. Select one among the three options: remoteIpSet, remoteIpGroup, or this value |
| localIp | String | No | RequestBody | Local IP |
| remoteIpSet | String | No | RequestBody | Remote IP address group, select one among the three options: sourceIp(destIp), remoteIpGroup and this value |
| remoteIpGroup | String | No | RequestBody | Remote IP address family, select one among the three options: sourceIp(destIp), remoteIpSet and this value |
| action | String | No | RequestBody | Allow/Deny, values: "allow" or "deny" |
| priority | Integer | No | RequestBody | Priority |
| protocol | String | No | RequestBody | Protocol, value range: all, tcp, udp, or icmp |
Response headers
No special headers are required beyond the standard ones.
Response parameters
No response parameters.
Error code
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| Esg.EsgRuleResourceNotExist | Enterprise security group rule resource not exist. | 404 | Target enterprise security group rule does not exist |
| Esg.EsgRuleActionInvalid | Enterprise security group rule action(allow or deny) is invalid. | 400 | Enterprise security group rule action is invalid |
| Esg.EsgRuleRemarkTooLong | Enterprise security group rule remark is too long. | 400 | Enterprise security group rule remark is too long |
| Esg.EsgRuleProtocolInvalid | Enterprise security group rule protocol is invalid. | 400 | Protocol type for enterprise security group rule is invalid |
| Esg.EsgRulePortFormatInvalid | Enterprise security group rule portRange is invalid. | 400 | Enterprise security group rule port range format is incorrect |
| Esg.EsgRulePortDuplicate | Enterprise security group rule ports in portRange is duplicate. | 400 | Enterprise security group rule port values are duplicated, e.g., 80-80 or 80,80,7000 |
| Esg.EsgRulePortOrderError | Enterprise security group rule portRange order is wrong. | 400 | Enterprise security group rule port range sequence is incorrect, e.g., 400-80 |
| Esg.EsgRuleDispersedPortSizeExceed | Enterprise security group rule dispersed ports in portRange is limited 15. | 400 | Excessive discrete port range values for enterprise security group rule |
| Esg.EsgRulePortValueExceed | Enterprise security group rule port value is not in range 1-65535 | 400 | Enterprise security group rule port value out of range |
| Esg.EsgRulePriorityInvalid | Enterprise security group rule priority is not in range 1-1000. | 400 | Enterprise security group rule priority value out of range |
| Esg.EsgRuleIpAddressError | Enterprise security group rule ip(cidr) address is incorrect. | 400 | Enterprise security group rule source IP/destination IP format is incorrect |
| Esg.EsgRuleDirectionInvalid | Enterprise security group rule direction is invalid. | 400 | Enterprise security group rule direction is invalid |
| Esg.EsgRuleDuplicated | Enterprise security group rule exist already. | 400 | Enterprise security group rule is duplicated |
Request example
Plain Text
1PUT /v1/enterprise/security/rule/esgr-6eh9yhp8ugw3?clientToken=a0ba59e3-2f21-4372-a01e-4eb9db5e180c HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "sourceIp":"10.0.0.1/24",
7 "portRange":"809",
8 "priority":5,
9 "protocol":"tcp",
10 "remark":"test"
11}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Thu, 16 Mar 2017 06:29:48 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
