调用AttachNetworkInterface附加一个弹性网卡(ENI)到一台ENS实例上。
接口说明
调用该接口时,请注意:
弹性网卡必须处于可用(Available)状态。
一个弹性网卡只能同时附加到一台相同可用区且相同专有网络的实例上。
实例需处于已停止(Stopped)状态。
一台实例最多可以附加 10 个弹性网卡。
该接口为异步接口,调用成功后,您可以通过查询弹性网卡状态的方式来感知操作结果。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ens:AttachNetworkInterface |
update |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
实例 ID。 |
i-5p67acfmxazb4p**** |
| NetworkInterfaceId |
string |
是 |
弹性网卡 ID。 |
eni-58z57orgmt6d1**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ens.interface.error | An error occurred while call the API. | |
| 400 | InvalidEniId.NotFound | The specified NetworkInterfaceId does not exist. | |
| 400 | InvalidParameter.EniServiceManaged | The eni is managed by service. | |
| 400 | InvalidOperation.InvalidEniStatus | Current eni status does not support this operation. | |
| 400 | InstanceNotFound | The input parameter instancdId that is not found. | |
| 400 | InvalidOperation.InvalidEnsStatus | Current instance status does not support this operation. | |
| 400 | InvalidOperation.InstanceNotSupport | The specified instance does not support this operation. | |
| 400 | InvalidOperation.NetworkMismatch | Specified eni and instance are not in the same network. | |
| 400 | EniPerInstanceLimitExceeded | EniPerInstanceLimitExceeded. | |
| 400 | InvalidOperation.InvalidEniType | The type of eni does not support this operation. | |
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。