hS3-0.5.9: Interface to Amazon's Simple Storage Service (S3)

Copyright(c) Greg Heartsfield 2007
LicenseBSD3
Safe HaskellNone
LanguageHaskell98

Network.AWS.S3Bucket

Contents

Description

Bucket interface for Amazon S3 API Version 2006-03-01 http://docs.amazonwebservices.com/AmazonS3/2006-03-01/

Synopsis

Function Types

createBucketIn Source

Arguments

:: AWSConnection

AWS connection information

-> String

Proposed bucket name

-> String

Location (US, EU, "us-west-1", "ap-southeast-1")

-> IO (AWSResult ())

Server response

Create a new bucket on S3 with the given name.

createBucket Source

Arguments

:: AWSConnection

AWS connection information

-> String

Proposed bucket name

-> IO (AWSResult ())

Server response

Create a new bucket on S3 with the given name.

createBucketWithPrefixIn Source

Arguments

:: AWSConnection

AWS connection information

-> String

Bucket name prefix

-> String

Location (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.

createBucketWithPrefix Source

Arguments

:: AWSConnection

AWS connection information

-> String

Bucket name prefix

-> IO (AWSResult String)

Server response, with bucket name

see createBucketWithPrefixIn, but hardcoded for the US

deleteBucket Source

Arguments

:: 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.

getBucketLocation Source

Arguments

:: AWSConnection

AWS connection information

-> String

Bucket name

-> IO (AWSResult String)

Server response (US, EU, "us-west-1", "ap-southeast-1", etc.)

Physical location of the bucket. US or EU

emptyBucket Source

Arguments

:: 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.

listBuckets Source

Arguments

:: 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.

listObjects Source

Arguments

:: 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

listAllObjects Source

Arguments

:: 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

Arguments

:: 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

Arguments

:: 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

Constructors

ListRequest 

Instances

data ListResult Source

Result from listing objects.

Constructors

ListResult 

Fields

key :: String

Name of object

last_modified :: String

Last modification date

etag :: String

MD5

size :: Integer

Bytes of object data

storageClass :: StorageClass

Storage class of the object

Instances

type IsTruncated = Bool Source

Is a result set response truncated?