调用DescribeSecurityGroupAttribute查询一个安全组的安全组规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:DescribeSecurityGroupAttribute |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| SecurityGroupId |
string |
是 |
安全组 ID。 |
sg-bp67acfmxazb4ph*** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| Description |
string |
安全组描述信息。 |
testDescription1 |
| SecurityGroupId |
string |
目标安全组 ID。 |
sg-bp1gxw6bznjjvhu3**** |
| SecurityGroupName |
string |
目标安全组名称。 |
testSecurityGroupName2 |
| Permissions |
object |
||
| Permission |
array<object> |
规则。 |
|
|
object |
安全组规则。 |
||
| CreationTime |
string |
创建时间,UTC 时间。 |
2018-12-12T07:28:38Z |
| Direction |
string |
授权方向。 |
ingress |
| Policy |
string |
授权策略。 |
Accept |
| PortRange |
string |
源端端口范围。 |
80/80 |
| SourceCidrIp |
string |
源 IP 地址段,用于入方向授权。 |
0.0.0.0/0 |
| IpProtocol |
string |
IP 协议。 |
TCP |
| DestCidrIp |
string |
目标 IP 地址段,用于出方向授权。 |
0.0.0.0/0 |
| Priority |
integer |
规则优先级。 |
1 |
| SourcePortRange |
string |
源端安全组端口范围。 |
22/22 |
| Description |
string |
描述信息。 |
testDescription1 |
| Ipv6SourceCidrIp |
string |
源端 IPv6 地址段。 |
::/0 |
| Ipv6DestCidrIp |
string |
目的端 IPv6 地址段。 |
::/0 |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"Description": "testDescription1",
"SecurityGroupId": "sg-bp1gxw6bznjjvhu3****",
"SecurityGroupName": "testSecurityGroupName2",
"Permissions": {
"Permission": [
{
"CreationTime": "2018-12-12T07:28:38Z",
"Direction": "ingress",
"Policy": "Accept",
"PortRange": "80/80",
"SourceCidrIp": "0.0.0.0/0",
"IpProtocol": "TCP",
"DestCidrIp": "0.0.0.0/0",
"Priority": 1,
"SourcePortRange": "22/22",
"Description": "testDescription1",
"Ipv6SourceCidrIp": "::/0",
"Ipv6DestCidrIp": "::/0"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | 指定的安全组ID不存在。 |
| 400 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 当前操作不被支持,磁盘正在重置中。 |
| 400 | CallInterface | Call Interface Happen Error. | 接口调用出错。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。