调用AssociateHaVip接口将HaVip绑定到专有网络ECS实例或弹性网卡上。
接口说明
在调用本接口绑定 HaVip 时,请注意:
-
HaVip 绑定后立即生效,无需重启 ECS 实例,但需要将 HaVip 配置到 ECS 实例的弹性网卡上。
-
HaVip 和要绑定的 ECS 实例必须同属于一个交换机。
-
一个 HaVip 支持同时绑定 10 个 ECS 实例或同时绑定 10 个弹性网卡,但一个 HaVip 不能同时绑定 ECS 实例和弹性网卡。
-
要绑定的 ECS 实例的状态必须为运行中或停止。
-
HaVip 实例的状态必须为 Available 或 InUse。
-
AssociateHaVip 接口属于异步接口,即系统返回一个请求 ID,但该 HaVip 并未绑定完成,系统后台的绑定任务仍在进行。您可以调用 DescribeHaVips 查询 HaVip 的绑定状态:
当 HaVip 处于 Associating 状态时,表示 HaVip 正在绑定中。
当 HaVip 处于 InUse 状态时,表示 HaVip 绑定完成。
-
AssociateHaVip 接口不支持并发绑定同一个 HaVip。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:AssociateHaVip |
create |
*Instance
*HaVip
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。 |
0c593ea1-3bea-11e9-b96b-88e9fe63**** |
| RegionId |
string |
是 |
HaVip 所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-shanghai |
| HaVipId |
string |
是 |
要绑定的 HaVip 的 ID。 |
havip-2zeo05qre24nhrqpy**** |
| InstanceId |
string |
是 |
与 HaVip 绑定的 ECS 实例 ID。 |
i-faf344422ffsfad**** |
| InstanceType |
string |
否 |
要绑定 HaVip 的实例类型,取值:
|
EcsInstance |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
C44F62BE-9CE7-4277-B117-69243F3988BF |
示例
正常返回示例
JSON格式
{
"RequestId": "C44F62BE-9CE7-4277-B117-69243F3988BF"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | OperationUnsupported.BindOnFreeNetworkInterface | The network interface must be attached to an ECS instance. | 网卡必须绑定在ECS实例上。 |
| 400 | OperationUnsupported.BindMultipleType | You cannot bind HaVip to multiple instance types. | 不允许同时绑定ECS实例和网卡。 |
| 400 | OperationUnsupported.BindOnMultipleVswitch | The bound instance and HaVip must be on the same vSwitch. | 绑定的实例和HaVip必须位于同一台交换机上。 |
| 400 | InvalidVip.Status | vip invalid status | |
| 400 | IncorrectHaVipStatus | HaVip can be operated by this action only when it's status is Available or InUse. | Havip实例为Available或InUse才允许操作 |
| 400 | IncorrectInstanceStatus | ECS instance can be operated by this action only when it?s status is Running or Stopped. | |
| 400 | CountLimitExceed.HaVipOnInstance | The amount of HaVip associated with the specified Instance reach its limits. | 超过实例的HaVip配额。 |
| 400 | CountLimitExceeded.HaVipOnECSInstance | The amount of Instance associated with the specified HaVip reach its limits. | 超过HaVip的实例配额。 |
| 400 | OperationFailed.DistibuteLock | Distibute lock fail. | 操作被其他请求加锁; |
| 400 | InvalidNetworkInterfaceId.NotFound | The network interface is not found. | 网卡不存在。 |
| 400 | OperationFailed.QueryNetworkInterfaceInfo | Failed to query network interface information. | 查询网卡信息失败。 |
| 400 | IllegalParam.InstanceType | The specified instance type is invalid. Only ECS instances and network interface are allowed. | 绑定的实例类型不允许。 |
| 400 | OperationUnsupported.BindOnSameEcs | You cannot bind two network interfaces on the same ECS instance. | 不允许绑定同一台ECS上的两张网卡。 |
| 400 | OperationUnsupported.HavipBindType | You cannot bind HAVIP to network interface in the specified region. | 您所在的地域不支持绑定网卡。 |
| 400 | InvalidInstance.NotExist | InvalidInstance.NotExist : The specified Instance does not exist in the specified region. i-bp136w25mhx503ptilrh\r\nRequestId : A961CC27-D797-4E16-B1B3-19B9ECBA1495 | |
| 400 | OperationDenied.BindOnSameEcs | The operation is not allowed because networkinterface bind on same instance. | |
| 400 | Forbidden.HaVip | No permissions to perform operations on HAVIPs. Please apply for privilege--vpc_privilege_allow_buy_havip_instance. | 操作HaVip没有权限,请到配额中心申请权限。 |
| 400 | InvalidInstanceId.NotFound | The specified Instance does not exist in the specified region. | |
| 400 | ResourceNotFound.EcsInstance | The specified resource of ECS instance is not found. | 指定的ECS实例不存在。 |
| 400 | InvalidStatus.NotAllow | Bind instance status invalid | 绑定实例状态无效 |
| 400 | InvalidHaVip.Exist | haVip already bind exist. | |
| 400 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | |
| 400 | QuotaExceeded.HaVipBindInstance | The amount of instance associated with the specified haVip reach its limits. | |
| 404 | InvalidHaVipId.NotFound | The specified HaVip does not exist in the specified region. | 指定的HaVip不在指定的地域中,请您检查选择的地域是否正确。 |
| 404 | InvalidInstanceId.NotFound | The specified Instance does not exist in the specified region. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。