Mengubah aturan grup keamanan arah keluar.
Deskripsi operasi
Saat Anda mengubah aturan grup keamanan dengan menentukan ID aturan grup keamanan, perhatikan batasan berikut:
Objek otorisasi aturan grup keamanan dapat berupa blok Classless Inter-Domain Routing (CIDR) IPv4 (atau alamat IP), blok CIDR IPv6 (atau alamat IP), grup keamanan, atau daftar awalan. Anda tidak dapat menggunakan operasi ini untuk mengubah tipe objek otorisasi dari aturan grup keamanan yang ada. Misalnya, jika tipe objek otorisasi asli adalah blok CIDR IPv4, Anda dapat mengubahnya ke blok CIDR IPv4 lain (atau alamat IP), tetapi tidak dapat mengubahnya ke blok CIDR IPv6 (atau alamat IP), grup keamanan, atau daftar awalan.
Anda tidak dapat mengubah nilai bidang dari nilai tidak kosong menjadi nilai kosong. Untuk mengubah aturan grup keamanan dalam kasus ini, tambahkan aturan baru lalu hapus aturan saat ini.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifySecurityGroupEgressRule |
update |
*全部资源
|
|
None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah grup keamanan sumber. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| RegionId |
string |
Yes |
ID wilayah grup keamanan sumber. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| ClientToken |
string |
No |
Token klien yang digunakan untuk memastikan idempotensi permintaan. Anda dapat menggunakan klien untuk menghasilkan token, tetapi pastikan token tersebut unik di antara permintaan yang berbeda. Nilai ClientToken hanya dapat berisi karakter ASCII dan panjangnya tidak boleh melebihi 64 karakter. Untuk informasi selengkapnya, lihat Cara memastikan idempotensi. |
123e4567-e89b-12d3-a456-426655440000 |
| SecurityGroupId |
string |
Yes |
ID grup keamanan. |
sg-bp67acfmxazb4p**** |
| SecurityGroupRuleId |
string |
No |
ID aturan grup keamanan. Anda dapat memanggil DescribeSecurityGroupAttribute untuk mengkueri ID aturan grup keamanan. |
sgr-bp67acfmxazb4q**** |
| Policy |
string |
No |
Izin akses. Nilai valid:
Nilai default: accept. |
accept |
| Priority |
string |
No |
Prioritas aturan grup keamanan. Nilai valid: 1 hingga 100. Nilai default: 1. |
1 |
| IpProtocol |
string |
No |
Protokol lapisan jaringan atau lapisan transport. Dua tipe nilai didukung:
|
tcp |
| DestCidrIp |
string |
No |
Blok Classless Inter-Domain Routing (CIDR) IPv4 tujuan. Format CIDR dan range alamat IP format IPv4 didukung. Nilai default: null. |
10.0.0.0/8 |
| Ipv6DestCidrIp |
string |
No |
Blok Classless Inter-Domain Routing (CIDR) IPv6 tujuan. Format CIDR dan range alamat IP format IPv6 didukung. Catatan
Hanya alamat IP tipe VPC yang didukung. Parameter ini dan Nilai default: null. |
2001:db8:1233:1a00::*** |
| DestGroupId |
string |
No |
ID grup keamanan tujuan yang ingin Anda berikan izin akses. Tentukan setidaknya satu dari
|
sg-bp67acfmxa123b**** |
| DestPrefixListId |
string |
No |
ID daftar awalan tujuan. Anda dapat memanggil DescribePrefixLists untuk mengkueri ID daftar awalan yang tersedia. Parameter ini diabaikan jika Anda menentukan salah satu dari |
pl-x1j1k5ykzqlixdcy**** |
| PortRange |
string |
No |
Rentang port tujuan yang sesuai dengan protokol lapisan transport. Nilai valid:
|
80/80 |
| SourceCidrIp |
string |
No |
Blok Classless Inter-Domain Routing (CIDR) IPv4 sumber. Format CIDR dan range alamat IP format IPv4 didukung. Nilai default: null. |
10.0.0.0/8 |
| Ipv6SourceCidrIp |
string |
No |
Blok Classless Inter-Domain Routing (CIDR) IPv6 sumber. Format CIDR dan range alamat IP format IPv6 didukung. Catatan
Hanya alamat IP tipe VPC yang didukung. Parameter ini dan Nilai default: null. |
2001:db8:1234:1a00::*** |
| SourcePortRange |
string |
No |
Rentang port sumber yang sesuai dengan protokol lapisan transport. Nilai valid:
|
80/80 |
| DestGroupOwnerAccount |
string |
No |
Akun Alibaba Cloud yang memiliki grup keamanan tujuan saat Anda mengatur aturan grup keamanan lintas akun. |
EcsforCloud@Alibaba.com |
| DestGroupOwnerId |
integer |
No |
ID akun Alibaba Cloud yang memiliki grup keamanan tujuan saat Anda mengatur aturan grup keamanan lintas akun. |
1234567890 |
| NicType |
string |
No |
Tipe antarmuka jaringan. Catatan
Saat Anda mengubah aturan dengan menentukan ID aturan grup keamanan, parameter ini tidak dapat diubah. Untuk melakukan perubahan tersebut, tambahkan aturan baru lalu hapus aturan saat ini. |
intranet |
| Description |
string |
No |
Deskripsi aturan grup keamanan. Deskripsi harus memiliki panjang 1 hingga 512 karakter. |
This is a new securitygroup rule. |
| PortRangeListId |
string |
No |
ID buku alamat Port.
Anda dapat memanggil Parameter ini diabaikan jika Anda menentukan parameter PortRange. Untuk informasi selengkapnya, lihat Batas grup keamanan. |
prl-2ze9743**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Contoh
Respons sukses
JSONformat
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | OperationDenied | The specified IpProtocol does not exist or IpProtocol and PortRange do not match. | |
| 400 | InvalidIpProtocol.Malformed | The specified parameter PortRange is not valid. | |
| 400 | InvalidDestCidrIp.Malformed | The specified parameter DestCidrIp is not valid. | |
| 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 | InvalidDestGroupId.Mismatch | Specified security group and destination group are not in the same VPC. | |
| 400 | InvalidDestGroup.NotFound | Specified destination security group does not exist. | |
| 400 | InvalidPriority.Malformed | The specified parameter Priority is not valid. | |
| 400 | InvalidPriority.ValueNotSupported | The specified Priority is invalid. | |
| 400 | InvalidSecurityGroupDiscription.Malformed | The specified security group rule description is not valid. | |
| 400 | InvalidSecurityGroup.InvalidNetworkType | The specified security group network type is not support this operation, please check the security group network types. For VPC security groups, ClassicLink must be enabled. | |
| 400 | MissingParameter.Dest | One of the parameters DestCidrIp, DestGroupId or DestPrefixListId must be specified. | |
| 400 | InvalidParam.PortRange | The specified parameter %s is not valid. It should be two integers less than 65535 in ?/? format. | |
| 400 | InvalidIpProtocol.ValueNotSupported | The specified parameter IpProtocol should not be null and only tcp, udp, icmp, gre or all is supported. Ignore case. | |
| 400 | InvalidParam.SourceIp | The Parameters SourceCidrIp and Ipv6SourceCidrIp in %s cannot be set at the same time. | |
| 400 | InvalidParam.DestIp | The Parameters DestCidrIp and Ipv6DestCidrIp in %s cannot be set at the same time. | |
| 400 | InvalidParam.Ipv6DestCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidParam.Ipv6SourceCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidParam.Ipv4ProtocolConflictWithIpv6Address | IPv6 address cannot be specified for IPv4-specific protocol. | |
| 400 | InvalidParam.Ipv6ProtocolConflictWithIpv4Address | IPv4 address cannot be specified for IPv6-specific protocol. | |
| 400 | InvalidParameter.Ipv6CidrIp | The specified Ipv6CidrIp is not valid. | |
| 400 | InvalidSourcePortRange.Malformed | The specified parameter SourcePortRange is not valid. | |
| 400 | InvalidParam.SourceCidrIp | The specified param SourceCidrIp is not valid. | |
| 400 | InvalidParam.DestCidrIp | The specified param DestCidrIp is not valid. | |
| 400 | InvalidParameter.Conflict | IPv6 and IPv4 addresses cannot exist at the same time. | |
| 400 | InvalidParam.SecurityGroupRuleId | The specified parameter SecurityGroupRuleId is not valid. | |
| 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 | InvalidPrefixListId.NotFound | The specified prefix list was not found. | |
| 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. | |
| 400 | InvalidParamter.Conflict | The specified SourceCidrIp should be different from the DestCidrIp. | |
| 400 | InvalidOperation.RuleDuplicate | %s. | |
| 400 | InvalidParam.ProtocolNotSupportPortRangeList | The specified protocol does not support the port range list. | |
| 400 | InvalidSourceOrDestGroupId.DirectionMissmatch | The specified SourceGroupId or DestGroupId does not match the direction of the rule. | |
| 400 | InvalidOperation.ModifyPortRangeType | The PortRange type is not allowed to be modified. You cannot modify a rule from using the port list to not using it, and vice versa. | |
| 400 | InvalidPortRangeListId.NotFound | The specified port range list was not found. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | InvalidDestGroupId.Mismatch | NicType is required or NicType expects intranet. | |
| 403 | MissingParameter | The input parameter DestGroupId or DestCidrIp cannot be both blank. | |
| 403 | AuthorizationLimitExceed | The limit of authorization records in the security group reaches. | |
| 403 | InvalidParamter.Conflict | The specified SecurityGroupId should be different from the SourceGroupId. | |
| 403 | InvalidNetworkType.Conflict | The specified SecurityGroup network type should be same with SourceGroup network type (vpc or classic). | |
| 403 | InvalidSecurityGroup.IsSame | The authorized SecurityGroupId should be different from the DestGroupId. | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | |
| 404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | |
| 404 | InvalidDestGroupId.NotFound | The DestGroupId provided does not exist in our records. | |
| 404 | SecurityGroupRule.NotFound | The target security group rule do not exist. | |
| 404 | InvalidPrefixListId.NotFound | The specified prefix list was not found. | |
| 404 | InvalidSecurityGroupRuleId.NotFound | The specified SecurityGroupRuleId is not exists. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.