'List all volumes
:param node: Only return volumes for the provided node.
:type node: :class:`CloudStackNode`
:rtype: ``list`` of :class:`StorageVolume`'

def list_volumes(self, node=None):

    if node:
        volumes = self._sync_request(command='listVolumes', params={'virtualmachineid': node.id}, method='GET')
    else:
        volumes = self._sync_request(command='listVolumes', method='GET')
    list_volumes = []
    extra_map = RESOURCE_EXTRA_ATTRIBUTES_MAP['volume']
    for vol in volumes.get('volume', []):
        extra = self._get_extra_dict(vol, extra_map)
        if ('tags' in vol):
            extra['tags'] = self._get_resource_tags(vol['tags'])
        state = self._to_volume_state(vol)
        list_volumes.append(StorageVolume(id=vol['id'], name=vol['name'], size=vol['size'], state=state, driver=self, extra=extra))
    return list_volumes
