hS3-0.3: Interface to Amazon's Simple Storage Service (S3)Source codeContentsIndex
Network.AWS.S3Bucket
Contents
Function Types
Data Types
Description
Bucket interface for Amazon S3 API Version 2006-03-01 http://docs.amazonwebservices.com/AmazonS3/2006-03-01/
Synopsis
createBucket :: AWSConnection -> String -> IO (AWSResult ())
createBucketWithPrefix :: AWSConnection -> String -> IO (AWSResult String)
deleteBucket :: AWSConnection -> String -> IO (AWSResult ())
emptyBucket :: AWSConnection -> String -> IO (AWSResult ())
listBuckets :: AWSConnection -> IO (AWSResult [S3Bucket])
listObjects :: AWSConnection -> String -> ListRequest -> IO (AWSResult (IsTruncated, [ListResult]))
listAllObjects :: AWSConnection -> String -> ListRequest -> IO (AWSResult [ListResult])
data S3Bucket = S3Bucket {
bucket_name :: String
bucket_creation_date :: String
}
data ListRequest = ListRequest {
prefix :: String
marker :: String
delimiter :: String
max_keys :: Int
}
data ListResult = ListResult {
key :: String
last_modified :: String
etag :: String
size :: Integer
}
type IsTruncated = Bool
Function Types
createBucketSource
:: AWSConnectionAWS connection information
-> StringProposed bucket name
-> IO (AWSResult ())Server response
Create a new bucket on S3 with the given name.
createBucketWithPrefixSource
:: AWSConnectionAWS connection information
-> StringBucket name prefix
-> IO (AWSResult String)Server response, if successful, the bucket name is returned.
Create a new bucket on S3 with the given prefix, and a random suffix. This can be used to programatically create buckets without of naming conflicts.
deleteBucketSource
:: AWSConnectionAWS connection information
-> StringBucket name to delete
-> IO (AWSResult ())Server response
Delete a bucket with the given name on S3. The bucket must be empty for deletion to succeed.
emptyBucketSource
:: AWSConnectionAWS connection information
-> StringBucket name to empty
-> IO (AWSResult ())Server response
Empty a bucket of all objects. Iterates through all objects issuing delete commands, so time is proportional to number of objects in the bucket. At this time, delete requests are free from Amazon.
listBucketsSource
:: AWSConnectionAWS connection information
-> IO (AWSResult [S3Bucket])Server response
Return a list of all bucket names and creation dates. S3 allows a maximum of 100 buckets per user.
listObjectsSource
:: AWSConnectionAWS connection information
-> StringBucket name to search
-> ListRequestList parameters
-> IO (AWSResult (IsTruncated, [ListResult]))Server response
List objects in a bucket, based on parameters from ListRequest. See the Amazon S3 developer resources for in depth explanation of how the fields in ListRequest can be used to query for objects. http://docs.amazonwebservices.com/AmazonS3/2006-03-01/ListingKeysRequest.html
listAllObjectsSource
:: AWSConnectionAWS connection information
-> StringBucket name to search
-> ListRequestList parameters
-> IO (AWSResult [ListResult])Server response
Repeatedly query the server for all objects in a bucket, ignoring the max_keys field.
Data Types
data S3Bucket Source
Constructors
S3Bucket
bucket_name :: String
bucket_creation_date :: String
show/hide Instances
data ListRequest Source
List request parameters
Constructors
ListRequest
prefix :: String
marker :: String
delimiter :: String
max_keys :: Int
show/hide Instances
data ListResult Source
Result from listing objects.
Constructors
ListResult
key :: StringName of object
last_modified :: StringLast modification date
etag :: StringMD5
size :: IntegerBytes of object data
show/hide Instances
type IsTruncated = BoolSource
Is a result set response truncated?
Produced by Haddock version 2.3.0