hS3-0.5.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
createBucketIn :: AWSConnection -> String -> String -> IO (AWSResult ())
createBucket :: AWSConnection -> String -> IO (AWSResult ())
createBucketWithPrefixIn :: AWSConnection -> String -> String -> IO (AWSResult String)
createBucketWithPrefix :: AWSConnection -> String -> IO (AWSResult String)
deleteBucket :: AWSConnection -> String -> IO (AWSResult ())
getBucketLocation :: AWSConnection -> String -> IO (AWSResult String)
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])
isBucketNameValid :: String -> Bool
getObjectStorageClass :: AWSConnection -> S3Object -> IO (AWSResult StorageClass)
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
storageClass :: StorageClass
}
type IsTruncated = Bool
Function Types
createBucketInSource
:: AWSConnectionAWS connection information
-> StringProposed bucket name
-> StringLocation (US, EU, us-west-1, ap-southeast-1)
-> IO (AWSResult ())Server response
Create a new bucket on S3 with the given name.
createBucketSource
:: AWSConnectionAWS connection information
-> StringProposed bucket name
-> IO (AWSResult ())Server response
Create a new bucket on S3 with the given name.
createBucketWithPrefixInSource
:: AWSConnectionAWS connection information
-> StringBucket name prefix
-> StringLocation (US, EU, us-west-1, ap-southeast-1)
-> 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.
createBucketWithPrefixSource
:: AWSConnectionAWS connection information
-> StringBucket name prefix
-> IO (AWSResult String)Server response, with bucket name
see createBucketWithPrefixIn, but hardcoded for the US
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.
getBucketLocationSource
:: AWSConnectionAWS connection information
-> StringBucket name
-> IO (AWSResult String)Server response (US, EU, us-west-1, ap-southeast-1, etc.)
Physical location of the bucket. US or EU
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.
isBucketNameValid :: String -> BoolSource
Check Amazon guidelines on bucket naming. (missing test for IP-like names)
getObjectStorageClass :: AWSConnection -> S3Object -> IO (AWSResult StorageClass)Source
Retrieve the storage class of an object from S3. For checking more than one object's storage class efficiently, use listObjects.
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
storageClass :: StorageClassStorage class of the object
show/hide Instances
type IsTruncated = BoolSource
Is a result set response truncated?
Produced by Haddock version 2.6.1