刪除一條安全性群組入方向規則,撤銷安全性群組出方向的使用權限設定。
描述
我們定義出方向流量的發起端為源端(Source),資料轉送的接收端為目的端(Destination)。更多詳情,請參閱 AuthorizeSecurityGroupEgress。
以下任意一組參數可以確定一條安全性群組入方向規則,只指定一個參數無法確定一條安全性群組規則。
-
撤銷指定 IP 地址段的使用權限設定:
IpProtocol、PortRange、(可選)SourcePortRange、NicType、Policy、DestCiderIp和 (可選)SourceCidrIp -
撤銷其他安全性群組的使用權限設定:
IpProtocol、PortRange、(可選)SourcePortRange、NicType、Policy、(可選)DestCiderIp、DestGroupOwnerAccount和DestGroupId
請求參數
| 名稱 | 類型 | 是否必需 | 描述 |
|---|---|---|---|
| Action | String | 是 | 系統規定參數。取值:RevokeSecurityGroup |
| RegionId | String | 是 | 目的端安全性群組所屬地域 ID。您可以調用 DescribeRegions 查看最新的阿里雲地域列表。 |
| SecurityGroupId | String | 是 | 目的端安全性群組 ID。 |
| IpProtocol | String | 是 | 傳輸層協議。參數值大小寫敏感。取值範圍:
|
| PortRange | String | 是 | 目的端安全性群組開放的傳輸層協議相關的通信埠範圍。取值範圍:
|
| SourcePortRange | String | 否 | 源端安全性群組開放的傳輸層協議相關的通信埠範圍。取值範圍:
|
| NicType | String | 否 | 網卡類型。取值範圍:
SourceGroupId 且沒有指定 SourceCidrIp 時,參數 NicType 取值只能為 intranet。 預設值:internet |
| Policy | String | 否 | 存取權限。取值範圍:
|
| DestCidrIp | String | 否 | 目的端 IP 位址範圍。支援 CIDR 格式和 IPv4 格式的 IP 位址範圍。預設值:0.0.0.0/0 |
| SourceCidrIp | String | 否 | 源端 IP 位址範圍。支援 CIDR 格式和 IPv4 格式的 IP 位址範圍。預設值:0.0.0.0/0 |
| SourceGroupId | String | 否 | 需要撤銷存取權限的源端安全性群組 ID。必須設定 SourceGroupId 或者 SourceCidrIp 參數。如果指定了 SourceGroupId 沒有指定參數 SourceCidrIp,則參數 NicType 取值只能為 intranet。如果同時指定了 SourceGroupId 和 SourceCidrIp,則預設以 SourceCidrIp 為準。 |
| SourceGroupOwnerAccount | String | 否 | 跨賬戶刪除安全性群組規則時,源端安全性群組所屬的阿里雲賬戶。
|
| SourceGroupOwnerId | String | 否 | 跨賬戶刪除安全性群組規則時,源端安全性群組所屬的阿里雲賬戶 ID。
|
| Priority | String | 否 | 安全性群組規則優先順序。取值範圍:[1, 100] 預設值:1 |
返回參數
全是公共返回參數。參閱 公共參數。
樣本
請求樣本
https://ecs.aliyuncs.com/?Action=RevokeSecurityGroup
&SecurityGroupId=C0003E8B-B930-4F59-ADC0-0E209A9012B0
&SourceGroupId=sg-F876FF7BA
&SourceGroupOwnerAccount=test@aliyun.com
&IpProtocol=tcp
&PortRange=1/65535
&Priority=1
&<公共請求參數>
返回樣本
XML 格式
<RevokeSecurityGroupResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</RevokeSecurityGroupResponse>
JSON 格式
{
"RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
錯誤碼
以下為本介面特有的錯誤碼。更多錯誤碼,請訪問 API 錯誤中心。
| 錯誤碼 | 錯誤資訊 | HTTP 狀態碼 | 說明 |
|---|---|---|---|
| InvalidIpPortRange.Malformed | The specified parameter “PortRange” is not valid. | 400 | 指定的 PortRange 不合法。 |
| InvalidIpProtocol.ValueNotSupported | The specified IpProtocol does not exist. | 400 | 指定的 IpProtocol不存在。 |
| InvalidNicType.ValueNotSupported | The specified NicType does not exist. | 400 | 指定的 NicType 不存在。 |
| InvalidPolicy.Malformed | The specified parameter “Policy” is not valid. | 400 | 指定的 Policy 不合法。 |
| InvalidSourceCidrIp.Malformed | The specified parameter “SourceCidrIp” is not valid. | 400 | 指定的 SourceCidrIp不合法。 |
| InvalidSourceGroupId.Mismatch | Specified security group and source group are not in the same VPC. | 400 | 指定安全性群組的網路類型是 VPC,目的端安全性群組必須在同一個 VPC 裡。 |
| MissingParameter | The input parameter “SourceGroupId” or “SourceCidrIp” cannot be both blank. | 400 | 必須指定參數 SourceGroupId 或者 SourceCidrIp。 |
| InvalidGroupAuthItem.NotFound | Specified group authorized item does not exist in our records. | 403 | 指定的安全性群組規則不存在。 |
| InvalidNicType.Mismatch | Specified nic type conflicts with the authorization record. | 403 | 指定的 NicType 與安全性群組規則不符合。 |
| InvalidRegionId.NotFound | The specified RegionId does not exist. | 404 | 指定的 RegionId 不存在。 |
| InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | 404 | 指定的 SecurityGroupId 不存在。 |
| InvalidSourceGroupId.NotFound | The SourceGroupId provided does not exist in our records. | 404 | 指定的 SourceGroupId 不存在。 |