aistore.sdk.obj.object
Module Contents
Classes
API
Metadata about a bucket, used by objects within that bucket.
Provides methods for interacting with an object in AIS.
Parameters:
Client used for all http requests.
Metadata about the bucket to which this object belongs.
Name of the object.
Properties of the object, as updated by head(), optionally pre-initialized.
Name of the bucket where this object resides.
Provider of the bucket where this object resides (e.g. ais, s3, gcp).
Name of this object.
Get the latest properties of the object.
This will make a HEAD request to the AIStore cluster to fetch up-to-date object headers
and refresh the internal _props cache. Use this when you want to ensure you’re accessing
the most recent metadata for the object.
Get the cached object properties (without making a network call).
This is useful when:
- You want to avoid a network request.
- You’re sure the cached
_propswas already set via a previous call tohead()or during object construction.
Query params used as a base for constructing all requests for this object.
Unified name (uname) of this object, which combines the bucket path and object name.
A special facility to download very large remote objects a.k.a. BLOBs Returns job ID that for the blob download operation.
Parameters:
chunk size in bytes
number of concurrent blob-downloading workers (readers)
GET the latest object version from the associated remote bucket
Returns: str
Job ID (as str) that can be used to check the status of the operation
Raises:
aistore.sdk.errors.AISError: All other types of errors with AIStorerequests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.exceptions.HTTPError: Service unavailablerequests.RequestException: “There was an ambiguous exception that occurred while handling…”
Copy this object to another object (which specifies the destination bucket and name), optionally with ETL transformation.
Parameters:
Destination object specifying both the target bucket and object name
ETL configuration for transforming the object during copy
GET the latest object version from the associated remote bucket.
In addition to the latest, also entails removing remotely deleted objects
Returns: Response
The response from the copy operation
Raises:
requests.RequestException: “There’s 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: Service unavailable
Delete an object from a bucket.
Returns: Response
None
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
Creates and returns an ObjectReader with access to object contents and optionally writes to a provided writer.
Parameters:
Settings for archive extraction.
Settings for using blob download.
Chunk size in bytes. For parallel downloads (num_workers set), defaults to the server-provided optimal size. For sequential reads, defaults to DEFAULT_CHUNK_SIZE.
Settings for ETL-specific operations (name, args).
User-provided writer for writing content output. The user is responsible for closing the writer.
GET the latest object version from the associated remote bucket.
Byte range in RFC 7233 format for single-range requests (e.g., “bytes=0-499”, “bytes=500-”, “bytes=-500”). See: https://www.rfc-editor.org/rfc/rfc7233#section-2.1.
If True, the object content is read directly from the target node, bypassing the proxy.
If provided, enable parallel download — the object is split into byte ranges fetched concurrently by this many workers.
Returns: ObjectReader
An iterator for streaming object content.
Raises:
ValueError: Ifbyte_rangeis used withblob_download_config.requests.RequestException: If an error occurs during the request.requests.ConnectionError: If there is a connection error.requests.ConnectionTimeout: If the connection times out.requests.ReadTimeout: If the read operation times out.
Get the semantic URL to the object
Returns: str
Semantic URL to get object
Get the full url to the object including base url and any query parameters
Parameters:
If the object is an archive, use archpath to extract a single file
from the archive
Settings for ETL-specific operations (name, meta).
Returns: str
Full URL to get object
Create an ObjectWriter to write to object contents and attributes.
Returns: ObjectWriter
An ObjectWriter which can be used to write to an object’s contents and attributes.
Requests object properties and returns headers. Updates props.
Returns: CaseInsensitiveDict
Response header with the object properties.
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
Make a HEAD request with selective property retrieval (V2 API).
EXPERIMENTAL: This API is experimental and may change in future releases.
This method allows requesting specific object properties, reducing response size and processing overhead when only certain attributes are needed.
Parameters:
Comma-separated list of properties to retrieve. Available values: name, size, version, checksum, atime, present, copies, ec, custom, location, chunked, last-modified, etag. See: https://github.com/NVIDIA/aistore/blob/main/api/apc/lsmsg.go If empty, returns default properties (name, size).
Returns: ObjectAttributesV2
Parsed V2 object attributes (includes chunk info, last-modified, etag).
Create a multipart upload for this object.
Returns: MultipartUpload
A multipart upload instance for this object.
Promotes a file or folder an AIS target can access to a bucket in AIS storage. These files can be either on the physical disk of an AIS target itself or on a network file system the cluster can access. See more info here: https://aiatscale.org/blog/2022/03/17/promote
Parameters:
Path to file or folder the AIS cluster can reach
Promote files from a specific target node
Recursively promote objects from files in directories inside the path
Overwrite objects already on AIS
Delete the source files when done promoting
Optimize if the source is guaranteed to not be on a file share
Returns: str
Job ID (as str) that can be used to check the status of the operation, or empty if job is done synchronously
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 AIStoreAISError: Path does not exist on the AIS cluster storage