AFL.automation.shared.TiledProxyDriver#

An AFL API server backed by an existing Tiled HTTP service.

Functions

create_server(profile, *[, afl_home, ...])

Create an APIServer with AFL routes and native Tiled REST forwarding.

load_profile(filename)

Read connection settings from a private Tiled client or NAS YAML.

main()

Launch the proxy from a private Tiled connection profile.

parse_qsl(qs[, keep_blank_values, ...])

Parse a query given as a string argument.

rewrite_links(value, upstream, local)

Keep Tiled pagination and data links on the local proxy origin.

urlencode(query[, doseq, safe, encoding, ...])

Encode a dict or sequence of two-element tuples into a URL query string.

urljoin(base, url[, allow_fragments])

Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.

urlsplit(url[, scheme, allow_fragments])

Parse a URL into 5 components: <scheme>://<netloc>/<path>?<query>#<fragment>

urlunsplit(components)

Combine the elements of a tuple as returned by urlsplit() into a complete URL as a string.

Classes

Driver(name[, defaults, overrides, ...])

Path(*args, **kwargs)

PurePath subclass that can make system calls.

TiledProxyDriver([uri, api_key, ...])

Forward Tiled HTTP requests and provide the standard AFL browser.

AFL.automation.shared.TiledProxyDriver.load_profile(filename)[source]#

Read connection settings from a private Tiled client or NAS YAML.

class AFL.automation.shared.TiledProxyDriver.TiledProxyDriver(uri=None, api_key='', structure_clients=None, overrides=None, *, http_client=None, afl_home=None)[source]#

Forward Tiled HTTP requests and provide the standard AFL browser.

Parameters:
  • uri (str, optional) – Backend URL. When omitted, use the persistent driver configuration or the value supplied in overrides.

  • api_key (str, optional) – Backend API key, kept outside the persistent driver configuration.

  • structure_clients (str, optional) – Tiled structure client selection for the inherited AFL browser.

  • overrides (dict, optional) – Configuration values that override the driver defaults.

  • http_client (httpx.Client, optional) – HTTP client supplied by the caller, for example with a mock transport.

  • afl_home (str or pathlib.Path, optional) – Directory containing the driver’s persistent configuration.

defaults = {'structure_clients': 'dask', 'timeout': 10.0, 'uri': ''}#
__init__(uri=None, api_key='', structure_clients=None, overrides=None, *, http_client=None, afl_home=None)[source]#

Initialize configuration without opening a backend connection.

connect()[source]#

Create the backend HTTP client on first use.

close()[source]#

Close cached HTTP and Tiled clients; safe to call more than once.

status()[source]#

Return backend information without making a network request.

upstream_request(method, path, query=b'', body=b'', headers=None)[source]#

Forward one request using the configured backend credentials.

Keep Tiled pagination and data links on the local proxy origin.

AFL.automation.shared.TiledProxyDriver.create_server(profile, *, afl_home=None, http_client=None)[source]#

Create an APIServer with AFL routes and native Tiled REST forwarding.

AFL.automation.shared.TiledProxyDriver.main()[source]#

Launch the proxy from a private Tiled connection profile.