Skip to main content

ModifySecurityGroupRule

Description

call ModifySecurityGroupRule to modify the description information of the security group entry direction rule. This interface can only modify the description information. If you need to modify the policy, port range, authorization object and other information of the security group rule, please modify it in the ECS management console.

Request Method

POST

Request Path

/apsara/route/Ecs/ModifySecurityGroupRule

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
SourceGroupIdBODYstringNosg-bp67acfmxazb4p****the source security group ID for setting access rights. SourceGroupId or SourceCidrIp parameters must be set. if the specified SourceGroupId does not specify the parameter SourceCidrIp, the parameter NicType value can only be intranet. If both SourceGroupId and SourceCidrIp are specified, the SourceCidrIp shall prevail by default.
PolicyBODYstringNoacceptaccess rights. Value range: accept: Accept access drop: deny access, do not return denial information default value: accept.
DescriptionBODYstringNoThis is a new security group rule.description information of security group rules. The length is 1~512 characters.
SourcePortRangeBODYstringNo80/80the port range related to the transport layer protocol open by the source security group. Value range: TCP/UDP protocol: the value range is 1~65535. Use a slash (/) to separate the start and end ports. Correct demonstration: 1/200; Error demonstration: 200/1 ICMP protocol:-1/-1 GRE protocol:-1/-1 all:-1/-1
PriorityBODYstringNo1security group rule priority. Value range: 1~100 default value: 1.
SecurityGroupIdBODYstringYessg-bp67acfmxazb4p****target security group ID.
SourceGroupOwnerIdBODYlongNo12345678910When setting security group rules across accounts, the ID of the Alibaba Cloud account to which the source security group belongs. if the SourceGroupOwnerId and SourceGroupOwnerAccount are not set, it is considered to set the access rights of your other security groups. if you have set the parameter SourceCidrIp, the parameter SourceGroupOwnerId is invalid.
Ipv6SourceCidrIpBODYstringNo2001:db8:1233:1a00::***source IPv6 CIDR address segment. Supports IP address ranges in CIDR format and IPv6 format. Description Only VPC IP addresses are supported. Default value: None.
NicTypeBODYstringNointranetthe network card type of the classic network type security group rule. Value range: internet: public network intranet: intranet default value: internet. In the following cases, the parameter NicType value can only be intranet: When the network type of the security group rule is VPC, you do not need to set the NicType parameter. By default, it can only be intranet. when mutual access between security groups is set, that is, when the DestGroupId is specified and no DestCidrIp is specified.
versionBODYstringNo2016-01-01version of api
PortRangeBODYstringYes80/80the port range related to the transport layer protocol open by the destination security group. Value range: TCP/UDP protocol: the value range is 1~65535. Use a slash (/) to separate the start and end ports. Correct demonstration: 1/200; Error demonstration: 200/1 ICMP protocol:-1/-1 GRE protocol:-1/-1 all:-1/-1
regionIdBODYstringYesNo sample value for this parameter.region id
SourceCidrIpBODYstringNo10.0.0.0/8source IP address range. CIDR format and IPv4 format are supported for IP address ranges. default value: 0.0.0.0/0.
IpProtocolBODYstringYesalltransport layer protocol. Case insensitive. Value range: icmp icmpv6 gre tcp udp all: supports all protocols
DestCidrIpBODYstringNo10.0.0.0/8destination IP address range. CIDR format and IPv4 format are supported for IP address ranges. default value: 0.0.0.0/0.
RegionIdBODYstringYescn-qingdao-env17-d01the region ID of the target security group. You can call the DescribeRegions to view the latest Alibaba Cloud region list.
SourceGroupOwnerAccountBODYstringNoTest@aliyun.comWhen setting security group rules across accounts, the Alibaba Cloud account to which the source security group belongs. if the SourceGroupOwnerAccount and SourceGroupOwnerID are not set, it is considered to set the access rights of your other security groups. if the parameter SourceCidrIp has been set, the parameter SourceGroupOwnerAccount is invalid.
Ipv6DestCidrIpBODYstringNo2001:db8:1234:1a00::***destination IPv6 CIDR address segment. Supports IP address ranges in CIDR format and IPv6 format. Description Only VPC IP addresses are supported. Default value: None.
ClientTokenBODYstringNo123e4567-e89b-12d3-a456-426655440000Ensure request idempotence. Generate a parameter value from your client to ensure that the parameter value is unique between different requests. ClientToken only supports ASCII characters and cannot exceed 64 characters. For more details, please refer to the section on how to ensure idempotence in the cloud server ECS development guide.

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}