Package s3 :: Module service :: Class S3Service
[hide private]
[frames] | no frames]

Class S3Service

source code


S3 Service class.

Behaves like a dictionary of buckets, with some additional functions.

Instance Methods [hide private]
  __init__(self, pub_key, priv_key)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
S3Bucket or None get(self, name, default=None)
Get bucket with the exact name.
list list(self)
List all buckets.
S3Bucket create(self, name)
Create a bucket.
  delete(self, name)
Deletes a bucket.
list keys(self)
Returns a flat list of bucket names.
list values(self)
List all buckets.
list items(self)
Returns (key, value) pairs, where, keys are bucket names, and values are S3Buckets.
  has_key(self, key)
Does bucket exist.
  __getitem__(self, key)
Get a bucket instance.
  __delitem__(self, key)
Deletes a bucket

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, pub_key, priv_key)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

get(self, name, default=None)

source code 
Get bucket with the exact name.
Parameters:
  • name (string) - The name of the bucket
Returns: S3Bucket or None
Bucket if exists, else None

list(self)

source code 
List all buckets.
Returns: list
List of buckets associated with the authenticated user

create(self, name)

source code 
Create a bucket.
Parameters:
  • name (string) - Name for the new bucket
Returns: S3Bucket
Returns the newly created bucket

delete(self, name)

source code 
Deletes a bucket.
Parameters:
  • name (string) - Name of the queue that should be deleted

keys(self)

source code 
Returns a flat list of bucket names.
Returns: list
List of bucket names

values(self)

source code 
List all buckets.
Returns: list
List of buckets associated with the authenticated user

items(self)

source code 
Returns (key, value) pairs, where, keys are bucket names, and values are S3Buckets.
Returns: list
List of (bucket name, bucket) pairs

has_key(self, key)

source code 
Does bucket exist.

__getitem__(self, key)
(Indexing operator)

source code 
Get a bucket instance.

__delitem__(self, key)
(Index deletion operator)

source code 
Deletes a bucket