l.s.d.c.CloudFilesStorageDriver(StorageDriver) : class documentation

Part of libcloud.storage.drivers.cloudfiles View Source View In Hierarchy

Known subclasses: libcloud.storage.drivers.cloudfiles.CloudFilesUKStorageDriver, libcloud.storage.drivers.cloudfiles.CloudFilesUSStorageDriver

Base CloudFiles driver.

You should never create an instance of this class directly but use US/US class.

Method list_containers Undocumented
Method list_container_objects Return a list of objects for the given container.
Method get_container Return a container instance.
Method get_object Return an object instance.
Method get_container_cdn_url Return a container CDN URL.
Method get_object_cdn_url Return a container CDN URL.
Method enable_container_cdn Undocumented
Method create_container Create a new container.
Method delete_container Delete a container.
Method download_object Download an object to the specified destination path.
Method download_object_as_stream Return a generator which yields object data.
Method upload_object Upload an object.
Method upload_object_via_stream Upload an object using an iterator.
Method delete_object Delete an object.
Method ex_get_meta_data Undocumented
Method _get_more Undocumented
Method _put_object Undocumented
Method _clean_container_name Clean container name.
Method _clean_object_name Undocumented
Method _to_container_list Undocumented
Method _to_object_list Undocumented
Method _headers_to_container Undocumented
Method _headers_to_object Undocumented

Inherited from StorageDriver:

Method __init__
Method list_containters Return a list of containers.
Method enable_object_cdn Undocumented
Method _get_object Call passed callback and start transfer of the object'
Method _save_object Save object to the provided path.
Method _upload_object Helper function for setting common request headers and calling the passed in callback which uploads an object.
Method _upload_data Upload data stored in a string.
Method _stream_data Stream a data over an http connection.
Method _upload_file Upload a file to the server.
Method _get_hash_function Return instantiated hash function for the hash type supported by the provider.

Inherited from BaseDriver (via StorageDriver):

Method _ex_connection_class_kwargs Return extra connection keyword arguments which are passed to the Connection class constructor.
def list_containers(self): (source)
Undocumented
def list_container_objects(self, container): (source)
Return a list of objects for the given container.
ParameterscontainerContainer instance (type: Container)
ReturnsA list of Object instances.
def get_container(self, container_name): (source)
Return a container instance.
Parameterscontainer_nameContainer name. (type: str)
ReturnsContainer instance.
def get_object(self, container_name, object_name): (source)
Return an object instance.
Parameterscontainer_nameContainer name. (type: str)
object_nameObject name. (type: str)
ReturnsObject instance.
def get_container_cdn_url(self, container): (source)
Return a container CDN URL.
ParameterscontainerContainer instance (type: Container)
ReturnsA CDN URL for this container.
def get_object_cdn_url(self, obj): (source)
Return a container CDN URL.
ParametersobjObject instance (type: Object)
ReturnsA CDN URL for this object.
def enable_container_cdn(self, container): (source)
Undocumented
def create_container(self, container_name): (source)
Create a new container.
Parameterscontainer_nameContainer name. (type: str)
ReturnsContainer instance on success.
def delete_container(self, container): (source)
Delete a container.
ParameterscontainerContainer instance (type: Container)
ReturnsTrue on success, False otherwise. (type: bool)
def download_object(self, obj, destination_path, overwrite_existing=False, delete_on_failure=True): (source)
Download an object to the specified destination path.
ParametersobjObject instance. (type: Object)
destination_pathFull path to a file or a directory where the incoming file will be saved. (type: str)
overwrite_existingTrue to overwrite an existing file, defaults to False. (type: bool)
delete_on_failureTrue to delete a partially downloaded file if the download was not successful (hash mismatch / file size). (type: bool)
ReturnsTrue if an object has been successfully downloaded, False otherwise. (type: bool)
def download_object_as_stream(self, obj, chunk_size=None): (source)
Return a generator which yields object data.
ParametersobjObject instance (type: Object)
chunk_sizeOptional chunk size (in bytes). (type: int)
def upload_object(self, file_path, container, object_name, extra=None, verify_hash=True): (source)
Upload an object.

Note: This will override file with a same name if it already exists.

def upload_object_via_stream(self, iterator, container, object_name, extra=None): (source)
Upload an object using an iterator.

If a provider supports it, chunked transfer encoding is used and you don't need to know in advance the amount of data to be uploaded.

Otherwise if a provider doesn't support it, iterator will be exhausted so a total size for data to be uploaded can be determined.

Note: Exhausting the iterator means that the whole data must be buffered in memory which might result in memory exhausting when uploading a very large object.

If a file is located on a disk you are advised to use upload_object function which uses fs.stat function to determine the file size and it doesn't need to buffer whole object in the memory.

ParametersiteratorAn object which implements the iterator interface. (type: object)
containerDestination container. (type: Container)
object_nameObject name. (type: str)
extra(optional) Extra attributes (driver specific).

Note: This dictionary must contain a 'content_type' key which represents a content type of the stored object.

(type: dict)
def delete_object(self, obj): (source)
Delete an object.
ParametersobjObject instance. (type: Object)
Returnsbool True on success.
def ex_get_meta_data(self): (source)
Undocumented
def _get_more(self, last_key, value_dict): (source)
Undocumented
def _put_object(self, container, object_name, upload_func, upload_func_kwargs, extra=None, file_path=None, iterator=None, verify_hash=True): (source)
Undocumented
def _clean_container_name(self, name): (source)
Clean container name.
def _clean_object_name(self, name): (source)
Undocumented
def _to_container_list(self, response): (source)
Undocumented
def _to_object_list(self, response, container): (source)
Undocumented
def _headers_to_container(self, name, headers): (source)
Undocumented
def _headers_to_object(self, name, container, headers): (source)
Undocumented
API Documentation for libcloud, generated by pydoctor at 2012-07-15 18:47:55.