l.s.d.a.AzureBlobsStorageDriver(StorageDriver) : class documentation

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

No class docstring
Method __init__ @param key: API key or username to be used (required) @type key: C{str}
Method iterate_containers @inherits: L{StorageDriver.iterate_containers}
Method iterate_container_objects @inherits: L{StorageDriver.iterate_container_objects}
Method get_container @inherits: L{StorageDriver.get_container}
Method get_object @inherits: L{StorageDriver.get_object}
Method create_container @inherits: L{StorageDriver.create_container}
Method delete_container @inherits: L{StorageDriver.delete_container}
Method download_object @inherits: L{StorageDriver.download_object}
Method download_object_as_stream @inherits: L{StorageDriver.download_object_as_stream}
Method upload_object Upload an object currently located on a disk.
Method upload_object_via_stream @inherits: L{StorageDriver.upload_object_via_stream}
Method delete_object @inherits: L{StorageDriver.delete_object}
Method ex_set_object_metadata Set metadata for an object
Method _xml_to_container Converts a container XML node to a container instance
Method _response_to_container Converts a HTTP response to a container instance
Method _xml_to_object Converts a BLOB XML node to an object instance
Method _response_to_object Converts a HTTP response to an object (from headers)
Method _get_container_path Return a container path
Method _get_object_path Return an object's CDN path.
Method _upload_in_chunks Uploads data from an interator in fixed sized chunks to S3
Method _commit_blocks Makes a final commit of the data.
Method _check_values Checks if extension arguments are valid
Method _update_metadata Update the given metadata in the headers
Method _prepare_upload_headers Prepare headers for uploading an object
Method _put_object Control function that does the real job of uploading data to a blob

Inherited from StorageDriver:

Method list_containers Return a list of containers.
Method list_container_objects Return a list of objects for the given container.
Method get_container_cdn_url Return a container CDN URL.
Method get_object_cdn_url Return a object CDN URL.
Method enable_container_cdn Enable container CDN.
Method enable_object_cdn Enable object CDN.
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 __init__(self, key, secret=None, secure=True, host=None, port=None, **kwargs): (source)
@param    key:    API key or username to be used (required)
@type     key:    C{str}

@param    secret: Secret password to be used (required)
@type     secret: C{str}

@param    secure: Weither to use HTTPS or HTTP. Note: Some providers
                    only support HTTPS, and it is on by default.
@type     secure: C{bool}

@param    host: Override hostname used for connections.
@type     host: C{str}

@param    port: Override port used for connections.
@type     port: C{int}

@param    api_version: Optional API version. Only used by drivers
                         which support multiple API versions.
@type     api_version: C{str}

@rtype: C{None}
def _xml_to_container(self, node): (source)
Converts a container XML node to a container instance

@param node: XML info of the container
@type node: L{xml.etree.ElementTree.Element}

@return: A container instance
@rtype: L{Container}
def _response_to_container(self, container_name, response): (source)
Converts a HTTP response to a container instance

@param container_name: Name of the container
@type container_name: C{str}

@param response: HTTP Response
@type node: L{}

@return: A container instance
@rtype: L{Container}
def _xml_to_object(self, container, blob): (source)
Converts a BLOB XML node to an object instance

@param container: Instance of the container holding the blob
@type: L{Container}

@param blob: XML info of the blob
@type blob: L{}

@return: An object instance
@rtype: L{Object}
def _response_to_object(self, object_name, container, response): (source)
Converts a HTTP response to an object (from headers)

@param object_name: Name of the object
@type object_name: C{str}

@param container: Instance of the container holding the blob
@type: L{Container}

@param response: HTTP Response
@type node: L{}

@return: An object instance
@rtype: L{Object}
def iterate_containers(self): (source)
@inherits: L{StorageDriver.iterate_containers}
def iterate_container_objects(self, container): (source)
@inherits: L{StorageDriver.iterate_container_objects}
def get_container(self, container_name): (source)
@inherits: L{StorageDriver.get_container}
def get_object(self, container_name, object_name): (source)
@inherits: L{StorageDriver.get_object}
def _get_container_path(self, container): (source)
Return a container path

@param container: Container instance
@type  container: L{Container}

@return: A path for this container.
@rtype: C{str}
def _get_object_path(self, container, object_name): (source)
Return an object's CDN path.

@param container: Container instance
@type  container: L{Container}

@param object_name: Object name
@type  object_name: L{str}

@return: A  path for this object.
@rtype: C{str}
def create_container(self, container_name): (source)
@inherits: L{StorageDriver.create_container}
def delete_container(self, container): (source)
@inherits: L{StorageDriver.delete_container}
def download_object(self, obj, destination_path, overwrite_existing=False, delete_on_failure=True): (source)
@inherits: L{StorageDriver.download_object}
def download_object_as_stream(self, obj, chunk_size=None): (source)
@inherits: L{StorageDriver.download_object_as_stream}
def _upload_in_chunks(self, response, data, iterator, object_path, blob_type, lease, calculate_hash=True): (source)
Uploads data from an interator in fixed sized chunks to S3

@param response: Response object from the initial POST request
@type response: L{RawResponse}

@param data: Any data from the initial POST request
@type data: C{str}

@param iterator: The generator for fetching the upload data
@type iterator: C{generator}

@param object_path: The path of the object to which we are uploading
@type object_name: C{str}

@param blob_type: The blob type being uploaded
@type blob_type: C{str}

@param lease: The lease object to be used for renewal
@type lease: L{AzureBlobLease}

@keyword calculate_hash: Indicates if we must calculate the data hash
@type calculate_hash: C{bool}

@return: A tuple of (status, checksum, bytes transferred)
@rtype: C{tuple}
def _commit_blocks(self, object_path, chunks, lease): (source)
Makes a final commit of the data.

@param object_path: Server side object path.
@type object_path: C{str}

@param upload_id: A list of (chunk_number, chunk_hash) tuples.
@type upload_id: C{list}
def _check_values(self, blob_type, object_size): (source)
Checks if extension arguments are valid

@param blob_type: The blob type that is being uploaded
@type blob_type: C{str}

@param object_size: The (max) size of the object being uploaded
@type object_size: C{int}
def upload_object(self, file_path, container, object_name, extra=None, verify_hash=True, ex_blob_type=None, ex_use_lease=False): (source)
Upload an object currently located on a disk.

@inherits: L{StorageDriver.upload_object}

@param ex_blob_type: Storage class
@type ex_blob_type: C{str}

@param ex_use_lease: Indicates if we must take a lease before upload
@type ex_use_lease: C{bool}
def upload_object_via_stream(self, iterator, container, object_name, verify_hash=False, extra=None, ex_use_lease=False, ex_blob_type=None, ex_page_blob_size=None): (source)
@inherits: L{StorageDriver.upload_object_via_stream}

@param ex_blob_type: Storage class
@type ex_blob_type: C{str}

@param ex_page_blob_size: The maximum size to which the
    page blob can grow to
@type ex_page_blob_size: C{int}

@param ex_use_lease: Indicates if we must take a lease before upload
@type ex_use_lease: C{bool}
def delete_object(self, obj): (source)
@inherits: L{StorageDriver.delete_object}
def _update_metadata(self, headers, meta_data): (source)
Update the given metadata in the headers

@param headers: The headers dictionary to be updated
@type headers: C{dict}

@param meta_data: Metadata key value pairs
@type meta_data: C{dict}
def _prepare_upload_headers(self, object_name, object_size, extra, meta_data, blob_type): (source)
Prepare headers for uploading an object

@param object_name: The full name of the object being updated
@type object_name: C{str}

@param object_size: The size of the object. In case of PageBlobs,
    this indicates the maximum size the blob can grow to
@type object_size: C{int}

@param extra: Extra control data for the upload
@type extra: C{dict}

@param meta_data: Metadata key value pairs
@type meta_data: C{dict}

@param blob_type: Page or Block blob type
@type blob_type: C{str}
def _put_object(self, container, object_name, object_size, upload_func, upload_func_kwargs, file_path=None, extra=None, verify_hash=True, blob_type=None, use_lease=False): (source)
Control function that does the real job of uploading data to a blob
def ex_set_object_metadata(self, obj, meta_data): (source)
Set metadata for an object

@param obj: The blob object
@type obj: L{Object}

@param meta_data: Metadata key value pairs
@type meta_data: C{dict}
API Documentation for libcloud, generated by pydoctor at 2013-09-18 15:42:48.