查看安全组详情
更新时间:2025-04-30
描述
该接口用于查询用户的安全组详情信息。
请求结构
Plain Text
1GET /v{version}/securityGroup/{securityGroupId} HTTP/1.1
2 Host: bcc.bj.baidubce.com
3 Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值为2 |
securityGroupId | String | 是 | URL参数 | 安全组ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
id | String | 安全组ID |
name | String | 安全组名称 |
vpcId | String | 安全组所属VPC的ID |
desc | String | 安全组描述 |
createdTime | String | 创建时间 |
sgVersion | Long | 安全组版本 |
bindInstanceNum | Integer | 安全组所关联的实例数目 |
rules | List<SecurityGroupRuleModel> | 安全组规则信息,由SecurityGroupModel组成的集合 |
tags | List<TagModel> | 标签信息,由Tag组成的集合 |
请求示例
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
返回示例
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": "默认安全组",
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}