2009-07-13 22:14:59 -04:00
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class S3
|
|
|
|
|
|
|
|
# List information about objects in an S3 bucket
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * bucket_name<~String> - name of bucket to list object keys from
|
|
|
|
# * options<~Hash> - config arguments for list. Defaults to {}.
|
2009-07-29 22:50:51 -04:00
|
|
|
# * 'prefix'<~String> - limits object keys to those beginning with its value.
|
|
|
|
# * 'marker'<~String> - limits object keys to only those that appear
|
2009-07-13 22:14:59 -04:00
|
|
|
# lexicographically after its value.
|
2009-07-29 22:50:51 -04:00
|
|
|
# * 'max-keys'<~Integer> - limits number of object keys returned
|
|
|
|
# * 'delimiter'<~String> - causes keys with the same string between the prefix
|
2009-07-13 22:14:59 -04:00
|
|
|
# value and the first occurence of delimiter to be rolled up
|
2009-07-20 22:47:48 -04:00
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Fog::AWS::Response>:
|
|
|
|
# * body<~Hash>:
|
2009-07-29 22:50:51 -04:00
|
|
|
# * 'Delimeter'<~String> - Delimiter specified for query
|
|
|
|
# * 'Marker'<~String> - Marker specified for query
|
|
|
|
# * 'MaxKeys'<~Integer> - Maximum number of keys specified for query
|
|
|
|
# * 'Name'<~String> - Name of the bucket
|
|
|
|
# * 'Prefix'<~String> - Prefix specified for query
|
|
|
|
# * 'Contents'<~Array>:
|
|
|
|
# * 'ETag'<~String>: Etag of object
|
|
|
|
# * 'Key'<~String>: Name of object
|
|
|
|
# * 'LastModified'<~String>: Timestamp of last modification of object
|
|
|
|
# * 'Owner'<~Hash>:
|
|
|
|
# * 'DisplayName'<~String> - Display name of object owner
|
|
|
|
# * 'ID'<~String> - Id of object owner
|
|
|
|
# * 'Size'<~Integer> - Size of object
|
|
|
|
# * 'StorageClass'<~String> - Storage class of object
|
2009-07-13 22:14:59 -04:00
|
|
|
def get_bucket(bucket_name, options = {})
|
|
|
|
query = '?'
|
|
|
|
for key, value in options
|
|
|
|
query << "#{key}=#{value};"
|
|
|
|
end
|
|
|
|
query.chop!
|
|
|
|
request({
|
2009-07-14 19:04:39 -04:00
|
|
|
:expects => 200,
|
2009-07-13 22:14:59 -04:00
|
|
|
:headers => {},
|
|
|
|
:host => "#{bucket_name}.#{@host}",
|
|
|
|
:method => 'GET',
|
|
|
|
:parser => Fog::Parsers::AWS::S3::GetBucket.new,
|
|
|
|
:query => query
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|