535
iPhone_iPad_Mac_手机_平板_苹果apple
撤销安全组规则__安全组相关接口_API 参考_云服务器 ECS-阿里云
撤销安全组授权规则
描述
撤销安全组的访问权限支持两种方式:一是撤销本Region内(经典网络)/本VPC内(VPC)其他安全组采用指定协议通过指定端口对本安全组的授权规则;二是撤销IP网段采用指定协议通过指定端口访问本安全组,只有调用授权接口授权的权限条目才可以删除。
安全组规则由两组可选参数中的一组组成:SourceGroupOwnerAccount
、SourceGroupId
、IpProtocol
、PortRange
、NicType
、Policy
或者SourceCidrIp
、IpProtocol
、PortRange
、NicType
、Policy
。如匹配的规则找不到将会报错。
RevokeSecurityGroup和RevokeSecurityGroupEgress的区别
这两个方法都是用来操作安全组规则的,但是有区别:
- RevokeSecurityGroup 是用来撤销“入方向”的安全组规则,也就是“In”方向上的规则;
- RevokeSecurityGroupEgress 是用来撤销“出方向”的安全组规则。
一般来说,前者的使用更多,您根据实际情况来选择一个方法即可。
类似的,AuthorizeSecurityGroup和AuthorizeSecurityGroupEgress也是这样,前者授权入方向的规则,后者授权出方向的规则。
请求参数
名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
Action | String | 是 | 系统规定参数,取值:RevokeSecurityGroup |
SecurityGroupId | String | 是 | 目标安全组ID |
RegionId | String | 是 | 目标安全组所属Region ID |
IpProtocol | String | 是 | IP协议,取值:tcp | udp | icmp | gre | all; all表示同时支持四种协议 |
PortRange | String | 是 | IP协议相关的端口号范围
|
SourceGroupId | String | 否 | 源安全组ID,SourceGroupId或者SourceCidrIp参数必须设置一项,如果两项都设置,则默认对SourceCidrIp授权。可以同时指定多个Group(最多10个),但必须采用逗号“,”分隔 |
SourceGroupOwnerAccount | String | 否 | 跨用户撤销安全组规则时,源安全组所属用户阿里云账号。该参数可选,如果该参数及SourceGroupOwnerID均未设置,则默认为同一账户安全组间撤销。SourceCidrIp如果已经被设置,则该参数无效。 |
SourceGroupOwnerID | String | 否 | 跨用户撤销安全组规则时,源安全组所属用户阿里云账号ID。该参数可选,如果该参数及SourceGroupOwnerAccount均未设置,则默认为同一账户安全组间撤销。SourceCidrIp如果已经被设置,则该参数无效。 |
SourceCidrIp | String | 否 | 源IP地址范围,必须采用CIDR格式来指定IP地址范围,默认值为0.0.0.0/0(表示不受限制),其他支持的格式如10.159.6.18/12。仅支持IPV4。 |
Policy | String | 否 | 授权策略,参数值可为:accept(接受访问),drop (拒绝访问) 默认值为:accept |
NicType | String | 否 | 网络类型,取值:
当对安全组进行相互授权时(即指定了SourceGroupId且没有指定SourceCidrIp),必须指定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参数未指定 |
InvalidSourceGroupId.NotFound | The SourceGroupId provided does not exist in our records. | 404 | 指定的SourceGroupId不存在 |
InvalidSourceGroupId.Mismatch | NicType is required or NicType expects intrnet. | 403 | 需要明确NicType参数或者NicType必须为intranet |
InvalidSourceCidrIp.Malformed | The specified parameter “SourceCidrIp” is not valid. | 400 | SourceCidrIp参数格式不正确 |
MissingParameter | The input parameter “SourceGroupId” or “SourceCidrIp” cannot be both blank. | 400 | SourceGroupId或者SourceCidrIp参数未指定 |
InvalidPolicy.Malformed | The specified parameter “Policy” is not valid. | 400 | Policy参数格式不正确 |
InvalidNicType.ValueNotSupported | The specified NicType does not exist. | 400 | NicType指定的值不支持 |
InvalidSourceGroupId.Mismatch | SourceGroupOwnerAccount is required | 403 | 指定的其他用户的SourceGroup但是没有指定SourceGroupOwnerUserAccount |
InvalidSourceGroupOwnerUserAccount.Mismatch | The specified SourceGroupId is not belong to the SourceGroupOwnerAccount | 403 | 指定的SourceGroup不属于SourceGroupOwnerUserAccount指定的用户 |
示例
请求示例
https://ecs.aliyuncs.com/?Action=RevokeSecurityGroup
&SecurityGroupId=C0003E8B-B930-4F59-ADC0-0E209A9012B0
&SourceGroupId=sg-F876FF7BA
&SourceGroupOwnerAccount=test@aliyun.com
&IpProtocol=tcp
&PortRange=1/65535
&<公共请求参数>
返回示例
XML
格式
<RevokeSecurityGroupResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</RevokeSecurityGroupResponse>
JSON
格式
{
"RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
最后更新:2016-12-12 16:37:09
上一篇:
授权安全组权限__安全组相关接口_API 参考_云服务器 ECS-阿里云
下一篇:
授权出方向安全组权限__安全组相关接口_API 参考_云服务器 ECS-阿里云
队列模型名词解释__产品名词解释_产品简介_消息服务-阿里云
网站存在病毒如何处理?___安全问题_技术分享_云虚机主机-阿里云
创建数据订阅通道__快速入门_数据传输-阿里云
数据准备__基础示例—完整数据开发_场景教程_大数据开发套件-阿里云
添加删除用户__快速开始_大数据计算服务-阿里云
下载__Java SDK_SDK使用手册_消息服务-阿里云
ExecutionPlanInstance__数据类型_API参考_E-MapReduce-阿里云
子账号授权准备__日志管理使用帮助_控制台使用帮助_消息服务-阿里云
中文和时间__Python-SDK_SDK 参考_对象存储 OSS-阿里云
OSS API 文档简介__API 参考_对象存储 OSS-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云