全部产品
Search
文档中心

边缘节点服务ENS:DescribeSecurityGroupAttribute - 查询安全组规则

更新时间:Aug 27, 2026

调用DescribeSecurityGroupAttribute查询一个安全组的安全组规则。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

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. 接口调用出错。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。