指定されたセキュリティグループから 1 つ以上のインバウンドセキュリティグループルールを削除します。
操作説明
-
セキュリティグループルール ID を指定してルールを削除する(推奨)。
指定されたセキュリティグループルール ID が存在しない場合、API 呼び出しは失敗します。
-
Permissions を指定してルールを削除する。
一致するセキュリティグループルールが存在しない場合、呼び出しは成功しますがルールは削除されません。
- インバウンドルールを識別するには、以下のパラメーターが必須です:
ソース設定: SourceCidrIp(IPv4 アドレス)、Ipv6SourceCidrIp(IPv6 アドレス)、SourcePrefixListId(プレフィックスリスト ID)、または SourceGroupId(ソースセキュリティグループ)のいずれかをセットします。
宛先ポート範囲: PortRange。
プロトコルの種類: IpProtocol。
アクセスポリシー: Policy。
セキュリティグループルール ID と Permissions を同時に指定することはできません。
リクエスト例
セキュリティグループルール ID を指定して削除する。
"SecurityGroupId":"sg-bp67acfmxazb4p****", // セキュリティグループ ID を指定します。
"SecurityGroupRuleId":["sgr-bpdfmk****","sgr-bpdfmg****"] // セキュリティグループルール ID を指定します。
IP アドレス範囲を指定して削除する。
"SecurityGroupId":"sg-bp67acfmxazb4p****",
"Permissions":[
{
"SourceCidrIp":"10.0.0.0/8", // ソース IP アドレス範囲を指定します。
"IpProtocol":"TCP", // プロトコルの種類を指定します。
"PortRange":"80/80", // 宛先ポート範囲を指定します。
"Policy":"accept" // アクセスポリシーを指定します。
}
]
別のセキュリティグループを指定して削除する。
"SecurityGroupId":"sg-bp67acfmxazb4p****",
"Permissions":[
{
"SourceGroupId":"sg-bp67acfmxa123b****", // ソースセキュリティグループ ID を指定します。
"IpProtocol":"TCP,"
"PortRange":"80/80",
"Policy":"accept"
]
}
プレフィックスリストを指定して削除する。
"SecurityGroupId":"sg-bp67acfmxazb4p****",
"Permissions":[
{
"SourcePrefixListId":pl-x1j1k5ykzqlixdcy****", // ソースプレフィックスリスト ID を指定します。
"IpProtocol":"TCP",
"PortRange":"80/80",
"Policy":"accept"
}
]
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:RevokeSecurityGroup |
delete |
*SecurityGroup
|
|
なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
セキュリティグループのリージョン ID。 DescribeRegions を呼び出して最新のリージョンリストをクエリできます。 |
cn-hangzhou |
| RegionId |
string |
必須 |
セキュリティグループのリージョン ID。 DescribeRegions を呼び出して最新のリージョンリストをクエリできます。 |
cn-hangzhou |
| ClientToken |
string |
任意 |
リクエストのべき等性を確保するために使用されるクライアントトークン。クライアントでトークンを生成できますが、異なるリクエスト間でトークンが一意であることを確認してください。ClientToken の値には ASCII 文字のみを含めることができ、長さは 64 文字を超えることはできません。詳細については、べき等性の確保方法 を参照してください。 |
123e4567-e89b-12d3-a456-426655440000 |
| ClientToken |
string |
任意 |
リクエストのべき等性を確保するために使用されるクライアントトークン。クライアントでトークンを生成できますが、異なるリクエスト間でトークンが一意であることを確認してください。ClientToken の値には ASCII 文字のみを含めることができ、長さは 64 文字を超えることはできません。詳細については、べき等性の確保方法 を参照してください。 |
123e4567-e89b-12d3-a456-426655440000 |
| SecurityGroupId |
string |
必須 |
セキュリティグループ ID。 |
sg-bp67acfmxazb4p**** |
| SecurityGroupId |
string |
必須 |
セキュリティグループ ID。 |
sg-bp67acfmxazb4p**** |
| SecurityGroupRuleId |
array |
任意 |
セキュリティグループルールの ID。配列の長さ: 0~100。 |
|
|
string |
任意 |
セキュリティグループルール ID。 説明
セキュリティグループルール ID を指定してルールを削除する場合、このパラメーターは必須です。 |
sgr-bp67acfmxa123b*** |
|
| Permissions |
array<object> |
任意 |
セキュリティグループルール。配列の長さ: 0~100。 |
|
|
object |
任意 |
セキュリティグループルール。 |
||
| Policy |
string |
任意 |
アクセス権限。有効な値:
デフォルト値: accept。 |
accept |
| Priority |
string |
任意 |
セキュリティグループルールの優先度。値が小さいほど優先度が高くなります。有効な値: 1~100。 デフォルト値: 1。 |
1 |
| IpProtocol |
string |
任意 |
プロトコルの種類。値は大文字と小文字を区別しません。有効な値:
|
TCP |
| SourceCidrIp |
string |
任意 |
アクセス権限を取り消すソース IPv4 CIDR ブロック。CIDR 初期化と IPv4 アドレス範囲がサポートされています。 |
10.0.0.0/8 |
| Ipv6SourceCidrIp |
string |
任意 |
アクセス権限を取り消すソース IPv6 CIDR ブロック。CIDR 初期化と IPv6 アドレス範囲がサポートされています。 説明
このパラメーターは、IPv6 をサポートする VPC タイプの ECS インスタンスにのみ有効です。このパラメーターと |
2001:db8:1234:1a00::*** |
| SourceGroupId |
string |
任意 |
アクセス権限を取り消すソースセキュリティグループの ID。
注意:
|
sg-bp67acfmxa123b**** |
| SourcePrefixListId |
string |
任意 |
アクセス権限を取り消すソースプレフィックスリストの ID。 DescribePrefixLists を呼び出して使用可能なプレフィックスリスト ID をクエリできます。 注意:
詳細については、セキュリティグループの使用制限 を参照してください。 |
pl-x1j1k5ykzqlixdcy**** |
| PortRange |
string |
任意 |
トランスポートレイヤープロトコルに対応する宛先ポート範囲。有効な値:
|
1/200 |
| DestCidrIp |
string |
任意 |
送信先 IPv4 CIDR ブロック。CIDR ブロックと IPv4 アドレス範囲がサポートされています。 このパラメーターは 5 タプルルールに使用されます。詳細については、セキュリティグループの 5 タプルルール を参照してください。 |
10.0.0.0/8 |
| Ipv6DestCidrIp |
string |
任意 |
送信先 IPv6 CIDR ブロック。CIDR ブロックと IPv6 アドレス範囲がサポートされています。 このパラメーターは 5 タプルルールに使用されます。詳細については、セキュリティグループの 5 タプルルール を参照してください。 説明
このパラメーターは、IPv6 をサポートする VPC タイプの ECS インスタンスにのみ有効です。このパラメーターと |
2001:db8:1233:1a00::*** |
| SourcePortRange |
string |
任意 |
トランスポートレイヤープロトコルに対応する送信元ポート範囲。有効な値:
このパラメーターは 5 タプルルールに使用されます。詳細については、セキュリティグループの 5 タプルルール を参照してください。 |
80/80 |
| SourceGroupOwnerAccount |
string |
任意 |
クロスアカウント権限付与セキュリティグループルールを取り消す際の、ソースセキュリティグループを所有する Alibaba Cloud アカウント。
|
Test@aliyun.com |
| SourceGroupOwnerId |
integer |
任意 |
クロスアカウント権限付与セキュリティグループルールを取り消す際の、ソースセキュリティグループを所有する Alibaba Cloud アカウントの ID。
|
12345678910 |
| NicType |
string |
任意 |
セキュリティグループルールのネットワークインターフェースコントローラー(NIC)タイプ。VPC タイプのセキュリティグループの場合、ネットワークタイプをセットする必要はありません。デフォルト値は intranet で、intranet のみがサポートされています。 説明
クラシックネットワーク特徴はオフラインになりました。詳細については、廃止のお知らせ を参照してください。クラシックネットワークタイプのセキュリティグループルールの場合、有効な値は以下のとおりです:
|
intranet |
| Description |
string |
任意 |
セキュリティグループルールの説明。説明は 1~512 文字である必要があります。 |
This is description. |
| PortRangeListId |
string |
任意 |
ポートリスト ID。
詳細については、セキュリティグループの使用制限 を参照してください。 |
prl-2ze9743**** |
Policy
deprecated
|
string |
任意 |
非推奨。 |
accept |
Priority
deprecated
|
string |
任意 |
非推奨。 |
1 |
IpProtocol
deprecated
|
string |
任意 |
非推奨。 |
ALL |
SourceCidrIp
deprecated
|
string |
任意 |
非推奨。 |
10.0.0.0/8 |
Ipv6SourceCidrIp
deprecated
|
string |
任意 |
非推奨。 |
2001:db8:1234:1a00::*** |
SourceGroupId
deprecated
|
string |
任意 |
非推奨。 |
sg-bp67acfmxa123b**** |
SourcePrefixListId
deprecated
|
string |
任意 |
非推奨。 |
pl-x1j1k5ykzqlixdcy**** |
PortRange
deprecated
|
string |
任意 |
非推奨。 |
1/200 |
DestCidrIp
deprecated
|
string |
任意 |
非推奨。 |
10.0.0.0/8 |
Ipv6DestCidrIp
deprecated
|
string |
任意 |
非推奨。 |
2001:db8:1233:1a00::*** |
SourcePortRange
deprecated
|
string |
任意 |
非推奨。 |
80/80 |
SourceGroupOwnerAccount
deprecated
|
string |
任意 |
非推奨。 |
Test@aliyun.com |
SourceGroupOwnerId
deprecated
|
integer |
任意 |
非推奨。 |
12345678910 |
NicType
deprecated
|
string |
任意 |
非推奨。 |
intranet |
Description
deprecated
|
string |
任意 |
非推奨。 |
This is description. |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| RequestId |
string |
リクエスト ID |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
例
成功レスポンス
JSONJSON
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InvalidSecurityGroupId.Malformed | The specified parameter SecurityGroupId is not valid. | |
| 400 | InvalidIpProtocol.ValueNotSupported | The parameter IpProtocol must be specified with case insensitive TCP, UDP, ICMP, GRE or All. | |
| 400 | InvalidIpPortRange.Malformed | The specified parameter PortRange is not valid. | |
| 400 | InvalidSourceCidrIp.Malformed | The specified parameter SourceCidrIp is not valid. | |
| 400 | MissingParameter | The input parameter SourceGroupId or SourceCidrIp cannot be both blank. | |
| 400 | InvalidPolicy.Malformed | The specified parameter %s is not valid. | |
| 400 | InvalidNicType.ValueNotSupported | The specified parameter %s is not valid. | |
| 400 | InvalidSourceGroupId.Mismatch | Specified security group and source group are not in the same VPC. | |
| 400 | MissingParameter.Source | One of the parameters SourceCidrIp, Ipv6SourceCidrIp, SourceGroupId or SourcePrefixListId in %s must be specified. | |
| 400 | InvalidParam.PortRange | The specified parameter %s is not valid. It should be two integers less than 65535 in ?/? format. | |
| 400 | InvalidPriority.Malformed | The parameter Priority is invalid. | |
| 400 | InvalidPriority.ValueNotSupported | The specified parameter %s is invalid. | |
| 400 | InvalidParamter.Conflict | The specified SecurityGroupId should be different from the SourceGroupId. | |
| 400 | InvalidDestCidrIp.Malformed | The specified parameter DestCidrIp is not valid. | |
| 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 | InvalidGroupAuthParameter.OperationDenied | The security group can not authorize to enterprise level security group. | |
| 400 | InvalidPortRange.Malformed | The specified parameter PortRange must set. | |
| 400 | InvalidSourcePortRange.Malformed | The specified parameter SourcePortRange is not valid. | |
| 400 | InvalidSecurityGroupDiscription.Malformed | The specified security group rule description is not valid. | |
| 400 | NotSupported.ClassicNetworkPrefixList | The prefix list is not supported when the network type of security group is classic. | |
| 400 | InvalidParam.SourceCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidParam.DestCidrIp | The specified parameter %s is not valid. | |
| 400 | InvalidParam.Permissions | The specified parameter Permissions cannot coexist with other parameters. | |
| 400 | InvalidParam.DuplicatePermissions | There are duplicate permissions in the specified parameter Permissions. | |
| 400 | InvalidSecurityGroupId.NotFound | The specified parameter SecurityGroupId is not valid. | |
| 400 | InvalidParam.SecurityGroupRuleId | The specified parameter SecurityGroupRuleId is not valid. | |
| 400 | InvalidParam.SecurityGroupRuleIdRepeated | The specified parameter SecurityGroupRuleId is repeated. | |
| 400 | InvalidGroupParameter.OperationDenied | The attributes Policy, SourceGroupId, DestGroupId of enterprise level security groups are not allowed to be set or modified. | |
| 400 | InvalidSecurityGroupRule.RuleNotExist | The specified rule does not exist. | |
| 400 | InvalidParam.ProtocolNotSupportPortRangeList | The specified protocol does not support the port range list. | |
| 400 | InvalidPortRangeListId.NotFound | The specified port range list was not found. | |
| 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. | |
| 401 | InvalidOperation.SecurityGroupNotAuthorized | The specified security group is not authorized to operate. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | InvalidNicType.Mismatch | The specified NicType conflicts with the authorization record. | |
| 403 | InvalidGroupAuthItem.NotFound | Specified group authorized item does not exist in our records. | |
| 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 | InvalidPrefixListId.NotFound | The specified prefix list was not found. | |
| 404 | InvalidSecurityGroupRuleId.NotFound | The specified SecurityGroupRuleId is not exists. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。