This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Boto] | |
http_socket_timeout = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
import os | |
def download_keys(bucket_name, dst_dir): | |
""" | |
Very simple example showing how to download all keys in a bucket. | |
Assumes key names don't include path separators. Also assumes that | |
you don't have zillions of objects in the bucket. If you have a lot | |
you would want to get several download operations going in parallel. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
""" | |
import multiprocessing | |
import boto | |
import os | |
import sys | |
import datetime | |
import logging | |
import Queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
s3 = boto.connect_s3() | |
bucket = s3.lookup('mybucket') | |
key = bucket.lookup('mykey') | |
# Copy the key onto itself, preserving the ACL but changing the content-type | |
key.copy(key.bucket, key.name, preserve_acl=True, metadata={'Content-Type': 'text/plain'}) | |
key = bucket.lookup('mykey') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import boto | |
>>> c = boto.connect_ec2() | |
>>> reservations = c.get_all_instances() | |
>>> reservations | |
[Reservation:r-b73716d6] | |
>>> instance = reservations[0].instances[0] | |
>>> instance | |
Instance:i-366c4354 | |
>>> instance.tags | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
elb = boto.connect_elb() | |
ec2 = boto.connect_ec2() | |
load_balancers = elb.get_all_load_balancers() | |
# | |
# The InstanceInfo object in the LoadBalancer object contains only a small subset | |
# of information about the Instance. To get the full set of information, you have |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will cause full debug output to go to the console | |
>>> import boto | |
>>> boto.set_stream_logger('foo') | |
>>> ec2 = boto.connect_ec2(debug=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import boto | |
>>> ec2 = boto.connect_ec2() | |
>>> stats = ec2.get_all_instance_status() | |
>>> stats | |
[InstanceStatus:i-67c81e0c] | |
>>> stat = stats[0] | |
>>> stat | |
InstanceStatus:i-67c81e0c | |
>>> stat.id | |
u'i-67c81e0c' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) | |
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import boto | |
>>> euca = boto.connect_euca() | |
>>> euca.get_all_images() | |
[Image:emi-DFEA10FF, Image:emi-DF0A1104, Image:emi-0CC81777, Image:emi-DF5F1113, Image:emi-DF0B1106, Image:emi-E9E51553, | |
... | |
Image:emi-169215C7, Image:emi-622216BC, Image:emi-E4C11567, Image:emi-B153146A, Image:emi-81BC1332] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Credentials] | |
... | |
euca_access_key_id=999999999999999999999999999999999999 | |
euca_secret_access_key=00000000000000000000000000000000000000 | |
... | |
[Boto] | |
... | |
eucalyptus_host =173.205.188.130 | |
walrus_host = 173.205.188.130 | |
... |