Question

In: https://developers.google.com/storage/docs/migrating#migration-simple

It says that simple migration just needs the Google developer key and secret to replace the AWS key and secret.

However, in code that uses boto, how can you change the endpoint to use the Google Storage endpoint instead of the AWS endpoint?

I can see that you can use boto.gs.GSConnection instead of boto.s3.S3Connection, but I'd like to avoid changing code.

Was it helpful?

Solution

Your code doesn't need to be aware of the different connection type, but you do need to call a different method to make your connection. My code worked with just two changes:

  1. I changed

    my_connection = boto.connect_s3()
    

    to

    my_connection = boto.connect_gs(goog_dev_key, goog_dev_secret)
    
  2. I changed my bucket naming connection to avoid embedded periods, which are unacceptable on GS.

All other code remained the same.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top