flowclient.connection¶
Class Connection¶
Connection(*, url: str, token: str, api_version: int = 0, ssl_certificate: Union[str, bool] = True) -> None
A connection to a FlowKit API server.
Attributes¶
- 
url:strURL of the API server 
- 
token:strJSON Web Token for this API server 
- 
api_version:int, default0Version of the API to connect to 
- 
user:strUsername of token 
Parameters¶
- 
url:strURL of the API server, e.g. "https://localhost:9090" 
- 
token:strJSON Web Token for this API server 
- 
api_version:int, default0Version of the API to connect to 
- 
ssl_certificate:typing.Union, defaultTrueProvide 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: Optional[dict] = None, params: Optional[dict] = None) -> httpx.Response
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:strPath relative to API host to get 
- 
data:typing.Optional, defaultNoneJSON data to send in the request body (optional) 
- 
params:typing.Optional, defaultNoneData to send as query parameters. 
Returns¶
- httpx.Response
make_api_query¶
make_api_query(self, parameters: dict) -> 'APIQuery'
post_json¶
post_json(self, *, route: str, data: dict) -> httpx.Response
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:strPath relative to API host to post_json to 
- 
data:dictDictionary of json-encodeable data to post_json 
Returns¶
- httpx.Response
update_token¶
update_token(self, token: str) -> None
Replace this connection's API token with a new one.
Parameters¶
- 
token:strJSON Web Token for this API server