閱讀880 返回首頁    go 魔獸


撤銷出方向安全組規則__安全組相關接口_API 參考_雲服務器 ECS-阿裏雲

撤銷安全組Out方向的訪問規則

描述

撤銷安全組出方向的訪問規則。支持兩種方式:一是本Region(經典網絡)/本VPC(VPC)內采用指定協議通過指定端口訪問其他安全組;二是采用指定協議通過指定端口訪問IP地址範圍,隻有調用授權接口授權的權限條目才可以刪除(參數值跟授權時的參數相同)。

安全組規則由兩組可選參數中的一組組成:DestGroupOwnerAccountDestGroupIdIpProtocolPortRangeNicTypePolicy或者DestCidrIpIpProtocolPortRangeNicTypePolicy。如匹配的規則找不到將會報錯。

請求參數

名稱 類型 是否必須 描述
Action String 係統規定參數,取值:RevokeSecurityGroupEgress
SecurityGroupId String 源安全組ID
RegionId String 源安全組所屬Region ID
IpProtocol String IP協議,取值:tcp | udp | icmp | gre | all;
all表示同時支持四種協議
PortRange String IP協議相關的端口號範圍
  • 協議為tcp、udp時默認端口號,取值範圍為1~65535;例如“1/200”意思是端口號範圍為1~200,若輸入值為:“200/1”接口調用將報錯。
  • 協議為icmp時端口號範圍值為-1/-1;
  • gre協議時端口號範圍值為-1/-1;
  • 協議為all時端口號範圍值為-1/-1
DestGroupId String 授權同一Region內的目標安全組,SourceGroupId或者SourceCidrIp參數必須設置一項,如果兩項都設置,則默認對SourceCidrIp授權。可以同時指定多個Group(最多10個),但必須采用逗號“,”分隔
DestGroupOwnerAccount String 希望跨用戶撤銷安全組規則的目標安全組所屬用戶阿裏雲賬號。該參數可選,如果該參數及DestGroupOwnerId均未設置,則默認為同一賬戶安全組間撤銷。DestCidrIp如果已經被設置,則該參數無效。
DestGroupOwnerId String 跨用戶安全組授權時,目標安全組所屬用戶阿裏雲賬號ID。該參數可選,如果該參數及DestGroupOwnerAccount均未設置,則默認為同一賬戶安全組間授權。DestCidrIp如果已經被設置,則該參數無效。
DestCidrIp String 授權的目標IP地址範圍,必須采用CIDR格式來指定IP地址範圍,默認值為0.0.0.0/0(表示不受限製),其他支持的格式如10.159.6.18/12。僅支持IPV4。
Policy String 授權策略,參數值可為:accept(接受訪問),drop (拒絕訪問)
默認值為:accept
NicType String 網絡類型,取值:
  • internet
  • intranet;
默認值為internet
當對安全組進行相互授權時(即指定了DestGroupId且沒有指定DestCidrIp),必須指定NicType為intranet

返回參數

全是公共返回參數,詳見公共返回參數

錯誤碼

錯誤代碼 描述 Http 狀態碼 語義
InvalidRegionId.NotFound The RegionId provided does not exist in our records. 404 指定的RegionId不存在
MissingParameter The input parameter “RegionId” that is mandatory for processing this request is not supplied. 400 RegionId參數未指定
InvalidSecurityGroupId.NotFound The SecurityGroupId provided does not exist in our records. 404 指定的SecurityGroupId不存在
MissingParameter The input parameter “SecurityGroupId” that is mandatory for processing this request is not supplied. 400 SecurityGroupId參數未指定
InvalidIpProtocol.ValueNotSupported The specified IpProtocol does not exist. 400 IpProtocol參數指定的值不支持
MissingParameter The input parameter “IpProtocol” that is mandatory for processing this request is not supplied. 400 IpProtocol參數未指定
InvalidPriority.Malformed The specified parameter “Priority” is not valid. 400 Priority參數格式不正確
InvalidIpPortRange.Malformed The specified parameter “PortRange” is not valid. 400 PortRange格式不正確
MissingParameter The input parameter “PortRange” that is mandatory for processing this request is not supplied. 400 PortRange參數未指定
InvalidDestGroupId.NotFound The DestGroupId provided does not exist in our records. 404 指定的DestGroupId不存在
InvalidDestGroupId.Mismatch NicType is required or NicType expects intrnet. 403 需要明確NicType參數或者NicType必須為intranet
InvalidDestCidrIp.Malformed The specified parameter “DestCidrIp” is not valid. 400 DestCidrIp參數格式不正確
MissingParameter The input parameter “DestGroupId” or “DestCidrIp” cannot be both blank. 400 DestGroupId或者DestCidrIp參數未指定
InvalidPolicy.Malformed The specified parameter “Policy” is not valid. 400 Policy參數格式不正確
InvalidNicType.ValueNotSupported The specified NicType does not exist. 400 NicType指定的值不支持
InvalidDestGroupId.Mismatch DestGroupOwnerAccount is required 403 指定的其他用戶的DestGroup但是沒有指定DestGroupOwnerUserAccount
InvalidDestGroupOwnerUserAccount.Mismatch The specified DestGroupId is not belong to the DestGroupOwnerAccount 403 指定的DestGroup不屬於DestGroupOwnerUserAccount指定的用戶

示例

請求示例

  • 授權對其他安全組的訪問權限
  1. https://ecs.aliyuncs.com/?Action=RevokeSecurityGroupEgress
  2. &SecurityGroupId=sg-94n63e80l
  3. &IpProtocol=all
  4. &DestGroupId=sg-94oi1r1bp
  5. &IpProtocol=tcp
  6. &PortRange=1/65535
  7. &<公共請求參數>
  • 授權對指定的IP地址範圍的訪問權限
  1. https://ecs.aliyuncs.com/?Action=RevokeSecurityGroupEgress
  2. &SecurityGroupId=sg-94n63e80l
  3. &IpProtocol=all
  4. &DestCidrIp=10.0.0.0/8
  5. &IpProtocol=tcp
  6. &PortRange=1/65535
  7. &<公共請求參數>

返回示例

XML格式

  1. <RevokeSecurityGroupEgressResponse>
  2. <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
  3. </RevokeSecurityGroupEgressResponse>

JSON格式

  1. {
  2. "RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
  3. }

最後更新:2016-12-12 16:38:03

  上一篇:go 授權出方向安全組權限__安全組相關接口_API 參考_雲服務器 ECS-阿裏雲
  下一篇:go 新建專有網絡__專有網絡相關接口_API 參考_雲服務器 ECS-阿裏雲