Skip to content

Instantly share code, notes, and snippets.

@tomellis
Created August 15, 2012 12:31
Show Gist options
  • Save tomellis/3359742 to your computer and use it in GitHub Desktop.
Save tomellis/3359742 to your computer and use it in GitHub Desktop.
Walrus Boto Example
#!/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