class documentation

class SwiftConnector(object):

View In Hierarchy

A Connector to swift that manage authentication and errors catching

Method __init__ Initialize a SwiftConnector
Method create_root Create the Swift container
Method del_object Delete an object
Method del_root Delete the root container by removing container content
Method get_container_objects Retrieve objects list in a container
Method get_object Retrieve an object
Method get_object_stat Retrieve object stat
Method put_object Put an object
Method swift_auth_v1 Undocumented
Method swift_auth_v2 Undocumented
Method test_root_exists Check that Swift container exist
Instance Variable auth_url Undocumented
Instance Variable auth_ver Undocumented
Instance Variable base_path Undocumented
Instance Variable cache_length Undocumented
Instance Variable chunk_length Undocumented
Instance Variable concurrency Undocumented
Instance Variable conf Undocumented
Instance Variable endpoint_type Undocumented
Instance Variable http_pool_length Undocumented
Instance Variable http_timeout Undocumented
Instance Variable httpclient Undocumented
Instance Variable password Undocumented
Instance Variable region_name Undocumented
Instance Variable root Undocumented
Instance Variable storage_url Undocumented
Instance Variable tenant Undocumented
Instance Variable token Undocumented
Instance Variable user Undocumented
def __init__(self, root, conf):

Initialize a SwiftConnector

Parameters
rootThe swift container that will act as Git bare repository
confA ConfigParser Object
def create_root(self):

Create the Swift container

Raises
SwiftExceptionif unable to create
def del_object(self, name):

Delete an object

Parameters
nameThe object name
Raises
SwiftExceptionif unable to delete
def del_root(self):

Delete the root container by removing container content

Raises
SwiftExceptionif unable to delete
def get_container_objects(self):

Retrieve objects list in a container

Returns: A list of dict that describe objects
or None if container does not exist
def get_object(self, name, range=None):

Retrieve an object

Parameters
nameThe object name
rangeA string range like "0-10" to retrieve specified bytes in object content
Returns
A file like instance or bytestring if range is specified
def get_object_stat(self, name):

Retrieve object stat

Parameters
nameThe object name
Returns
A dict that describe the object or None if object does not exist
def put_object(self, name, content):

Put an object

Parameters
nameThe object name
contentA file object
Raises
SwiftExceptionif unable to create
def swift_auth_v1(self):

Undocumented

def swift_auth_v2(self):

Undocumented

def test_root_exists(self):

Check that Swift container exist

Returns: True if exist or None it not

auth_url =

Undocumented

auth_ver =

Undocumented

base_path =

Undocumented

cache_length =

Undocumented

chunk_length =

Undocumented

concurrency =

Undocumented

conf =

Undocumented

endpoint_type =

Undocumented

http_pool_length =

Undocumented

http_timeout =

Undocumented

httpclient =

Undocumented

password =

Undocumented

region_name =

Undocumented

root =

Undocumented

storage_url =

Undocumented

tenant =

Undocumented

token =

Undocumented

user =

Undocumented