24
24
25
25
class Client :
26
26
"""
27
- AIStore client for managing buckets, objects, ETL jobs
27
+ AIStore client for managing buckets, objects, and ETL jobs.
28
28
29
29
Args:
30
- endpoint (str): AIStore endpoint
30
+ endpoint (str): AIStore endpoint.
31
31
skip_verify (bool, optional): If True, skip SSL certificate verification. Defaults to False.
32
- ca_cert (str, optional): Path to a CA certificate file for SSL verification. If not provided, the
33
- 'AIS_CLIENT_CA' environment variable will be used. Defaults to None.
32
+ ca_cert (str, optional): Path to a CA certificate file for SSL verification. If not provided,
33
+ the 'AIS_CLIENT_CA' environment variable will be used. Defaults to None.
34
34
client_cert (Union[str, Tuple[str, str], None], optional): Path to a client certificate PEM file
35
- or a path pair (cert, key) for mTLS. If not provided, 'AIS_CRT' and 'AIS_CRT_KEY'
36
- environment variables will be used. Defaults to None.
37
- timeout (Union[float, Tuple[float, float], None], optional): Request timeout in seconds; a single float
38
- for both connect/read timeouts (e.g., 5.0), a tuple for separate connect/read timeouts (e.g., (3.0, 10.0)),
35
+ or a tuple (cert, key) for mTLS. If not provided, 'AIS_CRT' and 'AIS_CRT_KEY' environment
36
+ variables will be used. Defaults to None.
37
+ timeout (Union[float, Tuple[float, float], None], optional): Request timeout in seconds.
38
+ Can be a single float (e.g., 5.0) for both connect/read timeouts, a tuple (e.g., (3.0, 10.0)),
39
39
or None to disable timeout.
40
- retry (urllib3.Retry, optional): Retry configuration object from the urllib3 library.
40
+ retry (urllib3.Retry, optional): Retry configuration object from the urllib3 library. Defaults to None.
41
41
token (str, optional): Authorization token. If not provided, the 'AIS_AUTHN_TOKEN' environment variable
42
42
will be used. Defaults to None.
43
+ max_pool_size (int, optional): Maximum number of connections per host in the connection pool.
44
+ Defaults to 10.
43
45
"""
44
46
45
47
# pylint: disable=too-many-arguments
@@ -52,17 +54,20 @@ def __init__(
52
54
timeout : Optional [Union [float , Tuple [float , float ]]] = None ,
53
55
retry : Optional [Retry ] = None ,
54
56
token : Optional [str ] = None ,
57
+ max_pool_size : int = 10 ,
55
58
):
56
59
session_manager = SessionManager (
57
60
retry = retry ,
58
61
ca_cert = ca_cert ,
59
62
client_cert = client_cert ,
60
63
skip_verify = skip_verify ,
64
+ max_pool_size = max_pool_size ,
61
65
)
62
66
63
67
# Check for token from arguments or environment variable
64
68
if not token :
65
- token = os .environ .get (AIS_AUTHN_TOKEN , None )
69
+ token = os .environ .get (AIS_AUTHN_TOKEN )
70
+
66
71
self ._request_client = RequestClient (
67
72
endpoint = endpoint ,
68
73
session_manager = session_manager ,
0 commit comments