详情页标题前

阿里云ECS云服务器ModifySecurityGroupRule-云淘科技

详情页1

调用ModifySecurityGroupRule修改入方向安全组规则。

接口说明

安全组相关的API文档中,入方向流量的发起端为源端(Source),数据传输的接收端为目的端(Dest)。

在您指定安全组规则ID修改安全组规则时,您需要注意以下使用限制:

  • 安全组规则的授权对象分为CIDR地址块(或IP地址)、安全组、前缀列表三种类型。您不能通过该接口修改已有安全组规则的授权对象类型。如原来授权对象类型为IP地址,您可以更改为另一个IP地址或CIDR地址块,但不能修改为安全组或前缀列表。
  • 安全组规则授权对象的IP地址族不支持修改。如原安全组规则授权对象CIDR地址块为IPv4,您不能将其修改为IPv6的CIDR地址块。又如规则的授权对象为一个IPv4地址族的前缀列表,您不能将其修改为一个IPv6地址族的前缀列表。
  • 修改后的安全组规则不能与已有其它规则相同。
  • 字段不支持从非空修改为空,如果需要修改建议先增加一条新规则,再删除当前规则。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String ModifySecurityGroupRule

系统规定参数。取值:ModifySecurityGroupRule

RegionId String cn-hangzhou

目标安全组所属地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。

ClientToken String 123e4567-e89b-12d3-a456-426655440000

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符,且不能超过64个字符。更多信息,请参见如何保证幂等性。

SecurityGroupId String sg-bp67acfmxazb4p****

安全组ID。

SecurityGroupRuleId String sgr-bp67acfmxa123b***

安全组规则ID。

根据安全组规则ID修改规则时,该参数必填。

Policy String accept

访问权限。取值范围:

  • accept:接受访问。
  • drop:拒绝访问,不返回拒绝信息。

默认值:accept。

Priority String 1

安全组规则优先级。取值范围:1~100。

默认值:1。

IpProtocol String ALL

传输层协议。不区分大小写。取值范围:

  • ICMP
  • GRE
  • TCP
  • UDP
  • ALL:支持所有协议。
SourceCidrIp String 10.0.0.0/8

设置访问权限的源端IPv4 CIDR地址块。支持CIDR格式和IPv4格式的IP地址范围。

默认值:无。

Ipv6SourceCidrIp String 2001:db8:1233:1a00::***

设置访问权限的源端IPv6 CIDR地址块。支持CIDR格式和IPv6格式的IP地址范围。

说明 仅支持VPC类型的IP地址,且该参数与SourceCidrIp参数不可同时设置。

默认值:无。

SourceGroupId String sg-bp67acfmxa123b****

设置访问权限的源端安全组ID。至少设置一项SourceGroupId或者SourceCidrIp参数。

  • 如果指定了SourceGroupId没有指定参数SourceCidrIp,则参数NicType取值只能为intranet。
  • 如果同时指定了SourceGroupIdSourceCidrIp,则默认以SourceCidrIp为准。
SourcePrefixListId String pl-x1j1k5ykzqlixdcy****

设置访问权限的源端前缀列表ID。您可以调用DescribePrefixLists查询可以使用的前缀列表ID。

当您指定了SourceCidrIpIpv6SourceCidrIpSourceGroupId参数中的一个时,将忽略该参数。

PortRange String 80/80

目的端安全组开放的传输层协议相关的端口范围。取值范围:

  • TCP/UDP协议:取值范围为1~65535。使用斜线(/)隔开起始端口和终止端口。例如:1/200。
  • ICMP协议:-1/-1。
  • GRE协议:-1/-1。
  • ALL:-1/-1。
DestCidrIp String 10.0.0.0/8

目的端IPv4 CIDR地址块。支持CIDR格式和IPv4格式的IP地址范围。

默认值:无。

Ipv6DestCidrIp String 2001:db8:1234:1a00::***

目的端IPv6 CIDR地址段。支持CIDR格式和IPv6格式的IP地址范围。

说明 仅支持VPC类型的IP地址,且该参数与DestCidrIp参数不可同时设置。

默认值:无。

SourcePortRange String 80/80

源端安全组开放的传输层协议相关的端口范围。取值范围:

  • TCP/UDP协议:取值范围为1~65535。使用斜线(/)隔开起始端口和终止端口。例如:1/200
  • ICMP协议:-1/-1。
  • GRE协议:-1/-1。
  • ALL:-1/-1。
SourceGroupOwnerAccount String EcsforCloud@Alibaba.com

跨账户设置安全组规则时,源端安全组所属的阿里云账户。

  • 如果SourceGroupOwnerAccountSourceGroupOwnerID均未设置,则认为是设置您其他安全组的访问权限。
  • 如果已经设置参数SourceCidrIp,则参数SourceGroupOwnerAccount无效。
SourceGroupOwnerId Long 12345678910

跨账户设置安全组规则时,源端安全组所属的阿里云账户。

  • 如果SourceGroupOwnerIdSourceGroupOwnerAccount均未设置,则认为是设置您其他安全组的访问权限。
  • 如果您已经设置参数SourceCidrIp,则参数SourceGroupOwnerId无效。
NicType String intranet

根据安全组规则ID修改规则时,不支持修改该参数。

如果需要修改,建议先增加一条新规则,再删除当前规则。

Description String This is a new security group rule.

安全组规则的描述信息。长度为1~512个字符。

返回数据

名称

类型

示例值

描述

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

请求ID。

示例

请求示例

https://ecs.aliyuncs.com/?Action=ModifySecurityGroupRule
&SecurityGroupId=sg-bp67acfmxazb4p****
&SecurityGroupRuleId=sgr-dcd43das****
&SourceCidrIp=10.0.0.0/8
&

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml


    CEF72CEB-54B6-4AE8-B225-F876FF7BA984

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}

错误码

HttpCode

错误码

错误信息

描述

400 OperationDenied The specified IpProtocol does not exist or IpProtocol and PortRange do not match. 指定的 IP 协议不存在,或与端口范围不匹配。
400 InvalidIpProtocol.Malformed The specified parameter PortRange is not valid. IP 协议参数格式不正确,PortRange 参数不正确。
400 InvalidSourceCidrIp.Malformed The specified parameter SourceCidrIp is not valid. 源 IP 地址范围参数格式不正确。
400 InvalidPolicy.Malformed The specified parameter Policy is not valid. 指定的参数无效,请您检查该参数是否正确。
400 InvalidNicType.ValueNotSupported The specified NicType does not exist. 指定的网络类型不存在,请您检查网络类型是否正确。
400 InvalidNicType.Mismatch The specified NicType conflicts with the authorization record. 指定的网卡类型与已有规则不匹配。
400 InvalidSourceGroupId.Mismatch Specified security group and source group are not in the same VPC. 指定的安全组和源安全组不在一个 VPC 内。
400 InvalidSourceGroup.NotFound Specified source security group does not exist. 指定的安全组入方向规则不存在,或相关参数缺失。
400 InvalidPriority.Malformed The parameter Priority is invalid. 指定的参数 Priority 无效。
400 InvalidPriority.ValueNotSupported The parameter Priority is invalid. 指定的参数 Priority 无效。
400 InvalidSecurityGroupDiscription.Malformed The specified security group rule description is not valid. 指定的安全组规则描述不合法。
400 InvalidParam.PortRange The specified parameter %s is not valid. It should be two integers less than 65535 in ?/? format. 端口范围不合法,应为斜线分隔两个整数的格式。
400 InvalidIpProtocol.ValueNotSupported The parameter IpProtocol must be specified with case insensitive TCP, UDP, ICMP, GRE or All. 协议类型只能是TCP、UDP、ICMP、GRE或者All。
400 InvalidParam.SourceIp The Parameters SourceCidrIp and Ipv6SourceCidrIp in %s cannot be set at the same time. 参数SourceCidrIp和Ipv6SourceCidrIp不能被同时设置。
400 InvalidParam.DestIp The Parameters DestCidrIp and Ipv6DestCidrIp in %s cannot be set at the same time. 参数DestCidrIp和Ipv6DestCidrIp不能被同时设置。
400 InvalidParam.Ipv6DestCidrIp The specified parameter %s is not valid. 指定的参数Ipv6DestCidrIp不合法。
400 InvalidParam.Ipv6SourceCidrIp The specified parameter %s is not valid. 指定的参数Ipv6SourceCidrIp不合法。
400 InvalidParam.Ipv4ProtocolConflictWithIpv6Address IPv6 address cannot be specified for IPv4-specific protocol. IPv4协议不能指定IPv6地址。
400 InvalidParam.Ipv6ProtocolConflictWithIpv4Address IPv4 address cannot be specified for IPv6-specific protocol. IPv6协议不能指定IPv4地址。
400 InvalidParameter.Ipv6CidrIp The specified Ipv6CidrIp is not valid. 指定的Ipv6CidrIp参数不合法。
400 InvalidParam.DestCidrIp The specified parameter %s is not valid. 指定的参数DestCidrIp不合法。
400 InvalidSourcePortRange.Malformed The specified parameter SourcePortRange is not valid. 指定的参数 SourcePortRange 无效。
400 InvalidSecurityGroupId.Malformed The specified parameter SecurityGroupId is not valid. 指定的参数 SecurityGroupId 无效。
400 InvalidParam.SourceCidrIp The specified param SourceCidrIp is not valid. 参数SourceCidrIp不合法。
400 InvalidParam.DestCidrIp The specified param DestCidrIp is not valid. 您指定的参数DestCidrIp不合法。
400 InvalidParameter.Conflict IPv6 and IPv4 addresses cannot exist at the same time. IPv6地址和IPv4地址不能同时指定。
400 InvalidParam.SecurityGroupRuleId The specified parameter SecurityGroupRuleId is not valid. 指定的参数SecurityGroupRuleId不合法。
400 InvalidOperation.ModifySgRuleEntityType The source or destination type of the rules cannot be modified. 规则的源或目的类型不能被修改。
400 AuthorizationLimitExceed The limit of authorization records in the security group reaches. 安全组授权规则数达到上限,请您检查授权规则是否合理。
400 InvalidParam.ProtocolAndPortRangeMismatch The specified Protocol and PortRange do not match. 指定和协议和端口范围不匹配。
400 InvalidParam.ProtocolAndAddressFamilyMismatch The specified Protocol and address family do not match. 指定的协议和地址族不匹配。
400 InvalidParam.PrefixListAddressFamilyMismatch The address family of the prefix list does not match the rule. 前缀列表的地址族与规则不匹配。
400 InvalidParam.InvalidModifyRuleRequest The request parameters are illegal. 请求参数不合法。
400 InvalidOperation.ModifyNicType NicType is not allowed to modify. 不允许修改NicType。
400 InvalidParamter.Conflict The specified SourceCidrIp should be different from the DestCidrIp. 参数 SourceCidrIp 和 DestCidrIp 不能相同。
400 InvalidIpProtocol.ValueNotSupported The parameter %s must be specified with case insensitive TCP, UDP, ICMP, GRE or All. 协议Protocol字段不合法,应指定大小写不敏感的TCP,UDP,ICMP,GRE或All。
403 InvalidSourceGroupId.Mismatch NicType is required or NicType expects intrnet. 需要明确IP段类型参数或者网络类型必须为内网。
403 MissingParameter The input parameter SourceGroupId or SourceCidrIp cannot be both blank. 至少指定一个参数 SourceGroupId 或 SourceCidrIp。
403 InvalidParamter.Conflict The specified SecurityGroupId should be different from the SourceGroupId. 授权与被授权安全组必须不同。
403 InvalidNetworkType.Mismatch The specified SecurityGroup network type should be same with SourceGroup network type (vpc or classic). 指定的 SecurityGroup 的网络类型必须与 SouceGroup 的网络类型一致。
403 InvalidOperation.ResourceManagedByCloudProduct %s 云产品托管的安全组不支持修改操作。
404 InvalidSecurityGroupId.NotFound The specified SecurityGroupId does not exist. 指定的安全组在该用户账号下不存在,请您检查安全组 ID 是否正确。
404 InvalidSourceGroupId.NotFound The SourceGroupId provided does not exist in our records. 指定的入方向安全组不存在。
404 SecurityGroupRule.NotFound The target security group rule not exist. 目标安全组规则不存在。
404 InvalidPrefixListId.NotFound The specified prefix list was not found. 前缀列表不存在。
404 InvalidSecurityGroupRuleId.NotFound The specified SecurityGroupRuleId is not exists. 指定的SecurityGroupRuleId不存在。
500 InternalError The request processing has failed due to some unknown error. 内部错误,请重试。

访问错误中心查看更多错误码。

腾讯云1折,限时活动,即将结束: 马上收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠

转转请注明出处:https://www.yunxiaoer.com/150545.html

(0)
上一篇 2023年12月9日
下一篇 2023年12月9日
详情页2

相关推荐

  • 阿里云大数据开发治理平台 DataWorksSearchMetaTables-云淘科技

    调用SearchMetaTables根据条件搜索表。 仅支持搜索MaxCompute和EMR两种类型的引擎表。 调试 您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。 请求参数 名称 类型 是否必选 示例值 描述 Action String 是 Searc…

  • 阿里云负载均衡TagResources – 给资源添加标签-云淘科技

    为指定的资源列表统一创建并绑定标签。 接口说明 说明 单个实例最多可绑定20条标签。绑定标签前,阿里云会校验资源已有标签数量,超过限制值会返回报错信息。调试您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。 调试调试授权信息下表是API对应的授权信息,可以在…

    阿里云负载均衡 2023年12月10日
  • 阿里云ECS云服务器DescribeImages-云淘科技

    调用DescribeImages查询您可以使用的镜像资源。 接口说明 您可以查询的镜像资源包括您的自定义镜像、阿里云提供的公共镜像、云市场镜像以及其他阿里云用户主动共享给您的共享镜像。 支持分页查询,查询结果包括可使用的镜像资源的总数和当前页的镜像资源。每页的数量默认为10条。 通过阿里云CLI调用API时,不同数据类型的请求参数取值必须遵循格式要求。更多信…

    阿里云服务器 2023年12月9日
  • 阿里云负载均衡LoadBalancerJoinSecurityGroup – 绑定安全组-云淘科技

    为网络型负载均衡实例绑定已创建的安全组。 接口说明 请确保您已创建安全组。创建安全组,请参见CreateSecurityGroup。 一个网络型负载均衡实例最多支持加入4个安全组。 您可以通过GetLoadBalancerAttribute接口查询实例绑定的安全组。 LoadBalancerJoinSecurityGroup属于异步接口,即系统返回一个请求I…

    阿里云负载均衡 2023年12月10日
  • 信息流广告,信息流部分建议宽度830px,只针对默认列表样式,顺序随机
  • 阿里云RDS数据库RevokeAccountPrivilege – 撤销账号对数据库的访问权限-云淘科技

    该接口用于撤销账号对数据库的访问权限。 接口说明 适用引擎 RDS MySQL RDS SQL Server RDS MariaDB 前提条件 实例状态为运行中。 数据库状态为运行中。 注意事项 具体撤销的权限包括SELECT、INSERT、UPDATE、DELETE、CREATE、DROP、REFERENCES、INDEX、ALTER、CREATE TEM…

    阿里云数据库 2023年12月9日

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信
本站为广大会员提供阿里云、腾讯云、华为云、百度云等一线大厂的购买,续费优惠,保证底价,买贵退差。