public function createFloatingIp($floatingNetworkId, $portId = null, $fixedIpAddress = null)
{
$result = null;
$options = array();
if (isset($floatingNetworkId)) {
$options['floating_network_id'] = (string) $floatingNetworkId;
}
if (isset($portId)) {
$options['port_id'] = (string) $portId;
}
if (isset($fixedIpAddress)) {
$options['fixed_ip_address'] = (string) $fixedIpAddress;
}
$options = array('floatingip' => $options);
$response = $this->getClient()->call($this->service, '/floatingips', $options, 'POST');
if ($response->hasError() === false) {
$result = json_decode($response->getContent());
$result = $result->floatingip;
}
return $result;
}