final Port port = this.getPort(deviceId, networkId);
if (port == null) {
throw new OpenstackException("Port not found for deviceId=" + deviceId);
}
try {
<BUG>final String input = String.format("{\"floatingip\":{\"floating_network_id\":\"%s\",\"port_id\":\"%s\"}}",
floatingNetworkId, port.getId());
final String response = this.doPost("floatingips", input);</BUG>
final FloatingIp floatingIp = JsonUtils.unwrapRootToObject(FloatingIp.class, response);
return floatingIp.getFloatingIpAddress();

final Port port = this.getPort(deviceId, networkId);
if (port == null) {
throw new OpenstackException("Port not found for deviceId=" + deviceId);
}
try {
final String input =
String.format(
"{\"floatingip\":{\"floating_network_id\":\"%s\","
+ "\"port_id\":\"%s\", \"fixed_ip_address\":\"%s\"}}",
floatingNetworkId, port.getId(), port.getFixedIps().get(0).getIpAddress());
final String response = this.doPost("floatingips", input);
final FloatingIp floatingIp = JsonUtils.unwrapRootToObject(FloatingIp.class, response);
return floatingIp.getFloatingIpAddress();
