文档

DescribeSecurityGroupAttribute - 查询安全组规则

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

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ens:DescribeSecurityGroupAttributeRead
  • acs:ens::{#accountId}:*

请求参数

名称类型必填描述示例值
SecurityGroupIdstring

安全组 ID。

sg-bp67acfmxazb4ph***

返回参数

名称类型描述示例值
object
RequestIdstring

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
Descriptionstring

安全组描述信息。

testDescription1
SecurityGroupIdstring

目标安全组 ID。

sg-bp1gxw6bznjjvhu3****
SecurityGroupNamestring

目标安全组名称。

testSecurityGroupName2
Permissionsobject []

规则。

CreationTimestring

创建时间,UTC 时间。

2018-12-12T07:28:38Z
Directionstring

授权方向。

ingress
Policystring

授权策略。

Accept
PortRangestring

源端端口范围。

80/80
SourceCidrIpstring

源 IP 地址段,用于入方向授权。

0.0.0.0/0
IpProtocolstring

IP 协议。

TCP
DestCidrIpstring

目标 IP 地址段,用于出方向授权。

0.0.0.0/0
Priorityinteger

规则优先级。

1
SourcePortRangestring

源端安全组端口范围。

22/22
Descriptionstring

描述信息。

testDescription1

示例

正常返回示例

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"
      }
    ]
  }
}

错误码

HTTP status code错误码错误信息描述
400MissingParameterThe input parameter that is mandatory for processing this request is not supplied.-
400NoPermissionPermission denied.没有足够的权限,请联系云账号管理员授予您相应权限。
400InvalidParameter.%sThe specified field %s invalid. Please check it again.-
400InvalidParameterThe errorMessage is %s. Please check it again.-
400InvalidSecurityGroupId.NotFoundThe specified SecurityGroupId does not exist.-
400SecurityGroupRuleConflict.DuplicatedThe SecurityGroup rule already exists.-
400AuthorizationLimitExceedThe limit of authorization records in the security group reaches.-
400SecurityGroupRule.NotFoundThe input security group rule does not exist.-
400IncorrectInstanceStatusThe current status of the resource does not support this operation.当前操作不被支持,磁盘正在重置中。
400InvalidInstanceId.NotFoundThe specified InstanceId does not exist.-
400DependencyViolationThere is still instance(s) in the specified security group.-
400ens.interface.errorAn error occurred while calling the API.-
400CallInterfaceCall Interface Happen Error.接口调用出错。

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

变更历史

变更时间变更内容概要操作
2023-12-21OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
  • 本页导读 (1)
文档反馈