View security group details
Updated at:2025-10-16
Description
This API is used to query the details of the user's security group.
Request structure
Plain Text
1GET /v{version}/securityGroup/{securityGroupId} HTTP/1.1
2 Host: bcc.bj.baidubce.com
3 Authorization: authorization string
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, with current value being 2 |
| securityGroupId | String | Yes | URL parameter | Security group ID |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| id | String | Security group ID |
| name | String | Security Group Name |
| vpcId | String | ID of VPC to which the security group belongs |
| desc | String | Security group description |
| createdTime | String | Creation time |
| sgVersion | Long | Security group version |
| bindInstanceNum | Integer | Number of instances associated with the security group |
| rules | List<[SecurityGroupRuleModel](VPC/API Reference/Appendix.md#SecurityGroupRuleModel)> | Security group rule information, a collection composed of SecurityGroupModel |
| tags | List<[TagModel](VPC/API Reference/Appendix.md#TagModel)> | Tag information, covering a collection of tags |
Request example
Plain Text
1GET /v2/securityGroup/g-7dyv27r6pnse HTTP/1.1
2Host: bcc.bj.baidubce.com
3Content-Type: application/json;charset=UTF-8
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 87951801-3601-4e71-b3c1-798c3ee2efb0
3Date: Tue, 08 Oct 2024 11:22:31 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "id": "g-7dyv27r6pnse",
9 “name": "default security group",
10 "vpcId": "vpc-nw3m9e8kcby6",
11 "desc": "default",
12 "createdTime": "2024-09-13T06:25:19Z",
13 "sgVersion": 0,
14 "bindInstanceNum": 1,
15 "rules": [
16 {
17 "id": "r-rv2gdcz8bzzj",
18 "securityGroupId": "g-rfdndhzju1f7",
19 "direction": "ingress",
20 "ethertype": "IPv4",
21 "protocol": "tcp",
22 "portRange": "1991-29982",
23 "sourceGroupId": "g-sv5y70z12b0e",
24 "remark": "test",
25 "createdTime": "2024-09-27T07:07:07Z",
26 "updatedTime": "2024-09-27T07:47:57Z"
27 }
28 ],
29 "tags":[
30 {
31 "tagKey": "tagKey",
32 "tagValue": "tagValue"
33 }
34 ]
35}
