aistore.sdk.obj.object_writer
aistore.sdk.obj.object_writer
Module Contents
Classes
API
Provide a way to write an object’s contents and attributes.
Append bytes as an object to a bucket in AIS storage.
Parameters:
Bytes to append to the object.
Handle string to use for subsequent appends or flush (empty for the first append).
Whether to flush and finalize the append operation, making the object accessible.
Returns: str
Handle string to pass for subsequent appends or flush.
Raises:
requests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStorerequests.exceptions.HTTPError(404): The object does not exist
Return a file-like object for writing object data.
Parameters:
Specifies the mode in which the file is opened (defaults to ‘a’).
Write mode. Opens the object for writing, truncating any existing content. Writing starts from the beginning of the object.
Append mode. Opens the object for appending. Existing content is preserved, and writing starts from the end of the object.
Returns: ObjectFileWriter
A file-like object for writing object data.
Raises:
ValueError: Invalid mode provided.
Puts bytes as an object to a bucket in AIS storage.
Parameters:
Bytes to put as an object.
Raises:
requests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStore
Puts a local file as an object to a bucket in AIS storage.
Parameters:
Path to local file
Raises:
requests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStoreValueError: The path provided is not a valid file
Set custom properties for the object.
Parameters:
Custom metadata key-value pairs.
Whether to replace existing metadata. Defaults to False.