Scalr\Service\OpenStack\Services\Network\V2\NetworkApi::updatePort PHP Метод

updatePort() публичный Метод

You can use this operation to update information for a port, such as its symbolic name and associated IPs. When you update IPs for a port, the previously associated IPs are removed, returned to the respective subnets allocation pools, and replaced by the IPs specified in the body for the update request. Therefore, this operation replaces the fixed_ip attribute when it is specified in the request body. If the new IP addresses are not valid, for example, they are already in use, the operation fails and the existing IP addresses are not removed from the port.
public updatePort ( string $portId, array | object $options ) : object
$portId string The ID of the port
$options array | object The list of the options to change
Результат object Returns port object on success or throws an exception otherwise
    public function updatePort($portId, $options)
    {
        $result = null;
        $response = $this->getClient()->call($this->service, sprintf('/ports/%s', $this->escape($portId)), array('_putData' => json_encode(array('port' => $options))), 'PUT');
        if ($response->hasError() === false) {
            $result = json_decode($response->getContent());
            $result = $result->port;
        }
        return $result;
    }