wallaroo.wallaroo_ml_ops_api_client


A client library for accessing Wallaroo MLOps API

@define
class AuthenticatedClient:

A Client which has been authenticated for use on secured endpoints

The following are accepted as keyword arguments and will be used to construct httpx Clients internally:

``base_url``: The base URL for the API, all requests are made to a relative path to this URL

``cookies``: A dictionary of cookies to be sent with every request

``headers``: A dictionary of headers to be sent with every request

``timeout``: The maximum amount of a time a request can take. API functions will raise
httpx.TimeoutException if this is exceeded.

``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
but can be set to False for testing purposes.

``follow_redirects``: Whether or not to follow redirects. Default value is False.

``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.

Attributes: raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor. token: The token to use for authentication prefix: The prefix to use for the Authorization header auth_header_name: The name of the Authorization header

AuthenticatedClient( base_url: str, token: str, prefix: str = 'Bearer', auth_header_name: str = 'Authorization', *, raise_on_unexpected_status: bool = False, cookies: Dict[str, str] = NOTHING, headers: Dict[str, str] = NOTHING, timeout: Optional[httpx.Timeout] = None, verify_ssl: Union[str, bool, ssl.SSLContext] = True, follow_redirects: bool = False, httpx_args: Dict[str, Any] = NOTHING)

Method generated by attrs for class AuthenticatedClient.

raise_on_unexpected_status: bool
token: str
prefix: str
auth_header_name: str
def with_headers( self, headers: Dict[str, str]) -> wallaroo.wallaroo_ml_ops_api_client.AuthenticatedClient:

Get a new client matching this one with additional headers

def with_cookies( self, cookies: Dict[str, str]) -> wallaroo.wallaroo_ml_ops_api_client.AuthenticatedClient:

Get a new client matching this one with additional cookies

def with_timeout( self, timeout: httpx.Timeout) -> wallaroo.wallaroo_ml_ops_api_client.AuthenticatedClient:

Get a new client matching this one with a new timeout (in seconds)

def set_httpx_client( self, client: httpx.Client) -> wallaroo.wallaroo_ml_ops_api_client.AuthenticatedClient:

Manually the underlying httpx.Client

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

def get_httpx_client(self) -> httpx.Client:

Get the underlying httpx.Client, constructing a new one if not previously set

def set_async_httpx_client( self, async_client: httpx.AsyncClient) -> wallaroo.wallaroo_ml_ops_api_client.AuthenticatedClient:

Manually the underlying httpx.AsyncClient

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

def get_async_httpx_client(self) -> httpx.AsyncClient:

Get the underlying httpx.AsyncClient, constructing a new one if not previously set

@define
class Client:

A class for keeping track of data related to the API

The following are accepted as keyword arguments and will be used to construct httpx Clients internally:

``base_url``: The base URL for the API, all requests are made to a relative path to this URL

``cookies``: A dictionary of cookies to be sent with every request

``headers``: A dictionary of headers to be sent with every request

``timeout``: The maximum amount of a time a request can take. API functions will raise
httpx.TimeoutException if this is exceeded.

``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
but can be set to False for testing purposes.

``follow_redirects``: Whether or not to follow redirects. Default value is False.

``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.

Attributes: raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor.

Client( base_url: str, *, raise_on_unexpected_status: bool = False, cookies: Dict[str, str] = NOTHING, headers: Dict[str, str] = NOTHING, timeout: Optional[httpx.Timeout] = None, verify_ssl: Union[str, bool, ssl.SSLContext] = True, follow_redirects: bool = False, httpx_args: Dict[str, Any] = NOTHING)

Method generated by attrs for class Client.

raise_on_unexpected_status: bool
def with_headers( self, headers: Dict[str, str]) -> wallaroo.wallaroo_ml_ops_api_client.Client:

Get a new client matching this one with additional headers

def with_cookies( self, cookies: Dict[str, str]) -> wallaroo.wallaroo_ml_ops_api_client.Client:

Get a new client matching this one with additional cookies

def with_timeout( self, timeout: httpx.Timeout) -> wallaroo.wallaroo_ml_ops_api_client.Client:

Get a new client matching this one with a new timeout (in seconds)

def set_httpx_client( self, client: httpx.Client) -> wallaroo.wallaroo_ml_ops_api_client.Client:

Manually the underlying httpx.Client

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

def get_httpx_client(self) -> httpx.Client:

Get the underlying httpx.Client, constructing a new one if not previously set

def set_async_httpx_client( self, async_client: httpx.AsyncClient) -> wallaroo.wallaroo_ml_ops_api_client.Client:

Manually the underlying httpx.AsyncClient

NOTE: This will override any other settings on the client, including cookies, headers, and timeout.

def get_async_httpx_client(self) -> httpx.AsyncClient:

Get the underlying httpx.AsyncClient, constructing a new one if not previously set