Query (List) exports.
        :param volume: Optional volume identifier.
        :param state: Optional import sate.
        :param api: Api instance.
        :return: Collection object.
779476
def query(cls, volume=None, state=None, offset=None,
              limit=None, api=None):

        
        api = api or cls._API

        if volume:
            volume = Transform.to_volume(volume)

        return super(Export, cls)._query(
            url=cls._URL['query'], volume=volume, state=state, offset=offset,
            limit=limit, fields='_all', api=api
        )
811570
def get(self, id=None):
        
        if id is None:
            res = self._get('department/list')
        else:
            res = self._get('department/list', params={'id': id})
        return res['department']
43559
def os_volumes(self):
        
        if not self.__os_volumes:
            self.__os_volumes = OsVolumes(self.__connection)
        return self.__os_volumes
972404
def get_sdc_for_volume(self, volObj):
        
        sdcList = []
        if volObj.mapped_sdcs is not None:
            for sdc in volObj.mapped_sdcs:
                sdcList.append(sdc)
        if len(sdcList) == 0:
            self.conn.logger.debug("No SDCs mapped to volume: %s-(%s)" % (volObj.name, volObj.id))
            return []
        # returning an empty list is
        # valid for snapshots or volumes.
        return sdcList
758727
def basic_query(returns):
    """"""
    return compose(
        reusable,
        map_send(parse_request),
        map_yield(prepare_params, snug.prefix_adder(API_PREFIX)),
        map_return(loads(returns)),
        oneyield,
    )
974490
def bulk_submit(cls, exports, copy_only=False, api=None):
        
        if not exports:
            raise SbgError('Exports are required')

        api = api or cls._API

        items = []
        for export in exports:
            file_ = Transform.to_file(export.get('file'))
            volume = Transform.to_volume(export.get('volume'))
            location = Transform.to_location(export.get('location'))
            properties = export.get('properties', {})
            overwrite = export.get('overwrite', False)

            item = {
                'source': {
                    'file': file_
                },
                'destination': {
                    'volume': volume,
                    'location': location
                },
                'properties': properties,
                'overwrite': overwrite
            }

            items.append(item)

        data = {'items': items}
        params = {'copy_only': copy_only}

        response = api.post(
            url=cls._URL['bulk_create'], params=params, data=data
        )
        return ExportBulkRecord.parse_records(response=response, api=api)
442123
def clone(self, label):
        
        result = self._client.post('{}/clone'.format(Volume.api_endpoint),
                model=self, data={'label': label})

        if not 'id' in result:
            raise UnexpectedResponseError('Unexpected response cloning volume!')

        return Volume(self._client, result['id'], result)
1005458
def get_volumes(self):
        
        vols = [self.find_volume(name) for name in self.virsp.listVolumes()]
        return vols
1197599
def get(self, id, no_summary=False):
        
        resp = self.client.accounts.get(id)
        if no_summary:
            return self.display(resp)

        results = []
        # Get a list of all volumes for this tenant id
        client = LunrClient(self.get_admin(), debug=self.debug)
        volumes = client.volumes.list(account_id=resp['id'])
        #volumes = self.client.volumes.list(resp['id'])
        for volume in volumes:
            if volume['status'] == 'DELETED':
                continue
            results.append(volume)

        self.display(resp, ['name', 'status', 'last_modified', 'created_at'])
        if results:
            return self.display(response(results, 200),
                                ['id', 'status', 'size'])
        else:
            print("-- This account has no active volumes --")
        print("\nThis is a summary, use --no-summary "
              "to see the entire response")
901363
def _convert_volume(self, volume):
        
        data = {
            'host': volume.get('hostPath'),
            'container': volume.get('containerPath'),
            'readonly': volume.get('mode') == 'RO',
        }
        return data
607882
def GetVolumeByIndex(self, volume_index):
    
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    if volume_index < 0 or volume_index >= len(self._volume_identifiers):
      return None

    volume_identifier = self._volume_identifiers[volume_index]
    return self._volumes[volume_identifier]
368247
def list_volume_schedules(self, volume_id):
        
        volume_detail = self.client.call(
            'Network_Storage',
            'getObject',
            id=volume_id,
            mask='schedules[type,properties[type]]')

        return utils.lookup(volume_detail, 'schedules')
263763
def _get_by_index(self, index):
        """"""
        volume_or_disk = self.parser.get_by_index(index)
        volume, disk = (volume_or_disk, None) if not isinstance(volume_or_disk, Disk) else (None, volume_or_disk)
        return volume, disk
469466
def volume_list(provider):
    '''
    

    '''
    client = _get_client()
    info = client.extra_action(action='volume_list', provider=provider, names='name')
    return info['name']
765311
def _query(options, collection_name, num_to_skip,
           num_to_return, query, field_selector, opts, check_keys):
    """"""
    encoded = _dict_to_bson(query, check_keys, opts)
    if field_selector:
        efs = _dict_to_bson(field_selector, False, opts)
    else:
        efs = b""
    max_bson_size = max(len(encoded), len(efs))
    return b"".join([
        _pack_int(options),
        _make_c_string(collection_name),
        _pack_int(num_to_skip),
        _pack_int(num_to_return),
        encoded,
        efs]), max_bson_size
1152938
def get_volume_details(self, volume_name: str) -> dict:
        
        if volume_name not in self.volumes:
            raise RuntimeError('No such volume found: ', volume_name)

        volume = self._client.volumes.get(volume_name)
        return volume.attrs
628156
private Volume[] getVolumes(TestContext context) {
        String[] volumes = StringUtils.commaDelimitedListToStringArray(getParameter("volumes", context));
        Volume[] volumeSpecs = new Volume[volumes.length];

        for (int i = 0; i < volumes.length; i++) {
            volumeSpecs[i] = new Volume(volumes[i]);
        }

        return volumeSpecs;
    }