aistore.sdk.client
Module Contents
Classes
API
AIStore client for managing buckets, objects, and ETL jobs.
Parameters:
AIStore endpoint.
If True, skip SSL certificate verification. If False (default), the ‘AIS_SKIP_VERIFY’ environment variable is also checked.
Path to a CA certificate file for SSL verification. If not provided, the ‘AIS_CLIENT_CA’ environment variable will be used. Defaults to None.
Path to a client certificate PEM file or a tuple (cert, key) for mTLS. If not provided, ‘AIS_CRT’ and ‘AIS_CRT_KEY’ environment variables will be used. Defaults to None.
Timeout for HTTP requests.
- Single float (e.g.,
5.0): Applies to both connection and read timeouts. - Tuple (e.g.,
(3.0, 20.0)): First value is the connection timeout, second is the read timeout. - Tuple with 0 (e.g.,
(0, 20.0)or(3.0, 0)): Use0to disable specific timeout. 0or0.0or(0, 0): Disables all timeouts.None(default): Check environment variables ‘AIS_CONNECT_TIMEOUT’ and ‘AIS_READ_TIMEOUT’. If env var is set to0, that specific timeout is disabled. Defaults to(3, 20)if not set.
Defines retry behavior for HTTP and network failures.
If not provided, the default retry configuration (RetryConfig.default()) is used.
Authorization token. If not provided, the ‘AIS_AUTHN_TOKEN’ environment variable will be used. Defaults to None.
Maximum number of connections per host in the connection pool. If not provided, the ‘AIS_MAX_CONN_POOL’ environment variable will be used, or defaults to 10.
Parse a timeout value from an environment variable.
Parameters:
Name of the environment variable to read
Default value to use if not set or parsing fails
Returns: Optional[float]
Parsed timeout value (None if 0, float otherwise), or default if invalid
Resolve max_pool_size value from parameter or environment variable.
Priority: explicit parameter > environment variable > default
Parameters:
max_pool_size parameter passed to init
Returns: int
Resolved max_pool_size value
Resolve timeout value from parameter or environment variables.
Priority: explicit parameter > environment variables > defaults
Special handling:
- timeout=0 or timeout=(0, 0) -> None (disable all timeouts)
- timeout=(0, 20) or timeout=(3, 0) -> convert 0 to None for that specific timeout
- timeout=None (default) -> check env vars, fallback to (3, 20)
- timeout=<value> -> use as-is (with 0 converted to None)
- AIS_CONNECT_TIMEOUT=0 -> None for connect timeout (no limit)
- AIS_READ_TIMEOUT=0 -> None for read timeout (no limit)
- Both env vars=0 -> None (disable all timeouts)
Parameters:
Timeout parameter passed to init
Returns: Optional[Union[float, Tuple[float, float]]]
Resolved timeout value, tuple (connect, read), or None if disabled
Factory constructor for Get-Batch API (MOSS - Multi-Object Streaming Service).
Efficiently retrieve multiple objects, archive files, or byte ranges in a single request, reducing network overhead and improving throughput for ML training workloads.
Parameters:
Objects to retrieve. Can be:
- Single object name: “file.txt”
- List of names: [“file1.txt”, “file2.txt”]
- Single Object instance
- List of Object instances
- None (add objects later via batch.add()) Note: if objects are specified as raw names (str or list of str), bucket must be provided
Default bucket for all objects
Archive format (tar, tgz, zip). Defaults to “.tar”
Continue on errors (missing files under 404/). Defaults to True
Use only obj name in archive path. Defaults to False
Stream resulting archive prior to finalizing it in memory. Defaults to True
Colocation hint for optimization. Defaults to Colocation.NONE.
- Colocation.NONE: no optimization - suitable for uniformly distributed data
- Colocation.TARGET_AWARE: target-aware - objects are collocated on few targets
- Colocation.TARGET_AND_SHARD_AWARE: target and shard-aware - enables archive handle reuse
Returns:
Batch object for building and executing Get-Batch requests
Factory constructor for bucket object. Does not make any HTTP request, only instantiates a bucket object.
Parameters:
Name of bucket
Provider of bucket, one of “ais”, “aws”, “gcp”, … (optional, defaults to ais)
Namespace of bucket (optional, defaults to None)
Returns:
The bucket object created.
Factory constructor for cluster object. Does not make any HTTP request, only instantiates a cluster object.
Returns:
The cluster object created.
Factory constructor for dSort object. Contains APIs related to AIStore dSort operations. Does not make any HTTP request, only instantiates a dSort object.
Parameters:
ID of the dSort job
Returns:
dSort object created
Factory constructor for ETL object. Contains APIs related to AIStore ETL operations. Does not make any HTTP request, only instantiates an ETL object.
Parameters:
Name of the ETL
Returns:
The ETL object created.
Creates an Object instance from a URL.
This method does not make any HTTP requests.
Parameters:
Full URL of the object (e.g., “ais://bucket1/file.txt”)
Returns: Object
The object constructed from the specified URL
Raises:
InvalidURLException: If the URL is invalid.
Factory constructor for job object, which contains job-related functions. Does not make any HTTP request, only instantiates a job object.
Parameters:
Optional ID for interacting with a specific job
Optional specific type of job empty for all kinds
Returns:
The job object created.