Skip to content

Instantly share code, notes, and snippets.

@HugoKuo
Last active August 29, 2015 13:58
Show Gist options
  • Save HugoKuo/10083753 to your computer and use it in GitHub Desktop.
Save HugoKuo/10083753 to your computer and use it in GitHub Desktop.
swiftstack@swiftstack-paco:~/source$ python s3-boto.py
1 2009-02-03T16:45:09.000Z
swiftstack@swiftstack-paco:~/source$ cat s3-boto.py
import boto
import boto.s3.connection
access_key = 'ss' #SwiftStack_AUTH user
secret_key = '5d1efb88b61231c1e4399e00caf68f7b' #s3key of the user
conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key,
host = '192.168.56.10', #The API_IP to API FQDN
is_secure=False, # comment it if you are using ssl
calling_format = boto.s3.connection.OrdinaryCallingFormat(),
)
for bucket in conn.get_all_buckets():
print "{name}\t{created}".format(
name = bucket.name,
created = bucket.creation_date,
)
swiftstack@swiftstack-paco:~/source$ swift stat 1
Account: AUTH_ss
Container: 1
Objects: 1
Bytes: 87
Read ACL:
Write ACL:
Sync To:
Sync Key:
Accept-Ranges: bytes
X-Timestamp: 1396870294.72537
X-Trans-Id: txfebb506904fb44a2958f0-0053435d0b
Content-Type: text/plain; charset=utf-8
swiftstack@swiftstack-paco:~/source$ date -d @1396870294.72537
Mon Apr 7 04:31:34 PDT 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment