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

updateSubnet() public method

This operation updates the specified subnet. Some attributes, such as IP version (ip_version), CIDR (cidr), and IP allocation pools (allocation_pools) cannot be updated. Attempting to update these attributes results in a 400 Bad Request error.
public updateSubnet ( string $subnetId, array | object $options ) : object
$subnetId string The Id of the subnet
$options array | object Raw options object (It will be json_encoded and passed as is.)
return object Returns subnet object on success or throws an exception otherwise
    public function updateSubnet($subnetId, $options)
    {
        $result = null;
        $response = $this->getClient()->call($this->service, sprintf('/subnets/%s', $this->escape($subnetId)), array('_putData' => json_encode(array('subnet' => $options))), 'PUT');
        if ($response->hasError() === false) {
            $result = json_decode($response->getContent());
            $result = $result->subnet;
        }
        return $result;
    }