class documentation

class GCSStorageDriverClient(ABC): (source)

View In Hierarchy

Abstract base class for GCS object operations.

Implementations must support object_exists, put_object, and get_object. Resumable uploads (if needed) are an internal concern of each implementation. Uploads must leave existing objects unchanged.

Warning

This API is experimental.

Method describe Return client-specific diagnostic metadata (e.g. region, credentials source) that the driver appends to error messages. Implementations may override this to surface configuration that is useful for debugging common misconfigurations...
Async Method get_object Download and return the bytes stored at the given GCS bucket and object_name.
Async Method object_exists Return True if an object exists at the given bucket and object_name.
Async Method put_object Upload data if absent at the given GCS bucket and object_name.
def describe(self) -> Mapping[str, str]: (source)

Return client-specific diagnostic metadata (e.g. region, credentials source) that the driver appends to error messages. Implementations may override this to surface configuration that is useful for debugging common misconfigurations. Returns an empty mapping by default.

@abstractmethod
async def get_object(self, *, bucket: str, object_name: str) -> bytes: (source)

Download and return the bytes stored at the given GCS bucket and object_name.

@abstractmethod
async def object_exists(self, *, bucket: str, object_name: str) -> bool: (source)

Return True if an object exists at the given bucket and object_name.

@abstractmethod
async def put_object(self, *, bucket: str, object_name: str, data: bytes): (source)

Upload data if absent at the given GCS bucket and object_name.