Copyright | (c) Greg Heartsfield 2007 |
---|---|
License | BSD3 |
Safe Haskell | None |
Language | Haskell98 |
Object interface for Amazon S3 API Version 2006-03-01 http://docs.amazonwebservices.com/AmazonS3/2006-03-01/
- sendObject :: AWSConnection -> S3Object -> IO (AWSResult ())
- sendObjectMIC :: 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
Function Types
:: AWSConnection | AWS connection information |
-> S3Object | Object to add to a bucket |
-> IO (AWSResult ()) | Server response |
Send data for an object. If the header Content-Length is not set, all content must be read into memory prior to sending.
:: AWSConnection | AWS connection information |
-> S3Object | Object to add to a bucket |
-> IO (AWSResult ()) | Server response |
Send data for an object, with message integrity check. This version of sendObject will add an MD5 message integrity check so that transmission errors will be detected, but requires the message be read into memory before being sent.
:: AWSConnection | AWS connection information |
-> S3Object | Source object (bucket+name only) |
-> S3Object | Destination 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.
:: AWSConnection | AWS connection information |
-> S3Object | Source object (bucket+name only) |
-> S3Object | Destination 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.
:: AWSConnection | AWS connection information |
-> S3Object | Object to retrieve |
-> IO (AWSResult S3Object) | Server response |
Retrieve an object.
:: AWSConnection | AWS connection information |
-> S3Object | Object to retrieve information on |
-> IO (AWSResult S3Object) | Server response |
Get object info without retrieving content body from server.
:: AWSConnection | AWS connection information |
-> S3Object | Object 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.
:: AWSConnection | AWS connection information |
-> S3Object | Object to be made available |
-> Integer | How many seconds until this request expires |
-> IO URI | URI for the object |
Create a pre-signed request URI. Anyone can use this to request an object for the number of seconds specified.
:: AWSConnection | AWS connection information |
-> S3Object | Object to be made available |
-> Integer | Expiration time, in seconds since 00:00:00 UTC on January 1, 1970 |
-> URI | URI for the object |
Create a pre-signed request URI. Anyone can use this to request an object until the specified date.
:: StorageClass | Storage class to request |
-> S3Object | Object to modify |
-> S3Object | Object 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.
:: S3Object | Object to inspect |
-> Maybe StorageClass | Requested 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.
:: AWSConnection | AWS connection information |
-> StorageClass | New storage class for object |
-> S3Object | Object 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
An object that can be stored and retrieved from S3.
S3Object | |
|