- class composer.utils.ObjectStore#
Abstract class for implementing object stores, such as LibcloudObjectStore and S3ObjectStore.
Close the object store.
- download_object(object_name, filename, overwrite=False, callback=None)#
Download an object to the specified destination path.
object_name (str) – The name of the object to download.
overwrite (bool, optional) – Whether to overwrite an existing file at
filename, if it exists. (default:
callback ((int) -> None, optional) – If specified, the callback is periodically called with the number of bytes already downloaded and the total size of the object.
Get the size of an object, in bytes.
Returns the URI for
This function does not check that
object_nameis in the object store. It computes the URI statically.
object_name (str) – The object name.
str – The URI for
object_namein the object store.
List all objects in the object store with the given prefix.
prefix (str) – The prefix to search for.
list[str] – A list of object names that match the prefix.
- upload_object(object_name, filename, callback=None, **kwargs)#
Upload an object currently located on a disk.
object_name (str) – Object name (where object will be stored in the container)
**kwargs – other arguments to the upload object function are supported and will be passed in to the underlying object store upload call. Currently only used for S3ObjectStore.
ObjectStoreTransientError – If there was a transient connection issue with uploading the object.