aistore.sdk.obj.object_client
aistore.sdk.obj.object_client
Module Contents
Classes
API
ObjectClient is a simple wrapper around a given RequestClient that makes requests to an individual object.
Parameters:
The RequestClient used to make HTTP requests
URL Path to the object
Query parameters for the request
HTTP request headers
Tuple representing the byte range
Unique (namespaced) name of the object (used for determining the target node)
Get the URL path for the object.
Initialize a new RequestClient pointing to the target node for the object.
Make a GET request with retry on object not found.
Parameters:
Request headers including any Range header.
Whether to stream the response.
Returns: requests.Response
requests.Response: The response object.
Raises:
ErrObjNotFound: If the object is not found and cannot be retried.
Retry the request with the latest smap if a 404 error is encountered.
Parameters:
HTTP method (e.g., GET, HEAD).
Additional arguments to pass to the request.
Returns: requests.Response
requests.Response: The response object from the retried request.
Fetch object content from AIS, applying an optional offset.
Parameters:
If True, stream the response content.
Byte offset for reading the object. Defaults to None.
Returns: requests.Response
requests.Response: The response object containing the content.
Raises:
ErrObjNotFound: If the object is not found and cannot be retried.requests.RequestException: For network-related errors.
Fetch a specific byte range of the object as a streaming response.
Use response.iter_content() to read the data in small pieces.
Parameters:
Start byte offset (inclusive).
End byte offset (exclusive).
Returns: requests.Response
requests.Response: Streaming response. Caller should close it.
Raises:
ErrObjNotFound: If the object is not found and cannot be retried.requests.RequestException: For network-related errors.
Make a head request to AIS to update and return only object attributes.
Returns: ObjectAttributes
ObjectAttributes containing metadata for this object.
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
ObjectAttributesV2 containing the requested metadata.