import ssh
import drivers
actor Client(tcp_connect_cap, address, username, password=None, key=None, protocol="ssh", port=22 if protocol == "ssh" else 23):
client = ssh.Client() if protocol == "ssh" else ..? telnet? or what? maybe just support ssh for now
driver = drivers.auto_detect(client) # figure out which driver to use, like IOS XR or JUNOS
def cmd(cb: action(err: ?Exception, response: ?str) -> None, command: str):
"""Run a command on device and return the result via callback
"""
driver.cmd(cb, command)
def conf(cb: action(err: ?Exception) -> None, config: list[str]):
"""Apply configuration on device
"""
driver.conf(cb, config)