· 7 years ago · Dec 02, 2018, 02:28 AM
1#!/usr/bin/python
2
3# Simple example to list all s3 buckets in Walrus
4# Author: tom.ellis@eucalyptus.com
5
6import boto
7from boto.s3.connection import OrdinaryCallingFormat
8
9# Credentials
10access_key=""
11secret_key=""
12s3_host=""
13
14# Setup connection to Walrus
15conn = boto.connect_s3(aws_access_key_id=access_key,
16 aws_secret_access_key=secret_key,
17 is_secure=False,
18 host=s3_host,
19 port=8773,
20 path="/services/Walrus",
21 calling_format=OrdinaryCallingFormat())
22
23# Run commands
24buckets = conn.get_all_buckets()
25for b in buckets:
26 print b.name