Get list of objects in the bucket.

        :param bucket: A :class:`invenio_files_rest.models.Bucket` instance.
        :returns: The Flask response.
480435
def get(self, bucket=None, versions=missing, uploads=missing):
        
        if uploads is not missing:
            return self.multipart_listuploads(bucket)
        else:
            return self.listobjects(bucket, versions)
1337885
def stream_buckets(self, bucket_type=None, timeout=None):
        
        if not self.bucket_stream():
            raise NotImplementedError('Streaming list-buckets is not '
                                      'supported')
        msg_code = riak.pb.messages.MSG_CODE_LIST_BUCKETS_REQ
        codec = self._get_codec(msg_code)
        msg = codec.encode_get_buckets(bucket_type,
                                       timeout, streaming=True)
        self._send_msg(msg.msg_code, msg.data)
        return PbufBucketStream(self, codec)
356279
def get_bucket_for(self, node):
        
        for index, bucket in enumerate(self.buckets):
            if node.long_id < bucket.range[1]:
                return index
        # we should never be here, but make linter happy
        return None
747665
def get_objects(self, instance):
        
        view = self.context["view"]
        queryset = self.context["objects"]

        page = view.paginate_queryset(queryset)
        if page is not None:
            serializer = view.get_facet_objects_serializer(page, many=True)
            return OrderedDict([
                ("count", self.get_count(queryset)),
                ("next", view.paginator.get_next_link()),
                ("previous", view.paginator.get_previous_link()),
                ("results", serializer.data)
            ])

        serializer = view.get_serializer(queryset, many=True)
        return serializer.data
74005
def handle_get_request(self):
        
        self.objects = self.get_objects()
        self.response = self.get_response_handler()

        self.response.process(self.objects)

        return self.list_response()
1205613
def _storage_list_keys(bucket, pattern):
  
  data = [{'Name': item.metadata.name,
           'Type': item.metadata.content_type,
           'Size': item.metadata.size,
           'Updated': item.metadata.updated_on}
          for item in _storage_get_keys(bucket, pattern)]
  return datalab.utils.commands.render_dictionary(data, ['Name', 'Type', 'Size', 'Updated'])
57610
def get_bucket_file_list(self):
        
        logger.debug("Retrieving bucket object list")

        paginator = self.s3_client.get_paginator('list_objects')
        options = {
            'Bucket': self.aws_bucket_name
        }
        if self.aws_bucket_prefix:
            logger.debug("Adding prefix {} to bucket list as a filter".format(self.aws_bucket_prefix))
            options['Prefix'] = self.aws_bucket_prefix
        page_iterator = paginator.paginate(**options)

        obj_dict = {}
        for page in page_iterator:
            obj_dict.update(get_bucket_page(page))

        return obj_dict
709479
def list_files(bucket, profile_name=None):
    
    session = boto3.Session(profile_name=profile_name)
    conn = session.client('s3')
    keys = []
    ret = conn.list_objects(Bucket=bucket)
    print(ret)
    if 'Contents' not in ret:
        return []
    # Make this a generator in future and use the marker:
    # https://boto3.readthedocs.io/en/latest/reference/services/
    #     s3.html#S3.Client.list_objects
    for key in conn.list_objects(Bucket=bucket)['Contents']:
        keys.append('s3://' + bucket + '/' + key['Key'])
    return keys
2155
def head_object(self, bucket, object_name):
        
        details = self._details(
            method=b"HEAD",
            url_context=self._url_context(bucket=bucket, object_name=object_name),
        )
        d = self._submit(self._query_factory(details))
        d.addCallback(lambda (response, body): _to_dict(response.responseHeaders))
        return d
132070
def get_bucket(self, name):
        ""
        for bucket in self:
            for k,v in self[bucket].items():
                if k == name:
                    return bucket
383469
def get_bucket_type_props(self, bucket_type):
        
        self._check_bucket_types(bucket_type)
        url = self.bucket_type_properties_path(bucket_type.name)
        status, headers, body = self._request('GET', url)

        if status == 200:
            props = json.loads(bytes_to_str(body))
            return props['props']
        else:
            raise RiakError('Error getting bucket-type properties.')
1254817
def prepare_buckets(self):
        
        for mdl in self.registry.get_base_models():
            bucket = mdl(super_context).objects.adapter.bucket
            self.buckets[bucket.name] = bucket
1252563
def _gcs_get_keys(bucket, pattern):
  
  return [obj for obj in list(bucket.objects()) if fnmatch.fnmatch(obj.metadata.name, pattern)]
159079
def buckets(self):
        

        # No cached value
        if self.__buckets is None:

            # Get response
            response = self.__service.tables().list(
                projectId=self.__project,
                datasetId=self.__dataset).execute()

            # Extract buckets
            self.__buckets = []
            for table in response.get('tables', []):
                table_name = table['tableReference']['tableId']
                bucket = self.__mapper.restore_bucket(table_name)
                if bucket is not None:
                    self.__buckets.append(bucket)

        return self.__buckets
976090
def list(self, prefix='', delimiter=None):
        """"""
        return self.service._list(
            bucket=self.name, prefix=prefix, delimiter=delimiter, objects=True
        )
445382
def list(
            self,
            bucket: str,
            prefix: str=None,
            delimiter: str=None,
    ) -> typing.Iterator[str]:
        
        raise NotImplementedError()
514298
def stream_buckets(self, bucket_type=None, timeout=None):
        
        if not self.bucket_stream():
            raise NotImplementedError('Streaming list-buckets is not '
                                      "supported on %s" %
                                      self.server_version.vstring)
        bucket_type = self._get_bucket_type(bucket_type)
        url = self.bucket_list_path(bucket_type=bucket_type,
                                    buckets="stream", timeout=timeout)
        status, headers, response = self._request('GET', url, stream=True)

        if status == 200:
            return HttpBucketStream(response)
        else:
            raise RiakError('Error listing buckets.')