AuroraObjects Storage Driver Documentation¶
PCextreme B.V. is a Dutch cloud provider. It provides a public cloud offering under the name AuroraCompute. All cloud services are under the family name Aurora.
All data is stored on servers in the European Union.
Protocol¶
AuroraObjects talks the Amazon S3 protocol and thus supports almost all functions which the Amazon S3 storage driver supports.
It however does not support CDN support. Calling any of the CDN functions will raise a LibcloudError.
As a backend AuroraObjects uses Ceph for storage.
Instantiating a driver¶
When instantiating the AuroraObjects you need a access key and secret key. These can be obtained from the Control Panel of AuroraObjects.
With these credentials you can instantiate the driver:
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
access_key = 'XXXXXX'
secret_key = 'YYYYYY'
cls = get_driver(Provider.AURORAOBJECTS)
driver = cls(access_key, secret_key)
Multipart uploads¶
AuroraObjects storage driver supports multipart uploads which means you can upload objects with a total size of up to 5 TB.
Multipart upload works similar to Amazon S3. After uploading all the parts the AuroraObjects servers combine the parts into one large object.
If you use
libcloud.storage.base.StorageDriver.upload_object_via_stream()
method,
Libcloud transparently handles all the splitting and uploading of the parts
for you.
By default, to prevent excessive buffering and use of memory, each part is 5 MB in size. This is also the smallest size of a part you can use with the multi part upload.
Examples¶
Please refer to the Amazon S3 storage driver documentation for examples.
API Docs¶
-
class
libcloud.storage.drivers.auroraobjects.
AuroraObjectsStorageDriver
(key, secret=None, secure=True, host=None, port=None, api_version=None, region=None, **kwargs)[source]¶ Parameters: - key (
str
) – API key or username to be used (required) - secret (
str
) – Secret password to be used (required) - secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default. - host (
str
) – Override hostname used for connections. - port (
int
) – Override port used for connections. - api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions. - region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
Return type: None
-
connectionCls
¶ alias of
BaseAuroraObjectsConnection
-
create_container
(container_name)¶ Create a new container.
Parameters: container_name ( str
) – Container name.Returns: Container instance on success. Return type: Container
-
delete_container
(container)¶ Delete a container.
Parameters: container ( Container
) – Container instanceReturns: True
on success,False
otherwise.Return type: bool
-
delete_object
(obj)¶ Delete an object.
Parameters: obj ( Object
) – Object instance.Returns: bool
True on success.Return type: bool
-
download_object
(obj, destination_path, overwrite_existing=False, delete_on_failure=True)¶ Download an object to the specified destination path.
Parameters: - obj (
Object
) – Object instance. - destination_path (
str
) – Full path to a file or a directory where the incoming file will be saved. - overwrite_existing (
bool
) – True to overwrite an existing file, defaults to False. - delete_on_failure (
bool
) – True to delete a partially downloaded file if the download was not successful (hash mismatch / file size).
Returns: True if an object has been successfully downloaded, False otherwise.
Return type: bool
- obj (
-
download_object_as_stream
(obj, chunk_size=None)¶ Return a generator which yields object data.
Parameters: - obj (
Object
) – Object instance - chunk_size (
int
) – Optional chunk size (in bytes).
- obj (
-
enable_container_cdn
(*argv)[source]¶ Enable container CDN.
Parameters: container ( Container
) – Container instanceReturn type: bool
-
enable_object_cdn
(*argv)[source]¶ Enable object CDN.
Parameters: obj ( Object
) – Object instanceReturn type: bool
-
ex_cleanup_all_multipart_uploads
(container, prefix=None)¶ Extension method for removing all partially completed S3 multipart uploads.
Parameters: - container (
Container
) – The container holding the uploads - prefix (
str
) – Delete only uploads of objects with this prefix
- container (
-
ex_iterate_multipart_uploads
(container, prefix=None, delimiter=None)¶ Extension method for listing all in-progress S3 multipart uploads.
Each multipart upload which has not been committed or aborted is considered in-progress.
Parameters: - container (
Container
) – The container holding the uploads - prefix (
str
) – Print only uploads of objects with this prefix - delimiter (
str
) – The object/key names are grouped based on being split by this delimiter
Returns: A generator of S3MultipartUpload instances.
Return type: generator
ofS3MultipartUpload
- container (
-
get_container
(container_name)¶ Return a container instance.
Parameters: container_name ( str
) – Container name.Returns: Container
instance.Return type: Container
-
get_container_cdn_url
(*argv)[source]¶ Return a container CDN URL.
Parameters: container ( Container
) – Container instanceReturns: A CDN URL for this container. Return type: str
-
get_object
(container_name, object_name)¶ Return an object instance.
Parameters: - container_name (
str
) – Container name. - object_name (
str
) – Object name.
Returns: Object
instance.Return type: Object
- container_name (
-
get_object_cdn_url
(*argv)[source]¶ Return an object CDN URL.
Parameters: obj ( Object
) – Object instanceReturns: A CDN URL for this object. Return type: str
-
iterate_container_objects
(container, ex_prefix=None)¶ Return a generator of objects for the given container.
Parameters: - container (
Container
) – Container instance - ex_prefix (
str
) – Only return objects starting with ex_prefix
Returns: A generator of Object instances.
Return type: generator
ofObject
- container (
-
iterate_containers
()¶ Return a generator of containers for the given account
Returns: A generator of Container instances. Return type: generator
ofContainer
-
list_container_objects
(container, ex_prefix=None)¶ Return a list of objects for the given container.
Parameters: - container (
Container
) – Container instance. - ex_prefix (
str
) – Only return objects starting with ex_prefix
Returns: A list of Object instances.
Return type: list
ofObject
- container (
-
list_containers
()¶ Return a list of containers.
Returns: A list of Container instances. Return type: list
ofContainer
-
upload_object
(file_path, container, object_name, extra=None, verify_hash=True, ex_storage_class=None)¶ @inherits:
StorageDriver.upload_object
Parameters: ex_storage_class ( str
) – Storage class
-
upload_object_via_stream
(iterator, container, object_name, extra=None, ex_storage_class=None)¶ @inherits:
StorageDriver.upload_object_via_stream
Parameters: ex_storage_class ( str
) – Storage class
- key (