Skip to content

flowclient.async_connection

Class ASyncConnection

ASyncConnection(*, url: str, token: str, api_version: int = 0, ssl_certificate: Union[str, bool] = True) -> None
Source: flowclient/async_connection.py

A connection to a FlowKit API server.

Attributes

  • url: str

    URL of the API server

  • token: str

    JSON Web Token for this API server

  • api_version: int, default 0

    Version of the API to connect to

  • user: str

    Username of token

Parameters

  • url: str

    URL of the API server, e.g. "https://localhost:9090"

  • token: str

    JSON Web Token for this API server

  • api_version: int, default 0

    Version of the API to connect to

  • ssl_certificate: typing.Union[str, bool], default True

    Provide a path to an ssl certificate to use, True to use default root certificates, or False to disable ssl verification.

Methods

get_url

get_url(self, *, route: str, data: Union[NoneType, dict] = None) -> httpx.Response
Source: flowclient/async_connection.py

Attempt to get something from the API, and return the raw response object if an error response wasn't received. If an error response was received, raises an error.

Parameters
  • route: str

    Path relative to API host to get

  • data: typing.Union[NoneType, dict], default None

    JSON data to send in the request body (optional)

Returns
  • httpx.Response

make_api_query

make_api_query(self, parameters: dict) -> 'AsyncAPIQuery'
Source: flowclient/async_connection.py

post_json

post_json(self, *, route: str, data: dict) -> httpx.Response
Source: flowclient/async_connection.py

Attempt to post json to the API, and return the raw response object if an error response wasn't received. If an error response was received, raises an error.

Parameters
  • route: str

    Path relative to API host to post_json to

  • data: dict

    Dictionary of json-encodeable data to post_json

Returns
  • httpx.Response

update_token

update_token(self, token: str) -> None
Source: flowclient/async_connection.py

Replace this connection's API token with a new one.

Parameters
  • token: str

    JSON Web Token for this API server