class documentation

class S3StorageDriverClient(ABC): (source)

View In Hierarchy

Abstract base class for S3 object operations.

Implementations must support put_object and get_object. Multipart upload handling (if needed) is an internal concern of each implementation.

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 S3 bucket and key.
Async Method object_exists Return True if an object exists at the given bucket and key.
Async Method put_object Upload data to the given S3 bucket and key.
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, key: str) -> bytes: (source)

Download and return the bytes stored at the given S3 bucket and key.

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

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

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

Upload data to the given S3 bucket and key.