Created
August 15, 2012 12:31
-
-
Save tomellis/3359742 to your computer and use it in GitHub Desktop.
Walrus Boto Example
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
#!/usr/bin/python | |
# Simple example to list all s3 buckets in Walrus | |
# Author: tom.ellis@eucalyptus.com | |
import boto | |
from boto.s3.connection import OrdinaryCallingFormat | |
# Credentials | |
access_key="" | |
secret_key="" | |
s3_host="" | |
# Setup connection to Walrus | |
conn = boto.connect_s3(aws_access_key_id=access_key, | |
aws_secret_access_key=secret_key, | |
is_secure=False, | |
host=s3_host, | |
port=8773, | |
path="/services/Walrus", | |
calling_format=OrdinaryCallingFormat()) | |
# Run commands | |
buckets = conn.get_all_buckets() | |
for b in buckets: | |
print b.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment