更新时间:2024-04-15 GMT+08:00
更新浮动IP
功能介绍
更新浮动IP。
更新时需在URL中给出浮动IP地址的ID。
port_id为空,则表示浮动IP从端口解绑。
该接口有以下使用约束:
- 绑定浮动IP过程中,如果浮动IP处于“error”状态,请先尝试执行浮动IP解绑定动作。
- 不支持直接把已经绑定浮动IP的端口重新绑定到另外一个浮动IP上,必须先解绑再绑定。
请求消息
|
参数名称 |
类型 |
必选 |
说明 |
|---|---|---|---|
|
floatingip |
floatingip object |
是 |
floatingip对象列表,参见表3。 |
响应消息
|
参数名称 |
类型 |
说明 |
|---|---|---|
|
floatingip |
floatingip object |
floatingip对象列表,参见表5。 |
请求示例
- 解绑实例。
PUT https://{Endpoint}/v2.0/floatingips/b997e0d4-3359-4c74-8f88-bc0af81cd5a2 { "floatingip": { "port_id": null } } - 绑定实例,port id为f91f5763-c5a2-4458-979d-61e48b3c3fac。
PUT https://{Endpoint}/v2.0/floatingips/b997e0d4-3359-4c74-8f88-bc0af81cd5a2 { "floatingip": { "port_id": "f91f5763-c5a2-4458-979d-61e48b3c3fac" } }
响应示例
状态码: 200
(浮动IP与端口解绑)
{
"floatingip": {
"id": "b997e0d4-3359-4c74-8f88-bc0af81cd5a2",
"status": "DOWN",
"router_id": null,
"tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
"floating_network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975",
"fixed_ip_address": null,
"floating_ip_address": "88.88.215.205",
"port_id": null,
}
}
(浮动IP与端口绑定)
{
"floatingip": {
"id": "b997e0d4-3359-4c74-8f88-bc0af81cd5a2",
"status": "DOWN",
"router_id": null,
"tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
"floating_network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975",
"fixed_ip_address": "192.168.10.3",
"floating_ip_address": "88.88.215.205",
"port_id": "f91f5763-c5a2-4458-979d-61e48b3c3fac",
}
}
状态码
请参见状态码。
错误码
请参见错误码。
父主题: 浮动IP