hS3-0.5.3: Interface to Amazon's Simple Storage Service (S3)Source codeContentsIndex
Network.AWS.S3Object
Contents
Function Types
Data Types
Description
Object interface for Amazon S3 API Version 2006-03-01 http://docs.amazonwebservices.com/AmazonS3/2006-03-01/
Synopsis
sendObject :: AWSConnection -> S3Object -> IO (AWSResult ())
copyObject :: AWSConnection -> S3Object -> S3Object -> IO (AWSResult S3Object)
copyObjectWithReplace :: AWSConnection -> S3Object -> S3Object -> IO (AWSResult S3Object)
getObject :: AWSConnection -> S3Object -> IO (AWSResult S3Object)
getObjectInfo :: AWSConnection -> S3Object -> IO (AWSResult S3Object)
deleteObject :: AWSConnection -> S3Object -> IO (AWSResult ())
publicUriForSeconds :: AWSConnection -> S3Object -> Integer -> IO URI
publicUriUntilTime :: AWSConnection -> S3Object -> Integer -> URI
setStorageClass :: StorageClass -> S3Object -> S3Object
getStorageClass :: S3Object -> Maybe StorageClass
rewriteStorageClass :: AWSConnection -> StorageClass -> S3Object -> IO (AWSResult S3Object)
data S3Object = S3Object {
obj_bucket :: String
obj_name :: String
content_type :: String
obj_headers :: [(String, String)]
obj_data :: ByteString
}
data StorageClass
= STANDARD
| REDUCED_REDUNDANCY
Function Types
sendObjectSource
:: AWSConnectionAWS connection information
-> S3ObjectObject to add to a bucket
-> IO (AWSResult ())Server response
Send data for an object.
copyObjectSource
:: AWSConnectionAWS connection information
-> S3ObjectSource object (bucket+name only)
-> S3ObjectDestination object
-> IO (AWSResult S3Object)Server response, headers include version information
Copy object from one bucket to another (or the same bucket), preserving the original headers. Headers from destobj are sent, while only the bucket and name of srcobj are used. For the best performance, when changing headers during a copy, use the copyObjectWithReplace function. For conditional copying, the following headers set on the destination object may be used: x-amz-copy-source-if-match, x-amz-copy-source-if-none-match, x-amz-copy-source-if-unmodified-since, or x-amz-copy-source-if-modified-since. See http://docs.amazonwebservices.com/AmazonS3/2006-03-01/API/index.html?RESTObjectCOPY.html for more details.
copyObjectWithReplaceSource
:: AWSConnectionAWS connection information
-> S3ObjectSource object (bucket+name only)
-> S3ObjectDestination object
-> IO (AWSResult S3Object)Server response, headers include version information
Copy object from one bucket to another (or the same bucket), replacing headers. Any headers from srcobj are ignored, and only those set in destobj are used.
getObjectSource
:: AWSConnectionAWS connection information
-> S3ObjectObject to retrieve
-> IO (AWSResult S3Object)Server response
Retrieve an object.
getObjectInfoSource
:: AWSConnectionAWS connection information
-> S3ObjectObject to retrieve information on
-> IO (AWSResult S3Object)Server response
Get object info without retrieving content body from server.
deleteObjectSource
:: AWSConnectionAWS connection information
-> S3ObjectObject to delete
-> IO (AWSResult ())Server response
Delete an object. Only bucket and object name need to be specified in the S3Object. Deletion of a non-existent object does not return an error.
publicUriForSecondsSource
:: AWSConnectionAWS connection information
-> S3ObjectObject to be made available
-> IntegerHow many seconds until this request expires
-> IO URIURI for the object
Create a pre-signed request URI. Anyone can use this to request an object for the number of seconds specified.
publicUriUntilTimeSource
:: AWSConnectionAWS connection information
-> S3ObjectObject to be made available
-> IntegerExpiration time, in seconds since 00:00:00 UTC on January 1, 1970
-> URIURI for the object
Create a pre-signed request URI. Anyone can use this to request an object until the specified date.
setStorageClassSource
:: StorageClassStorage class to request
-> S3ObjectObject to modify
-> S3ObjectObject with storage class headers set, ready to be sent
Add required headers for the storage class. Use this in combination with sendObject for new objects. To modify the storage class of existing objects, use rewriteStorageClass. Using reduced redundancy for object storage trades off redundancy for storage costs.
getStorageClassSource
:: S3ObjectObject to inspect
-> Maybe StorageClassRequested storage class, Nothing if unspecified
Retrieve the storage class of a local S3Object. Does not work for objects retrieved with getObject, since the required header values are not returned. Use getObjectStorageClass or listObjects from S3Bucket module to determine storage class of existing objects.
rewriteStorageClassSource
:: AWSConnectionAWS connection information
-> StorageClassNew storage class for object
-> S3ObjectObject to modify
-> IO (AWSResult S3Object)Server response
Change the storage class (and only the storage class) of an existing object. This actually performs a copy to the same location, preserving metadata. It is not clear to me whether ACLs are preserved when copying to the same location. For best performance, we must not change other headers during storage class changes.
Data Types
data S3Object Source
An object that can be stored and retrieved from S3.
Constructors
S3Object
obj_bucket :: StringName of the bucket containing this object
obj_name :: StringURI of the object. Subresources (?acl or | ?torrent) should be suffixed onto this name.
content_type :: StringA standard MIME type describing the format of the contents. If not specified, binary/octet-stream is used.
obj_headers :: [(String, String)]Object metadata in (key,value) pairs. Key names should use the prefix x-amz-meta- to be stored with the object. The total HTTP request must be under 4KB, including these headers.
obj_data :: ByteStringObject data.
show/hide Instances
data StorageClass Source
Constructors
STANDARD
REDUCED_REDUNDANCY
show/hide Instances
Produced by Haddock version 2.6.1