'Updates a volume.
:param volume: The volume you\'re updating.
:type volume: :class:`StorageVolume`
:param  ex_storage_name: The name of the volume.
:type   ex_storage_name: ``str``
:param  size: The desired size.
:type   size: ``int``
:param  ex_bus_type: Volume bus type (VIRTIO, IDE).
:type   ex_bus_type: ``str``
:return:    Instance of class ``StorageVolume``
:rtype:     :class:`StorageVolume`'

def ex_update_volume(self, volume, ex_storage_name=None, size=None, ex_bus_type=None):

    if (not ex_storage_name):
        ex_storage_name = volume.name
    if (not size):
        size = str(volume.size)
    action = volume.extra['href']
    body = {'name': ex_storage_name, 'size': size}
    if (ex_bus_type is not None):
        body['bus'] = ex_bus_type
    response = self.connection.request(action=action, headers={'Content-Type': 'application/json'}, data=body, method='PATCH', with_full_url=True)
    return self._to_volume(response.object, response.headers)
