#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
# Project: Atmosphere, iPlant Collaborative
# Author: <NAME>
# Twitter: @seungjin
# GitHub: seungjin
#

import getopt, sys, os
import logging


my_euca_storage = "http://172.16.17.32:8773/services/Walrus"
my_euca_access = "<KEY>"
my_euca_secret = "<KEY>"

my_euca_host = "172.16.17.32"
my_euca_port = 8773
my_euca_path = "/services/Walrus"

#iplant_aws_access = '<KEY>'
#iplant_aws_secret = '<KEY>'

from boto.s3.connection import S3Connection
from boto.s3.connection import OrdinaryCallingFormat


conn = S3Connection(my_euca_access,
                    my_euca_secret,
                    is_secure=False,
                    host=my_euca_host,
                    port=my_euca_port,
                    path=my_euca_path,
                    #provider='eucalyptus',
                    #bucket_class=Bucket,
                    calling_format=OrdinaryCallingFormat(),
                    debug=0)



bucket = conn.create_bucket('test')
from boto.s3.key import Key
k = Key(bucket)
k.key = 'foobar'
k.set_contents_from_string('hello world')

rs = conn.get_all_buckets()
for b in rs:
  print b



#mehods


def create_bucket():
  pass

def get_all_buckets():
  pass

def set_contents():
  pass



#
# The contents of this file are subject to the terms listed in the LICENSE file you received with this code.
#
# Project: Atmosphere, iPlant Collaborative
# Author: <NAME>
# Twitter: @seungjin
# GitHub: seungjin
#

import getopt, sys, os
import logging


my_euca_storage = "http://172.16.17.32:8773/services/Walrus"
my_euca_access = "<KEY>"
my_euca_secret = "<KEY>"

my_euca_host = "172.16.17.32"
my_euca_port = 8773
my_euca_path = "/services/Walrus"

#iplant_aws_access = '<KEY>'
#iplant_aws_secret = '<KEY>'

from boto.s3.connection import S3Connection
from boto.s3.connection import OrdinaryCallingFormat


conn = S3Connection(my_euca_access,
                    my_euca_secret,
                    is_secure=False,
                    host=my_euca_host,
                    port=my_euca_port,
                    path=my_euca_path,
                    #provider='eucalyptus',
                    #bucket_class=Bucket,
                    calling_format=OrdinaryCallingFormat(),
                    debug=0)



bucket = conn.create_bucket('test')
from boto.s3.key import Key
k = Key(bucket)
k.key = 'foobar'
k.set_contents_from_string('hello world')

rs = conn.get_all_buckets()
for b in rs:
  print b



#mehods


def create_bucket():
  pass

def get_all_buckets():
  pass

def set_contents():
  pass



# # The contents of this file are subject to the terms listed in the LICENSE file you received with this code. # # Project: Atmosphere, iPlant Collaborative # Author: <NAME> # Twitter: @seungjin # GitHub: seungjin # #iplant_aws_access = '<KEY>' #iplant_aws_secret = '<KEY>' #provider='eucalyptus', #bucket_class=Bucket, #mehods