You need to enable JavaScript to run this app.
文档中心
私有网络

私有网络

复制全文
下载 pdf
安全组
AuthorizeSecurityGroupEgress - 增加安全组出方向规则
复制全文
下载 pdf
AuthorizeSecurityGroupEgress - 增加安全组出方向规则
调用 AuthorizeSecurityGroupEgress 接口,为安全组添加一条出方向规则。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:AuthorizeSecurityGroupEgress​
接口名称。当前 API 的名称为AuthorizeSecurityGroupEgress。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为 2020-04-01。​
​
SecurityGroupId String 必选 示例值:sg-bp67acfmxazb4p****​
安全组ID。​
您可以调用 DescribeSecurityGroups 接口,查询安全组的ID。​
​
Protocol String 必选 示例值:all​
协议类型。取值如下:​
  • tcp:TCP协议。​
  • udp:UDP协议。​
  • icmp:ICMP协议。​
  • icmpv6:ICMPV6协议。​
  • gre:GRE协议。​
  • all:支持所有协议。​
​
PortStart Integer 必选 示例值:22​
目的端口范围开始值。​
  • 当Protocol 传入tcp或udp时,取值范围为1~65535。​
  • 当Protocol 传入icmp、icmpv6或all时,仅支持传入-1,表示不限制端口。​
​
PortEnd Integer 必选 示例值:22​
目的端口范围结束值。​
  • 当Protocol 传入tcp或udp时,取值范围为1~65535。​
  • 当Protocol 传入icmp、icmpv6或all时,仅支持传入-1,表示不限制端口。​
​
CidrIp String 可选 示例值:10.XX.XX.0/8​
目的地址的IPv4 CIDR或IPv6 CIDR。​
说明​
参数CidrIp、SourceGroupId和 PrefixListId,三者必须传入一个。若传入多个,仅生效一个,生效的优先级为CidrIp > SourceGroupId > PrefixListId。​
​
SourceGroupId String 可选 示例值:sg-bp67acfmxazb4p****​
目的地址安全组ID。即该安全组中的所有网卡的地址作为目的地址。​
说明​
参数CidrIp、SourceGroupId和 PrefixListId,三者必须传入一个。若传入多个,仅生效一个,生效的优先级为CidrIp > SourceGroupId > PrefixListId。​
​
PrefixListId String 可选 示例值:pl-bp1fg655nh68xyz9****​
目的地址前缀列表的ID。即前缀列表中的CIDR均为目的地址。​
您可以调用 DescribePrefixLists 接口,查询前缀列表的ID。​
说明​
  • 当前安全组还可添加出方向安全组规则的数量不小于前缀列表最大条目数。​
  • 参数CidrIp、SourceGroupId和 PrefixListId,三者必须传入一个。若传入多个,仅生效一个,生效的优先级为CidrIp > SourceGroupId > PrefixListId。​
​
Policy String 可选 示例值:accept​
访问策略。即安全组内的网卡访问CidrIp 、SourceGroupId 或 PrefixListId 对应的资源。​
  • accept(默认): 允许。​
  • drop:拒绝。​
​
Priority Integer 可选 示例值:1​
安全组规则优先级,数字越小,代表优先级越高。​
  • 取值范围:1 ~ 100​
  • 不填默认值:1​
​
Description String 可选 示例值:SG-Egress-1​
安全组规则的描述信息。​
  • 需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为1 ~ 255个字符。​
  • 不填默认为空字符串。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求幂等性。​
  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 仅支持ASCII字符,且不能超过64个字符。​
  • 若不传入ClientToken,则此次API调用不进行幂等校验。​
​
SourcePortStart Integer 可选 示例值:22​
源地址端口范围开始值。​
  • 当Protocol 传入tcp或udp时,取值范围为1~65535。​
  • 当Protocol 传入icmp、icmpv6或all时,仅支持传入-1,表示不限制端口。​
说明​
五元组安全组正在邀测中,如需试用,请联系客户经理。​
​
SourcePortEnd Integer 可选 示例值:22​
源地址端口范围结束值。​
  • 当Protocol 传入tcp或udp时,取值范围为1~65535。​
  • 当Protocol 传入icmp、icmpv6或all时,仅支持传入-1,表示不限制端口。​
说明​
五元组安全组正在邀测中,如需试用,请联系客户经理​
​
LocalCidrIp String 可选 示例值:192.169.1.0/28​
源地址的IPv4 CIDR或IPv6 CIDR。​
说明​
五元组安全组正在邀测中,如需试用,请联系客户经理​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:2021062415303301022514515207C4****​
请求ID。​
​
​
​
请求示例​
​
GET /?Action=AuthorizeSecurityGroupEgress&Version=2020-04-01&SecurityGroupId=sg-bp67acfmxazb4p****&Protocol=tcp&PortStart=22&PortEnd=22&CidrIp=10.XX.XX.0/8&Policy=accept&Priority=1 HTTP/1.1​
Host: vpc.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/vpc/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2021062415303301022514515207C4****",​
"Action": "AuthorizeSecurityGroupEgress",​
"Version": "2020-04-01",​
"Service": "vpc",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2021062415303301022514515207C4****"​
}​
}​
​
错误码​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InvalidCidr.AddressMismatch​
The network types of the specified source and destination CIDRs are different.​
指定的源和目标CIDR的网络类型不同。​
400​
InvalidCidr.Malformed​
The specified cidr block is malformed.​
指定的网段格式不合法。​
400​
InvalidCidr.ProtocolMismatch​
The specified cidr block mismatch the protocol type.​
指定的网段格式和协议类型不匹配。​
400​
InvalidDescription.Malformed​
The specified description is malformed.​
指定的描述格式不合法。请修复描述格式后重试。​
400​
InvalidDescription.Malformed​
The specified description is malformed. Ensure the maximum length of description is 255.​
指定的描述格式不合法。描述长度不能超过255个字符。​
400​
InvalidParameter.ClientTokenMalformed​
The specified parameter ClientToken is malformed.​
指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。​
400​
InvalidRouteCidr.Malformed​
The specified CIDR is malformed.​
指定的网段不合法。​
400​
InvalidSecurityGroup.InvalidStatus​
The specified security group is not in the correct status for the request.​
指定的安全组所处的状态无法响应该请求。​
400​
InvalidSecurityGroup.VpcMismatch​
The specified source security group is not in the specified VPC.​
指定的引用安全组不在指定的VPC中。​
400​
InvalidSecurityRule.InvalidSourceStatus​
The specified source security group is not in the correct status for the request.​
指定安全组规则对应的源安全组所处的状态无法响应该请求。​
400​
InvalidSecurityRule.Malformed​
The source address of specified security group rule is invalid. CIDR-only security group does not support security group as source address.​
指定安全组规则的源地址不合法。仅CIDR安全组不支持源地址为安全组。​
400​
InvalidSecurityRule.Malformed​
The source address of specified security group rule is invalid. CIDR-only security group is not supported as source address.​
指定安全组规则的源地址不合法。仅CIDR安全组不支持作为源地址。​
400​
InvalidSecurityRulePolicy.Malformed​
The specified security rule policy is malformed.​
指定的安全组规则的行为不合法。​
400​
InvalidSecurityRulePort.Malformed​
The specified security rule port is malformed.​
指定的安全组规则的端口不合法。​
400​
InvalidSecurityRulePriority.Malformed​
The specified security rule priority is malformed.​
指定的安全组规则的优先级不合法。​
400​
InvalidSecurityRuleProtocol.Malformed​
The specified security rule protocol is malformed.​
指定的安全组规则的协议不合法。​
400​
QuotaExceeded.PrefixListAssociation​
The number of resources a prefix list can be referenced by exceeded quota.​
前缀列表绑定的资源数量超过配额限制。​
400​
QuotaExceeded.SecurityGroupRule​
You've reached the limit on the number of egress security rules that you can create.​
已达到安全组可创建的出项规则的数量上限。​
400​
QuotaExceeded.SecurityGroupSecurityGroup​
The number of security groups bound to the security group exceeded quota.​
指定安全组已达到作为源端安全组的数量上限。​
403​
Forbidden​
You are not authorized to operate five tuple rule on the specified security group.​
无权限对指定的安全组操作五元组规则。​
403​
Forbidden​
You are not authorized to perform operations on the specified security group. The specified security group is a service-managed security group.​
无权限对指定安全组进行操作。指定的安全组为云产品托管的安全组。​
404​
InvalidPrefixList.NotFound​
The specified prefix list does not exist.​
指定的前缀列表不存在。​
404​
InvalidSecurityGroupId.NotFound​
The specified security group does not exist.​
指定的安全组不存在。​
409​
InvalidSecurityRule.Conflict​
The specified security rule conflicts with that of another security rule in your security group.​
指定的安全组规则与所属安全组下另一条规则冲突。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.07.10 10:11:05
这个页面对您有帮助吗?
有用
有用
无用
无用