Part of libcloud.storage.drivers.s3 View Source View In Hierarchy
Known subclasses: libcloud.storage.drivers.google_storage.GoogleStorageDriver, libcloud.storage.drivers.s3.S3APNEStorageDriver, libcloud.storage.drivers.s3.S3APSEStorageDriver, libcloud.storage.drivers.s3.S3EUWestStorageDriver, libcloud.storage.drivers.s3.S3USWestOregonStorageDriver, libcloud.storage.drivers.s3.S3USWestStorageDriver
Method | list_containers | Return a list of containers. |
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 | 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 currently located on a disk. |
Method | upload_object_via_stream | Upload an object using an iterator. |
Method | delete_object | Delete an object. |
Method | _clean_object_name | Undocumented |
Method | _get_more | Undocumented |
Method | _put_object | Undocumented |
Method | _to_containers | Undocumented |
Method | _to_objs | Undocumented |
Method | _to_container | Undocumented |
Method | _headers_to_object | Undocumented |
Method | _to_obj | Undocumented |
Inherited from StorageDriver:
Method | __init__ | |
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 | 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. |
Returns | A list of Container instances. |
Parameters | container | Container instance (type: Container ) |
Returns | A list of Object instances. |
Parameters | container_name | Container name. (type: str ) |
Returns | Container instance. |
Parameters | container_name | Container name. (type: str ) |
object_name | Object name. (type: str ) | |
Returns | Object instance. |
Parameters | container_name | Container name. (type: str ) |
Returns | Container instance on success. |
Parameters | container | Container instance (type: Container ) |
Returns | True on success, False otherwise. (type: bool ) |
Parameters | obj | Object instance. (type: Object ) |
destination_path | Full path to a file or a directory where the incoming file will be saved. (type: str ) | |
overwrite_existing | True to overwrite an existing file, defaults to False. (type: bool ) | |
delete_on_failure | True to delete a partially downloaded file if the download was not
successful (hash mismatch / file size). (type: bool ) | |
Returns | True if an object has been successfully downloaded, False otherwise. (type: bool ) |
Parameters | obj | Object instance (type: Object ) |
chunk_size | Optional chunk size (in bytes). (type: int ) |
Parameters | file_path | Path to the object on disk. (type: str ) |
container | Destination container. (type: Container ) | |
object_name | Object name. (type: str ) | |
extra | (optional) Extra attributes (driver specific). (type: dict ) |
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.
Parameters | iterator | An object which implements the iterator interface. (type: object ) |
container | Destination container. (type: Container ) | |
object_name | Object 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 ) |
Parameters | obj | Object instance. (type: Object ) |
Returns | bool True on success. |