Skip to content

flowclient.async_connection

Class ASyncConnection

ASyncConnection(*, url: str, token: str, api_version: int = 0, ssl_certificate: Union[str, NoneType] = None) -> 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, NoneType], default None

    Provide a path to an ssl certificate to use, or None to use default root certificates.

Methods

get_url

get_url(self, *, route: str, data: Union[NoneType, dict] = None) -> requests.models.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
  • requests.models.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) -> requests.models.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
  • requests.models.Response