ECS インスタンスまたはエラスティックネットワークインターフェイスをセキュリティグループに追加します。
操作説明
この API は非推奨です。セキュリティグループへの ECS インスタンスの追加または削除には ModifyInstanceAttribute API の呼び出しを、セキュリティグループへのエラスティックネットワークインターフェイス (ENI) の追加または削除には ModifyNetworkInterfaceAttribute API の呼び出しを推奨します。
-
1 回の呼び出しで、インスタンスとエラスティックネットワークインターフェイスをセキュリティグループに追加することはできません。
InstanceIdパラメータとNetworkInterfaceIdパラメータは相互に排他的です。 -
セキュリティグループとインスタンスは、同じ Alibaba Cloud リージョンにある必要があります。
-
セキュリティグループとインスタンスのネットワークタイプは同じである必要があります。ネットワークタイプが VPC の場合、両者は同じ VPC に属している必要もあります。
-
インスタンスをセキュリティグループに追加できるのは、インスタンスが 停止済み または 実行中 の状態の場合に限られます。
-
インスタンスまたはエラスティックネットワークインターフェイスは、最大 5 つのセキュリティグループに所属できます。詳細については、「セキュリティグループの制限」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:JoinSecurityGroup |
update |
*Instance
*SecurityGroup
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| SecurityGroupId |
string |
必須 |
セキュリティグループ ID です。利用可能なセキュリティグループを確認するには、DescribeSecurityGroups API を呼び出します。 |
sg-bp67acfmxazb4p**** |
| InstanceId |
string |
任意 |
インスタンス ID です。 説明
このパラメーターを指定する場合、 |
i-bp67acfmxazb4p**** |
| NetworkInterfaceId |
string |
任意 |
エラスティックネットワークインターフェース ID です。 説明
このパラメーターを指定する場合、 |
eni-bp13kd656hxambfe**** |
| RegionId |
string |
任意 |
リージョン ID です。Alibaba Cloud の最新のリージョン一覧を確認するには、DescribeRegions API を呼び出します。
|
cn-hangzhou |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| RequestId |
string |
リクエスト ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
例
成功レスポンス
JSONJSON
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InstanceSecurityGroupLimitExceeded | Exceeding the allowed amount of security groups that an instance can be in. | |
| 400 | InvalidInstanceId.Mismatch | Specified instance and security group are not in the same VPC. | |
| 400 | InvalidInstanceId.Malformed | The specified parameter "InstanceId" is not valid. | |
| 400 | InvalidOperation.NotSupportEnterpriseGroup | The specified instance type doesn't support enterprise level security group. | |
| 400 | InvalidOperation.MultiGroupType | The specified instance can't join different types of security group. | |
| 400 | InvalidOperation.InvalidEniState | %s | |
| 400 | InvalidOperation.EniAndGroupNotBelongSameUser | %s | |
| 400 | NotBelongUser | %s | |
| 400 | MissingParameter.RegionId | The specified RegionId should not be null. | |
| 400 | InvalidStatus.EniOrInstanceIsBeingCreated | %s. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | |
| 403 | SecurityGroupInstanceLimitExceeded | The maximum number of instances in a security group is exceeded. | |
| 403 | InvalidInstanceId.AlreadyExists | The specified instance already exists in the specified security group. | |
| 403 | AclLimitExceed | %s | |
| 403 | InstanceSecurityGroupLimitExceeded | %s | |
| 403 | InvalidOperation.NetworkInterfaceCountExceeded | The maximum number of NetworkInterface in a enterprise level security group is exceeded. | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | %s | |
| 403 | InvalidOperation.InvalidEniType | %s | |
| 403 | InvalidOperation.VpcMismatch | %s | |
| 403 | InvalidOperation.EniServiceManaged | %s | |
| 403 | InvalidParam.Malformed | %s | |
| 403 | InvalidParam.EniIdAndInstanceId.Conflict | %s | |
| 403 | Forbidden.InstanceIsBeingCreated | The specified instance is being created. | |
| 404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | |
| 404 | InvalidEniId.NotFound | %s | |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。