Scalr\Service\OpenStack\Services\Network\V2\NetworkApi::updateFloatingIp PHP Method

updateFloatingIp() public method

This operation has the name of setting, unsetting, or updating the assocation between a floating ip and a Quantum port. The association process is exactly the same as the one discussed for the create floating IP operation.
public updateFloatingIp ( string $floatingIpId, string $portId = null ) : object
$floatingIpId string The identifier of the floating IP
$portId string optional Internal port
return object Returns allocated floating ip details
    public function updateFloatingIp($floatingIpId, $portId = null)
    {
        $result = null;
        $options = new \stdClass();
        if (isset($portId)) {
            $options->port_id = (string) $portId;
        }
        $options = array('floatingip' => $options);
        $response = $this->getClient()->call($this->service, sprintf('/floatingips/%s', $this->escape($floatingIpId)), array('_putData' => json_encode($options)), 'PUT');
        if ($response->hasError() === false) {
            $result = json_decode($response->getContent());
            $result = $result->floatingip;
        }
        return $result;
    }