Google Storage Storage Driver Documentation¶
Current version of the Google Storage driver in Libcloud uses S3 compatibility layer and as such, only supports XML API v1.0.
If you are a new Google Cloud Storage customers, you need to enable API v1.0 access and choose a default project in the Google Cloud Console for driver to work.
For information on how to do that, please see the official documentation.
If you don’t do that, you will get a message that the request is missing a project id header.
API Docs¶
- class libcloud.storage.drivers.google_storage.GoogleStorageDriver(key, secret=None, secure=True, host=None, port=None, **kwargs)[source]¶
- connectionCls¶
alias of GoogleStorageConnection
- enable_container_cdn(container)¶
Enable container CDN.
Parameters: container (Container) – Container instance Return type: bool
- enable_object_cdn(obj)¶
Enable object CDN.
Parameters: obj (Object) – Object instance Return 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
- 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 of S3MultipartUpload
- get_container_cdn_url(container)¶
Return a container CDN URL.
Parameters: container (Container) – Container instance Returns: A CDN URL for this container. Return type: str
- get_object_cdn_url(obj)¶
Return a object CDN URL.
Parameters: obj (Object) – Object instance Returns: 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 of Object
- 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 of Object
- list_containers()¶
Return a list of containers.
Returns: A list of Container instances. Return type: list of Container
- 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