DeleteSecurityGroup - 刪除安全性群組
本介面用於刪除一個安全性群組,並關聯刪除群組內所有安全性群組規則。
介面說明
請確保安全性群組內不存在 ECS 執行個體,您可以通過 DescribeInstances 進行查詢。
請確保安全性群組內不存在彈性網卡,您可以通過 DescribeNetworkInterfaces 進行查詢。
請確保沒有其他安全性群組與該安全性群組有授權行為,您可以通過 DescribeSecurityGroupReferences 進行查詢。
在您使用該介面刪除安全性群組時若返回錯誤碼
InvalidOperation.DeletionProtection,說明開啟了刪除保護功能。建立 ACK 叢集時,關聯的安全性群組會開啟刪除保護功能,來防止誤刪除。刪除保護功能無法手動關閉,只有在刪除了關聯的 ACK 叢集後,才能夠自動關閉。更多資訊,請參見關閉安全性群組刪除保護。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:DeleteSecurityGroup |
delete |
*SecurityGroup
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
地區 ID。您可以調用 DescribeRegions 查看最新的阿里雲地區列表。 |
cn-hangzhou |
| SecurityGroupId |
string |
是 |
安全性群組 ID。您可以調用 DescribeSecurityGroups 查看安全性群組 ID。 |
sg-bp1fg655nh68xyz9**** |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | MissingParameter.RegionId | The parameter "RegionId" should not be null. | |
| 401 | InvalidOperation.SecurityGroupNotAuthorized | The specified security group is not authorized to operate. | 沒有許可權操作當前安全性群組 |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | DependencyViolation | There is still instance(s) in the specified security group. | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | 雲產品託管的安全性群組不支援修改操作。 |
| 404 | InvalidSecurityGroup.NotFound | The specified security group is not found. | 找不到指定的安全性群組 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。