全部产品
Search
文档中心

云服务器 ECS:DescribeSecurityGroupReferences - 查询有安全组级别的授权行为

更新时间:Oct 21, 2024

调用DescribeSecurityGroupReferences接口,并指定参数SecurityGroupId,查询所有用户指定的安全组被授权的完整信息。

接口说明

调用该接口时,您需要注意:

  • 授权行为包括入方向授权和出方向授权。

  • 该接口单次最多返回 100 条记录。

  • 当您无法删除某一安全组( DeleteSecurityGroup )时,可以调用该接口查看指定的安全组是否已被其他安全组授权。如果指定的安全组已被授权,您需要在删除该安全组之前解除授权行为。

调试

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

授权信息

当前API暂无授权信息透出。

请求参数

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

安全组所属地域。

cn-hangzhou
SecurityGroupIdarray

要查询的 N 个 SecurityGroupId。N 的取值范围:1~10

string

要查询的第 N 个 SecurityGroupId。N 的取值范围:1~10。

sg-bp14vtedjtobkvi****

返回参数

名称类型描述示例值
object
RequestIdstring

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
SecurityGroupReferencesarray<object>

所有用户指定的安全组被授权的完整信息。

SecurityGroupReferenceobject

所有用户指定的安全组被授权的完整信息。

SecurityGroupIdstring

对应用户要查询的一个安全组。

sg-bp67acfmxazb4p****
ReferencingSecurityGroupsarray<object>

正在授权给这个安全组的其他安全组信息。

ReferencingSecurityGroupobject

正在授权给这个安全组的其他安全组信息。

SecurityGroupIdstring

安全组 ID。

sg-bp67acfmxazb4j****
AliUidstring

这个安全组所属用户 ID。

123456****

示例

正常返回示例

JSON格式

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "SecurityGroupReferences": {
    "SecurityGroupReference": [
      {
        "SecurityGroupId": "sg-bp67acfmxazb4p****",
        "ReferencingSecurityGroups": {
          "ReferencingSecurityGroup": [
            {
              "SecurityGroupId": "sg-bp67acfmxazb4j****",
              "AliUid": "123456****"
            }
          ]
        }
      }
    ]
  }
}

错误码

HTTP status code错误码错误信息描述
400InvalidSecurityGroupId.MalformedThe specified parameter SecurityGroupId is essential and size should less than 10参数 SecurityGroupId 不能为空,且要查询的个数不能大于 10 个。
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.提供的RegionId不存在
404InvalidSecurityGroupId.NotFoundThe SecurityGroupId provided does not exist in our records.指定的安全组在该用户账号下不存在,请您检查安全组 ID 是否正确。

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

变更历史

变更时间变更内容概要操作
暂无变更历史