aistore.sdk.request_executor

View as Markdown

Module Contents

Classes

NameDescription
RequestExecutorExecutes HTTP requests without retry wrapping against a configured AIS endpoint over a

API

class aistore.sdk.request_executor.RequestExecutor(
base_url: str,
session_manager: aistore.sdk.session_manager.SessionManager,
token: str = '',
timeout: typing.Optional[typing.Union[float, typing.Tuple[float, float]]] = None
)

Executes HTTP requests without retry wrapping against a configured AIS endpoint over a provided SessionManager.

Parameters:

base_url
str

Fully-qualified endpoint URL including the API version prefix (e.g. https://proxy/v1).

session_manager
SessionManager

Shared per-process session pool.

token
strDefaults to ''

Bearer token added as the Authorization header when set.

timeout
Union[float, Tuple[float, float], None]Defaults to None

Request timeout in seconds; a single float. for both connect/read timeouts (e.g., 5.0), a tuple for separate connect/read timeouts (e.g., (3.0, 10.0)), or None to disable timeout.

base_url
str

Configured endpoint base URL (already including /v1).

session_manager
SessionManager

Shared SessionManager used to acquire the per-process session.

timeout
Optional[Union[float, Tuple[float, float]]]

Default request timeout applied when caller does not override.

token
str

Current bearer token.

aistore.sdk.request_executor.RequestExecutor._merge_headers(
headers: typing.Optional[typing.Dict[str, typing.Any]]
) -> typing.Dict[str, typing.Any]
aistore.sdk.request_executor.RequestExecutor._send(
method: str,
url: str,
headers: typing.Optional[typing.Dict[str, typing.Any]],
kwargs = {}
) -> requests.Response
aistore.sdk.request_executor.RequestExecutor.request(
method: str,
path: str,
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
kwargs = {}
) -> requests.Response

Send method to <base_url>/<path>.

Parameters:

method
str

HTTP method (GET, POST, …).

path
str

Path appended to base_url (leading slash optional).

headers
Dict[str, Any]Defaults to None

Caller-supplied headers; the AIS default Content-Type, User-Agent and Authorization headers are merged on top and will override.

**kwargs
Defaults to {}

Additional kwargs forwarded to requests.Session.request (params, data, json, stream, timeout, …).

aistore.sdk.request_executor.RequestExecutor.request_absolute(
method: str,
url: str,
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
kwargs = {}
) -> requests.Response

Send method to an absolute url (skip the base_url join).

Used by callers that have already resolved the full URL (e.g. the manual HTTPS redirect path in RequestClient, or a one-shot endpoint override).