Mengubah aturan grup keamanan arah masuk dari grup keamanan tertentu.
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:ModifySecurityGroupRule |
update |
*全部资源
|
|
None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah grup keamanan. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| RegionId |
string |
Yes |
ID wilayah grup keamanan. 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. Parameter ClientToken hanya mendukung karakter ASCII dan tidak boleh melebihi 64 karakter. Untuk informasi lebih lanjut, 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-bp67acfmxa123b*** |
| 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:
|
ALL |
| SourceCidrIp |
string |
No |
Pengaturan untuk blok CIDR IPv4 sumber untuk izin akses. Format Classless Inter-Domain Routing (CIDR) dan rentang alamat IP format IPv4 didukung. Nilai default: null. |
10.0.0.0/8 |
| Ipv6SourceCidrIp |
string |
No |
Pengaturan untuk blok CIDR IPv6 sumber untuk izin akses. Format Classless Inter-Domain Routing (CIDR) dan rentang alamat IP format IPv6 didukung. Catatan
Hanya alamat IP tipe VPC yang didukung. Parameter ini dan Nilai default: null. |
2001:db8:1233:1a00::*** |
| SourceGroupId |
string |
No |
Pengaturan untuk ID grup keamanan sumber untuk izin akses. Tentukan setidaknya satu dari
|
sg-bp67acfmxa123b**** |
| SourcePrefixListId |
string |
No |
Pengaturan untuk ID daftar awalan sumber untuk izin akses. 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 |
Range Port tujuan yang sesuai dengan protokol lapisan transport grup keamanan. Nilai valid:
|
80/80 |
| DestCidrIp |
string |
No |
Blok Classless Inter-Domain Routing (CIDR) IPv4 tujuan. Format CIDR dan rentang alamat IP format IPv4 didukung. Nilai default: null. |
10.0.0.0/8 |
| Ipv6DestCidrIp |
string |
No |
Pengaturan untuk blok CIDR IPv6 tujuan. Format Classless Inter-Domain Routing (CIDR) dan rentang 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 |
Range Port sumber yang sesuai dengan protokol lapisan transport grup keamanan. Nilai valid:
|
80/80 |
| SourceGroupOwnerAccount |
string |
No |
Pengaturan untuk akun Alibaba Cloud yang memiliki grup keamanan sumber saat Anda mengonfigurasi aturan grup keamanan lintas akun untuk izin akses.
|
EcsforCloud@Alibaba.com |
| SourceGroupOwnerId |
integer |
No |
Pengaturan untuk ID akun Alibaba Cloud yang memiliki grup keamanan sumber saat Anda mengonfigurasi aturan grup keamanan lintas akun untuk izin akses.
|
12345678910 |
| NicType |
string |
No |
Tipe pengontrol antarmuka jaringan (NIC). 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 security group rule. |
| PortRangeListId |
string |
No |
ID buku alamat Port. Anda dapat memanggil Parameter ini diabaikan jika Anda menentukan parameter PortRange. Untuk informasi lebih lanjut, 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 | InvalidSourceCidrIp.Malformed | The specified parameter SourceCidrIp 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 | InvalidSourceGroupId.Mismatch | Specified security group and source group are not in the same VPC. | |
| 400 | InvalidSourceGroup.NotFound | Specified source security group does not exist. | |
| 400 | InvalidPriority.Malformed | The parameter Priority is invalid. | |
| 400 | InvalidPriority.ValueNotSupported | The parameter Priority is invalid. | |
| 400 | InvalidSecurityGroupDiscription.Malformed | The specified security group rule description is not valid. | |
| 400 | MissingParameter.Source | One of the parameters SourceCidrIp, SourceGroupId or SourcePrefixListId 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 parameter IpProtocol must be specified with case insensitive TCP, UDP, ICMP, GRE or All. | |
| 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 | InvalidParam.DestCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidSourcePortRange.Malformed | The specified parameter SourcePortRange is not valid. | |
| 400 | InvalidSecurityGroupId.Malformed | The specified parameter SecurityGroupId is not valid. | |
| 400 | InvalidParam.SourceCidrIp | The specified param SourceCidrIp 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 | 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 | InvalidSourceGroupId.Mismatch | NicType is required or NicType expects intrnet. | |
| 403 | MissingParameter | The input parameter SourceGroupId or SourceCidrIp 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.Mismatch | The specified SecurityGroup network type should be same with SourceGroup network type (vpc or classic). | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | |
| 404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | |
| 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. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.