netlab.async_client

NetlabClient is the main entrypoint to the NETLAB+ SDK.

Only NetlabClient should be created directly. See the mixin classes for a full list of methods:

Usage

async with NetlabClient() as client:
    client: NetlabConnection

    status = await client.system_status_get()

Classes

EventStream(connection, queue)

Used to collect events from a netlab subscription.

EventStreamFactory(connection, event, criteria)

Used to create an event stream.

NetlabClient([system, config, config_path])

Async Context Manager for creating connections to NETLAB+.

NetlabConnection(reader, writer, config)

An active connection to a NETLAB+ used to communicate with it.

class netlab.async_client.NetlabClient(system='default', config=None, config_path=None)

Async Context Manager for creating connections to NETLAB+.

Parameters:
  • system (str | None) – The name to identify a NETLAB+ system. Defaults to ‘default’.

  • config (None | NetlabServerConfig | Dict[str, Any]) – Configuration options. See below for all possible options for the config.

  • config_path (str | None) – File path location of a JSON config file to be used instead of the default location.

class netlab.async_client.NetlabConnection(reader, writer, config)

An active connection to a NETLAB+ used to communicate with it. Should only be created by a NetlabClient.

async call(method, **kwargs)
Parameters:
  • method (str) – The NETLAB+ method name.

  • kwargs (Any) – The arguments to pass to netlab.

Warning

In most cases, it is better to use the higher level methods, rather than this low level method.