Client

The client package contains functionality for user authentication and logging requests.

Client.auth

Client.client

class firebolt.client.client.AsyncClient(*args: Any, account_name: Optional[str] = None, api_endpoint: str = 'api.app.firebolt.io', auth: Optional[Auth] = None, **kwargs: Any)

Bases: FireboltClientMixin, AsyncClient

An HTTP client, based on httpx.AsyncClient.

Asyncronously handles authentication for Firebolt database. Authentication can be passed through auth keyword as a tuple or as a FireboltAuth instance

account_id

User account id.

If account_name was provided during AsyncClient construction, returns it’s id. Gets default account otherwise

Returns

Account ID

Return type

str

Raises

AccountNotFoundError – No account found with provided name

class firebolt.client.client.Client(*args: Any, account_name: Optional[str] = None, api_endpoint: str = 'api.app.firebolt.io', auth: Optional[Auth] = None, **kwargs: Any)

Bases: FireboltClientMixin, Client

An HTTP client, based on httpx.Client.

Handles the authentication for Firebolt database. Authentication can be passed through auth keyword as a tuple or as a FireboltAuth instance

property account_id: str

User account id.

If account_name was provided during Client construction, returns it’s id. Gets default account otherwise

Returns

Account ID

Return type

str

Raises

AccountNotFoundError – No account found with provided name

Client.resource_manager_hooks

firebolt.client.resource_manager_hooks.log_request(request: Request) None

Log HTTP requests.

Hook for an HTTP client

Parameters

request (Request) – Request to log

firebolt.client.resource_manager_hooks.log_response(response: Response) None

Log HTTP response.

Hook for an HTTP client

Parameters

response (Response) – Response to log

firebolt.client.resource_manager_hooks.raise_on_4xx_5xx(response: Response) None

Raise an error on HTTP response with error return code.

Hook for an HTTP client If an error is message is found raise as an ApiError

Parameters

response (Response) – Response to check for error code

Raises
  • RequestError – Error during performing request

  • RuntimeError – Error processing request on server

  • HTTPStatusError – HTTP error