You need to enable JavaScript to run this app.
文档中心
私有网络

私有网络

复制全文
下载 pdf
安全组
DescribeSecurityGroupAttributes - 查询安全组详细信息
复制全文
下载 pdf
DescribeSecurityGroupAttributes - 查询安全组详细信息
调用 DescribeSecurityGroupAttributes 接口,在指定安全组内查询满足指定条件的安全组规则。​
使用说明​
  • 传入多个请求参数,按照传入的参数进行查询,返回符合所有条件的安全组规则,若没有符合条件的安全组规则,则返回指定安全组的基础信息。​
  • 若请求参数非必选参数均未传入,则返回指定安全组下的所有安全组规则。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:DescribeSecurityGroupAttributes​
接口名称。当前 API 的名称为DescribeSecurityGroupAttributes。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为 2020-04-01。​
​
SecurityGroupId String 必选 示例值:sg-bp1gxw6bznjjvhu3****​
规则所属安全组的ID。​
您可以调用 DescribeSecurityGroups 接口,查询安全组的ID。​
​
Direction String 可选 示例值:egress​
授权方向。 取值如下:​
  • egress:安全组出方向​
  • ingress:安全组入方向​
​
Protocol String 可选 示例值:all​
协议类型。取值如下:​
  • tcp:TCP协议。​
  • udp:UDP协议。​
  • icmp:ICMP协议。​
  • icmpv6:ICMPV6协议。​
  • all:支持所有协议。​
​
CidrIp String 可选 示例值:10.XX.XX.1/8​
IP地址段,用于安全组出入方向规则的授权。根据参数Direction的取值不同,含义也不同:​
  • Direction取值为“egress”时,表示目的IP地址段。​
  • Direction取值为“ingress”时,表示源IP地址段。​
说明​
当参数 CidrIp、SourceGroupId、PrefixListId传入值时,仅生效一个,生效的优先级为CidrIp > SourceGroupId > PrefixListId。​
​
SourceGroupId String 可选 示例值:sg-bp67acfmxazb4p****​
源地址或目的地址的安全组ID。​
说明​
当参数 CidrIp、SourceGroupId、PrefixListId传入值时,仅生效一个,生效的优先级为CidrIp > SourceGroupId > PrefixListId​
​
PrefixListId String 可选 示例值:pl-bp1fg655nh68xyz9****​
前缀列表的ID。​
说明​
当参数 CidrIp、SourceGroupId、PrefixListId传入值时,仅生效一个,生效的优先级为CidrIp > SourceGroupId > PrefixListId。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:2021062415303301022514515207C4****​
请求ID。​
​
AccountId String 示例值:2000****​
安全组所属主账号。​
​
VpcId String 示例值:vpc-bp1opxu1zkhn00gzv****​
VPC的ID。​
​
SecurityGroupId String 示例值:sg-bp1gxw6bznjjvhu3****​
目标安全组的ID。​
​
SecurityGroupName String 示例值:testSecurityGroupName2​
目标安全组的名称。​
​
Description String 示例值:sg_1​
安全组的描述信息。​
​
Type String 示例值:normal​
安全组的类型。​
  • default:默认安全组。​
  • normal:自定义安全组。​
  • VpnGW:VPN网关安全组。​
  • NatGW:NAT网关安全组。​
​
ServiceManaged Boolean 示例值:true​
安全组是否为托管安全组。​
  • true:是。​
  • false:否。​
​
Status String 示例值:Available​
安全组的状态。​
  • Available:可用。​
  • Creating:创建中。​
​
Permissions Object[] 示例值:-​
安全组规则集合。​
SourceGroupId String 示例值:sg-bp1gxw6bznjjvhu3****​
安全组的ID。​
​
Direction String 示例值:egress​
授权方向。​
​
Priority Integer 示例值:1​
规则优先级。​
​
Policy String 示例值:accept​
访问策略。​
  • accept:接受访问。​
  • drop:拒绝访问。​
​
Protocol String 示例值:TCP​
协议类型。​
​
PortStart Integer 示例值:80​
端口起始。​
​
PortEnd Integer 示例值:80​
端口结束。​
​
CidrIp String 示例值:10.XX.XX.1/8​
IP地址段,用于安全组出入方向规则的授权。根据返回数据Direction的取值不同,含义也不同:​
  • Direction取值为“egress”时,表示目的IP地址段。​
  • Direction取值为“ingress”时,表示源IP地址段。​
​
PrefixListId String 示例值:pl-bp1fg655nh68xyz9****​
前缀列表的ID。​
​
PrefixListCidrs String[] 示例值:8.XX.XX.0/16​
前缀列表的CIDR。​
​
Description String 示例值:sg rule for default​
安全组规则的描述信息。​
​
CreationTime String 示例值:2021-12-12T07:28:38+08:00​
创建安全组规则的时间。​
​
UpdateTime String 示例值:2021-2-10T07:28:30+08:00​
更新安全组规则的时间。​
​
SecurityGroupRuleId String 示例值:sgr-bp12kc4rqohaf2js****​
安全组规则ID。​
​
​
ProjectName String 示例值:default​
安全组所属项目的名称。​
​
Tags Object[] 示例值:-​
安全组的标签信息。​
Key String 示例值:k1​
标签的标签键。​
​
Value String 示例值:v1​
标签的标签值。​
​
​
CreationTime String 示例值:2021-07-12T07:28:20+08:00​
创建安全组的时间。​
​
UpdateTime String 示例值:2021-08-12T07:30:38+08:00​
更新安全组的时间。​
​
​
​
请求示例​
​
GET /?Action=DescribeSecurityGroupAttributes&Version=2020-04-01&SecurityGroupId=sg-bp1gxw6bznjjvhu3**** HTTP/1.1​
Host: vpc.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/vpc/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "DescribeSecurityGroupAttributes",​
"Version": "2020-04-01",​
"Service": "vpc",​
"Region": "cn-beijing"​
},​
"Result": {​
"AccountId": "2000****",​
"CreationTime": "2021-07-12T07:28:20+08:00",​
"Description": "sg_1",​
"Permissions": [​
{​
"CidrIp": "10.XX.XX.1/8",​
"Policy": "accept",​
"PortEnd": 80,​
"Priority": 1,​
"Protocol": "TCP",​
"Direction": "egress",​
"PortStart": 80,​
"UpdateTime": "2021-2-10T07:28:30+08:00",​
"Description": "sg rule for default",​
"CreationTime": "2021-12-12T07:28:38+08:00",​
"PrefixListId": "pl-bp1fg655nh68xyz9****",​
"SourceGroupId": "sg-bp1gxw6bznjjvhu3****",​
"PrefixListCidrs": [​
""​
],​
"SecurityGroupRuleId": "sgr-bp12kc4rqohaf2js****"​
}​
],​
"ProjectName": "default",​
"RequestId": "2021062415303301022514515207C4****",​
"SecurityGroupId": "sg-bp1gxw6bznjjvhu3****",​
"SecurityGroupName": "testSecurityGroupName2",​
"ServiceManaged": true,​
"Status": "Available",​
"Tags": [​
{​
"Key": "k1",​
"Value": "v1"​
}​
],​
"Type": "normal",​
"UpdateTime": "2021-08-12T07:30:38+08:00",​
"VpcId": "vpc-bp1opxu1zkhn00gzv****"​
}​
}​
​
错误码​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
404​
InvalidSecurityGroupId.NotFound​
The specified security group does not exist.​
指定的安全组不存在。​
​
​
最近更新时间:2026.09.23 11:13:56
这个页面对您有帮助吗?
有用
有用
无用
无用