全部產品
Search
文件中心

Elastic Compute Service:DescribeSecurityGroupReferences - 查詢被授權的安全性群組列表

更新時間:Apr 04, 2026

本介面用於查詢一個或多個指定安全性群組已經被授權的其他安全性群組列表資訊。

介面說明

  • 當您無法刪除某一安全性群組( DeleteSecurityGroup )時,可以調用該介面查看指定的安全性群組是否已被其他安全性群組授權。如果指定的安全性群組已被授權,您可以通過 RevokeSecurityGroupRevokeSecurityGroupEgress 刪除對應的安全性群組規則來解除授權行為。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ecs:DescribeSecurityGroupReferences

get

*SecurityGroup

acs:ecs:{#regionId}:{#accountId}:securitygroup/{#securitygroupId}

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

安全性群組所屬地區 ID。您可以調用 DescribeRegions 查看最新的阿里雲地區列表。

cn-hangzhou

SecurityGroupId

array

安全性群組 ID 數組。數組長度:0~10。

sg-bp14vtedjtobkvi****

string

安全性群組 ID。

sg-bp14vtedjtobkvi****

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

SecurityGroupReferences

object

SecurityGroupReference

array<object>

安全性群組和被授權的安全性群組資訊集合。

array<object>

安全性群組和被授權的安全性群組資訊。

SecurityGroupId

string

安全性群組 ID。

sg-bp67acfmxazb4p****

ReferencingSecurityGroups

object

ReferencingSecurityGroup

array<object>

正在授權給這個安全性群組的其他安全性群組資訊集合。

object

正在授權給這個安全性群組的其他安全性群組資訊。

SecurityGroupId

string

其他安全性群組 ID。

sg-bp67acfmxazb4j****

AliUid

string

其他安全性群組所屬使用者識別碼。

123456****

樣本

正常返回樣本

JSON格式

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

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidSecurityGroupId.Malformed The specified parameter SecurityGroupId is essential and size should less than 10 參數 SecurityGroupId 不可為空,且要查詢的個數不能大於 10 個。
404 InvalidRegionId.NotFound The RegionId provided does not exist in our records. 地區資訊錯誤
404 InvalidSecurityGroupId.NotFound The SecurityGroupId provided does not exist in our records. 指定的安全性群組在該使用者帳號下不存在,請您檢查安全性群組 ID 是否正確。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情