395
iPhone_iPad_Mac_手机_平板_苹果apple
授权出方向安全组权限__安全组相关接口_API 参考_云服务器 ECS-阿里云
描述
设定安全组Out方向的访问权限。
- 可支持的授权策略为:
accept
(接受访问),drop
(拒绝访问)。 - 可支持不同的网络类型,如
NicType
可选择internet
或intranet
,分别表示公网或内网。 - 单个安全组的授权规则最多为100条。
- 安全组的优先级根据创建的时间降序排序匹配。
- 组和组之间的授权只能在内网,即
NicType
只能选择intranet
。 - 规则优先级可选范围为1-100,默认值为1,即最高优先级。数字越大,代表优先级越低。
- 相同优先级的授权规则,授权策略为drop的规则优先。
- 安全组规则由两组可选参数中的一组组成:
DestGroupOwnerAccount
、DestGroupId
、IpProtocol
、PortRange
、NicType
、Policy
或者DestCidrIp
、IpProtocol
、PortRange
、NicType
、Policy
。如匹配的规则已存在将会报错。
支持两种授权方式: 1、开放对同一region内其他安全组(允许跨用户授权)的访问权限;2、开放对指定某IP地址范围(CIDR格式)的访问权限
请求参数
名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
Action | String | 是 | 系统规定参数,取值:AuthorizeSecurityGroupEgress |
SecurityGroupId | String | 是 | 源安全组编码 |
RegionId | String | 是 | 源安全组所属Region ID |
IpProtocol | String | 是 | IP协议,取值:tcp | udp | icmp | gre | all; all表示同时支持四种协议 |
PortRange | String | 是 | IP协议相关的端口号范围
|
DestGroupId | String | 否 | 同一Region内的目标安全组Id,DestGroupId或者DestCidrIp参数必须设置一项,如果两项都设置,则默认对DestCidrIp授权。如果指定了该字段且没有指定DestCidrIp,则NicType只能选择intranet |
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 |
Priority | String | 否 | 授权策略优先级,参数值可为:1-100 默认值为:1 |
NicType | String | 否 | 网络类型,取值:
当对安全组进行相互授权时(即指定了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参数未指定 |
OperationDenied | The specified IpProtocol does not exist or IpProtocol and PortRange do not match. | 400 | IP协议不存在或者IP协议和端口不匹配 |
MissingParameter | The input parameter “IpProtocol” that is mandatory for processing this request is not supplied. | 400 | IpProtocol参数未指定 |
InvalidIpProtocol.Malformed | The specified parameter “PortRange” is not valid. | 400 | IpProtocol参数格式不正确 |
InvalidPriority.Malformed | The specified parameter “Priority” is not valid. | 400 | Priority参数格式不正确 |
MissingParameter | The input parameter “PortRange” that is mandatory for processing this request is not supplied. | 400 | PortRange参数未指定 |
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. | 403 | DestGroupId或者DestCidrIp参数未指定 |
InvalidPolicy.Malformed | The specified parameter “Policy” is not valid. | 400 | Policy参数格式不正确 |
InvalidNicType.ValueNotSupported | The specified NicType does not exist. | 400 | NicType指定的值不支持 |
AuthorizationLimitExceed | The limit of Authorization in one security group reachs. | 403 | 安全组授权规则数达到上限 |
InvalidParamter.Conflict | The specified SecurityGroupId should be different from the DestGroupId. | 403 | SecurityGroupId和DestGroupId为同一个安全组 |
InvalidDestGroupId.Mismatch | DestGroupOwnerUserAccount is required. | 403 | 指定的其他用户的DestGroup但是没有指定DestGroupOwnerUserAccount |
InvalidDestGroupId.Mismatch | Specified security group and destination group are not in the same VPC. | 403 | 指定的安全组和目标安全组不属于同一个vpc |
InvalidDestGroupOwnerUserAccount.Mismatch | The specified DestGroupId is not belong to the DestGroupOwnerUserAccount | 403 | 指定的DestGroup不属于DestGroupOwnerUserAccount指定的用户 |
InvalidDestGroupId.NotFound | The DestGroupId provided does not exist in our records. | 404 | 指定的DestGroup未找到 |
示例
请求示例
- 配置对其他安全组的访问权限
https://ecs.aliyuncs.com/?Action=AuthorizeSecurityGroupEgress
&SecurityGroupId=sg-94n63e80l
&IpProtocol=all
&DestGroupId=sg-94oi1r1bp
&PortRange=1/65535
&<公共请求参数>
- 授权对指定的IP地址范围的访问权限
https://ecs.aliyuncs.com/?Action=AuthorizeSecurityGroupEgress
&SecurityGroupId=sg-94n63e80l
&IpProtocol=all
&DestCidrIp=10.0.0.0/8
&PortRange=1/65535
&<公共请求参数>
返回示例
XML
格式
<AuthorizeSecurityGroupEgressResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</AuthorizeSecurityGroupEgressResponse>
JSON
格式
{
"RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
最后更新:2016-11-23 17:16:02
上一篇:
撤销安全组规则__安全组相关接口_API 参考_云服务器 ECS-阿里云
下一篇:
撤销出方向安全组规则__安全组相关接口_API 参考_云服务器 ECS-阿里云
搜索文件__管理文件_控制台用户指南_对象存储 OSS-阿里云
创建RAM用户__快速入门_访问控制-阿里云
CreateVServerGroup__VServerGroup相关API_API 参考_负载均衡-阿里云
安卓版Google Authenticator安装及使用指导__附录2: Google Authenticator安装及使用指导_用户指南_访问控制-阿里云
DeleteTrail__实例相关接口_API参考_操作审计-阿里云
查看云服务器实例的监控信息__监控相关接口_API 参考_云服务器 ECS-阿里云
发布APP__快速开始_移动数据分析-阿里云
示例二__快速开始_Quick BI-阿里云
Encrypt__API 参考_密钥管理服务-阿里云
渠道专属API接口文档__渠道商问题_渠道合作伙伴_合作伙伴-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云