air_sdk.client#

Classes#

Client

A session client for managing the execution of API requests.

Module Contents#

class air_sdk.client.Client(api_url: str)[source]#

Bases: requests.Session

A session client for managing the execution of API requests.

api_url#
connect_timeout#
read_timeout#
pagination_page_size = 200#
get_basic_headers() dict[str, str][source]#

Return generic headers for all requests.

static get_telemetry_headers() dict[str, str][source]#

Return telemetry-specific headers for all requests.

get_user_agent_header_value() str[source]#

Return the user agent header value.

get_http_adapter() requests.adapters.HTTPAdapter[source]#

Return an HTTP adapter for all requests.

get_retry_strategy() urllib3.util.Retry[source]#

Return a retry strategy for all requests. The following retry strategy will attempt to retry the request only if the connection fails.

hunt_for_sak() str[source]#
ngc_sak_login() None[source]#

Log in with Scoped API Key (SAK)

No args. Client must have directory ~/.ngc/config

ngc_device_login(email: str, ngc_org_name: str) None[source]#

Log in with device login - does not require a NGC API Key/SAK.

request(*args: Any, **kwargs: Any) requests.Response[source]#

Override request method to pass the timeout