调用 AttachNetworkInterface 接口,将辅助网卡挂载至云服务器。
调用本接口需满足如下条件:
Attaching
表示挂载中,InUse
表示挂载完成。参数名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | AttachNetworkInterface | 要执行的操作。 取值: AttachNetworkInterface。 |
Version | String | 是 | 2020-04-01 | API版本信息,取值为:2020-04-01。 |
NetworkInterfaceId | String | 是 | eni-bp1fg655nh68xyz9**** | 辅助网卡ID。 |
InstanceId | String | 是 | i-wijfn35c**** | 云服务器实例的ID。 |
参数名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 2021062415303301022514515207C4**** | 请求ID。 |
GET /?Action=AttachNetworkInterface&Version=2020-04-01&NetworkInterfaceId=eni-bp1fg655nh68xyz9****&InstanceId=i-wijfn35c**** HTTP/1.1 Host: open.volcengineapi.com Service: vpc Region: cn-beijing
{ "ResponseMetadata": { "RequestId": "2021062415303301022514515207C4****", "Action": "AttachNetworkInterface", "Version": "2020-04-01", "Service": "vpc", "Region": "cn-beijing" }, "Result": { "RequestId": "2021062415303301022514515207C4****" } }
此处仅展示当前API的错误码,更多错误码请参见公共错误码。
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidEni.AccountMismatch | The specified elastic network interface and instance are in different account. | 指定的弹性网卡和实例不在同一个账号。 |
400 | InvalidEni.IPv4ToIPv6OnlyInstance | Attaching IPv4 ENI to IPv6 only instance is not supported. | 不支持把IPv4网卡挂载到IPv6 only实例上。 |
400 | InvalidEni.InvalidStatus | The specified elastic network interface is not in the correct status for the request. | 指定的弹性网卡所处的状态无法响应该请求。 |
400 | InvalidEni.ZoneMismatch | The specified elastic network interface and instance are in different Available Zones. | 指定的弹性网卡和实例不在同一个可用区。 |
400 | InvalidInstance.InvalidStatus | The specified instance is not in the correct status for the request. | 指定的ECS实例所处的状态无法响应该请求。 |
400 | InvalidInstance.InvalidType | The specified instance type is invalid for the request. | 指定的ECS实例规格无法响应该请求。 |
400 | InvalidTrafficMirrorSession.InvalidStatus | The specified traffic mirror session is not in the correct status for the request. | 指定的镜像流量会话所处的状态无法响应该请求。 |
400 | LimitExceeded.EnisPerInstance | You've reached the limit on the number of elastic network interfaces that can be attached to a single instance. | 已达到该ECS实例可绑定的弹性网卡的数量上限。 |
400 | LimitExceeded.PrivateIpsPerEni | You've reached the limit on the number of private IPs per elastic network interface that you can create. | 已达到弹性网卡可分配的辅助IP的数量上限。 |
400 | LimitExceeded.Ipv6AddressesPerEni | The number of IPv6 addresses for a specified network interface exceeds the limit for the type of instance you are attaching. | 网卡已达到指定实例规格可分配的IPv6地址数量上限。 |
403 | Forbidden | You are not authorized to perform operations on ESI related resources. | 无权限操作弹性预约实例关联资源。 |
403 | Forbidden | You are not authorized to perform operations on the specified elastic network interface. The specified elastic network interface is a service-managed elastic network interface. | 无权限对指定弹性网卡进行操作。指定的弹性网卡为云产品托管的弹性网卡。 |
404 | InvalidEniId.NotFound | The specified elastic network interface does not exist. | 指定的弹性网卡不存在。 |
404 | InvalidInstance.NotFound | The specified instance does not exist. | 指定的ECS实例不存在。 |