lericson / simples3

Simple, quick Amazon AWS S3 interface in Python
BSD 2-Clause "Simplified" License
96 stars 36 forks source link

Add support for buckets in different regions #18

Open tyilo opened 11 years ago

tyilo commented 11 years ago

When trying to use simples3 to connect to a bucket hosted in eu-west-1, I get the following error:

The bucket you are attempting to access must be addressed using the specified endpoint.
heynairb commented 9 years ago

+1

Wakeupbuddy commented 9 years ago

does this fixed or not?

jjacarillo commented 9 years ago

same issue here. this should be top prio.

lericson commented 9 years ago

Tell me how you are trying to connect to it, I used simples3 with European servers many times!

lericson commented 9 years ago
bucket = simples3.S3Bucket(name="mybucket", base_url="http://eu-west.whatever.com/")

I forget exactly how the incantation looks. I'm all for adding a simples3.connect though, or open. Suggestions?

jjacarillo commented 9 years ago

@lericson yes, I had to provide the full url (not just the base) into base_url for it to work. but it does not look so natural. but this looks pretty:

bucket = S3Bucket(name='mybucket', region='us-west1')

lericson commented 9 years ago

Alright, that sounds awesome. Could you perhaps post some example of how to use a different region, so it can be included in the documentation until we get a better API?

mdauphin commented 8 years ago

I found a solution:

bucket = 'my_bucket'
access_key = 'AAAAAAAAAAAAAAAAAA'
secret_key = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

s = simples3.S3Bucket(bucket,
    base_url="http://s3-eu-west-1.amazonaws.com/%s" % bucket,
    access_key=access_key,
    secret_key=secret_key)

s.put( 'todel.txt', 'blabla' )
lericson commented 8 years ago

Good stuff, would do well to make a more obvious API though.

On 1 feb. 2016, at 10:44, mdauphin notifications@github.com wrote:

I found a solution:

bucket = 'my_bucket' access_key = 'AAAAAAAAAAAAAAAAAA' secret_key = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'

s = simples3.S3Bucket(bucket, base_url="http://s3-eu-west-1.amazonaws.com/%s" % bucket, access_key=access_key, secret_key=secret_key)

s.put( 'todel.txt', 'blabla' ) — Reply to this email directly or view it on GitHub.