Update regular security group for service network interface card
Updated at:2025-10-16
Description
Update the regular security group associated with the service network interface card.
- At least one security group must be associated with the service network interface card.
- This operation adds a security group to the service network interface card and removes the existing security groups.
Request structure
Plain Text
1PUT /v{version}/endpoint/{endpointId}?{action}&clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "securityGroupIds":[
6 {securiGroupId}
7 ]
8}
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 |
| endpointId | String | Yes | URL parameter | Service network interface card ID |
| action | String | Yes | Query | The value for this API is bindSg |
| securityGroupIds | List<String> | Yes | RequestBody | List of IDs for regular security groups, which must be in the same VPC as the service network interface card |
| clientToken | String | No | Query | Idempotence Token, an ASCII string with a length not exceeding 64 bits. |
Response headers
No special headers are required beyond the standard ones.
Response parameters
No special response parameters are available.
Error code
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| NoSuchObject | The specified object is not found or resource do not exist. | 404 | Service network interface card does not exist |
| Vpc.SecurityGroupsNotSameVpc | The security groups not belong to same vpc. | 400 | Security group does not belong to the same VPC |
| InstanceBindNoSameVpcException | InstanceBindNoSameVpcException | 400 | Security group and service network interface card do not belong to the same VPC. |
Request example
Plain Text
1PUT /v1/endpoint/endpoint-91597e97?bindSg&clientToken=ds-hng79d HTTP/1.1
2Host: bcc.bj.baidubce.com
3authorization: bce-auth-v1/c3119080364d11e8912505e5e0ae9978/2019-04-02T08:14:25Z/3600/host;x-bce-account;x-bce-client-ip;x-bce-date;x-bce-request-id;x-bce-security-token/6b93bfd5ca2328fcb5560fa57f56253d80a629f6aac9c9cb74adf9a055fceb53
4{
5 "securityGroupIds":["g-4NxWoxeq"]
6}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 7e789a40-adac-414a-8bd4-916d6be61112
3Date: Mon, 02 Apr 2019 08:14:25 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
