Warning

This API is very subject to change. It does not even come close to what Amazon has to offer, just enough for me to get what I needed done. At some point it will probably have more of Amazon's features.

Description

A simple API to use the Amazon S3 service. The current version does not come close to supporting all of S3 or AWS. If there is something in the API that you need, that isn't currently there, let me know at t@thintz.com. The API, as it is right now, is very subject to change.

Author

Requirements

List of user configurable parameters

access-key

This needs to be set before you can access S3. This is your AWS access key.

secret-key

[parameter](secret-key [string])

This needs to be set before you can access S3. This is your AWS secret key.

https

[parameter](https [boolean])

If set to #t Amazon S3 will be accessed via https. Defaults to #f.

List of Procedures

All procedures return three values. The first will be the return value for the procedure. The second is the request-uri. The third is the response object. See http-client's call-with-input-request (Amazon S3 uses this and returns the same values).

Errors are unspecified and will occur if you do anything that results in an error. Such as: not setting up your AWS access or secret keys correctly, trying to access something you don't have permissions to, trying to create a bucket that already exists, etc. This is subject to change.

list-buckets

[procedure](list-buckets)

Returns a list of your buckets.

bucket-exists?

[procedure](bucket-exists? bucket)

Returns #t when the specified bucket exists, #f otherwise.

create-bucket!

[procedure](create-bucket! bucket)

Creates a bucket. If the bucket already exists, you will most likely get an error. The result of this call is unspecified.

delete-bucket!

[procedure](delete-bucket! bucket)

Attempts to delete the specified bucket. If the bucket doesn't exist or can't be deleted, you will get an unspecified error.

list-objects

[procedure](list-objects bucket)

Returns a list of all the objects in the specified bucket.

put-object!

This is the basic/raw way of putting an object on S3. It is recommended to use either put-string! or put-sexp!, if you can. Takes a bucket, a key (string) for identifying the object, a thunk that returns the object, the length of the object, and the object type.

If the key already specifies an object on S3, the object will be replaced.