Copyright | (c) Greg Heartsfield 2007 |
---|---|
License | BSD3 |
Safe Haskell | None |
Language | Haskell98 |
Bucket interface for Amazon S3 API Version 2006-03-01 http://docs.amazonwebservices.com/AmazonS3/2006-03-01/
- 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)
- getVersioningConfiguration :: AWSConnection -> String -> IO (AWSResult VersioningConfiguration)
- setVersioningConfiguration :: AWSConnection -> String -> VersioningConfiguration -> IO (AWSResult ())
- data S3Bucket = S3Bucket {}
- data ListRequest = ListRequest {}
- data ListResult = ListResult {
- key :: String
- last_modified :: String
- etag :: String
- size :: Integer
- storageClass :: StorageClass
- type IsTruncated = Bool
- data VersioningConfiguration = VersioningConfiguration {}
- data VersioningStatus
Function Types
:: AWSConnection | AWS connection information |
-> String | Proposed bucket name |
-> String | |
-> IO (AWSResult ()) | Server response |
Create a new bucket on S3 with the given name.
:: AWSConnection | AWS connection information |
-> String | Proposed bucket name |
-> IO (AWSResult ()) | Server response |
Create a new bucket on S3 with the given name.
createBucketWithPrefixIn Source
:: AWSConnection | AWS connection information |
-> String | Bucket name prefix |
-> String | |
-> 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.
:: AWSConnection | AWS connection information |
-> String | Bucket name prefix |
-> IO (AWSResult String) | Server response, with bucket name |
see createBucketWithPrefixIn, but hardcoded for the US
:: AWSConnection | AWS connection information |
-> String | Bucket 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.
:: AWSConnection | AWS connection information |
-> String | Bucket 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.
:: AWSConnection | AWS 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.
:: AWSConnection | AWS connection information |
-> String | Bucket name to search |
-> ListRequest | List 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
:: AWSConnection | AWS connection information |
-> String | Bucket name to search |
-> ListRequest | List parameters |
-> IO (AWSResult [ListResult]) | Server response |
Repeatedly query the server for all objects in a bucket, ignoring the max_keys
field.
isBucketNameValid :: String -> Bool Source
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.
getVersioningConfiguration Source
:: AWSConnection | AWS connection information |
-> String | Bucket name to inquire on |
-> IO (AWSResult VersioningConfiguration) | Server response |
Check versioning and MFA configuration of a bucket.
setVersioningConfiguration Source
:: AWSConnection | AWS connection information |
-> String | Bucket to modify |
-> VersioningConfiguration | Desired versioning configuration |
-> IO (AWSResult ()) | Server response |
Set the versioning configuration of a bucket (MFA not yet supported).
Data Types
data ListRequest Source
List request parameters
data ListResult Source
Result from listing objects.
ListResult | |
|
type IsTruncated = Bool Source
Is a result set response truncated?