diff options
Diffstat (limited to 'test_client.py')
-rwxr-xr-x | test_client.py | 71 |
1 files changed, 51 insertions, 20 deletions
diff --git a/test_client.py b/test_client.py index 72538c1..bb54500 100755 --- a/test_client.py +++ b/test_client.py @@ -43,38 +43,69 @@ def cli(): @cli.command() -@click.argument("host", type=int) -def start(host: int): - """Start a session on the RWA.Support.WebApp host with index HOST.""" - click.echo(f"Sending D-Bus request 'start': {host}") - response = req.start(host) +def get_web_app_hosts(): + """Get all RWA.Support.WebApp hosts""" + click.echo("Sending D-Bus request 'get_web_app_hosts.'") + response = req.get_web_app_hosts() click.echo(f"Your response is: {response}") @cli.command() -@click.argument("pid", type=int) -def stop(pid: int): - """Stop the session with the pid PID.""" - click.echo(f"Sending D-Bus request 'stop' with PID {pid}") - response = req.stop(pid) +@click.argument("host", type=str) +def add_web_app_host(host: str): + """Add a RWA.Support.WebApp host. Requires <url>""" + click.echo(f"Sending D-Bus request 'add_web_app_host': {host}") + response = req.add_web_app_host(host) click.echo(f"Your response is: {response}") @cli.command() -@click.argument("pid", type=int) -def status(pid: int): - """Get the status of the session with the pid PID.""" - click.echo(f"Sending D-Bus request 'status' with PID {pid}") - response = req.status(pid) +@click.argument("host", type=str) +def remove_web_app_host(host: str): + """Remove a RWA.Support.WebApp host. Requires <url>""" + click.echo(f"Sending D-Bus request 'remove_web_app_host': {host}") + response = req.remove_web_app_host(host) click.echo(f"Your response is: {response}") @cli.command() -@click.argument("pid", type=int) -def refresh_status(pid: int): - """Refresh and get the status of the session with the pid PID.""" - click.echo(f"Sending D-Bus request 'refresh_status' with PID {pid}") - response = req.refresh_status(pid) +@click.argument("host_uuid", type=str) +def start(host_uuid: str): + """Start a session on the RWA.Support.WebApp host. Requires <host_uuid>""" + click.echo(f"Sending D-Bus request 'start': {host_uuid}") + response = req.start(host_uuid) + click.echo(f"Your response is: {response}") + + +@cli.command() +@click.argument("host_uuid", type=str) +@click.argument("session_id", type=int) +def stop(host_uuid: str, session_id: int): + """Stop a session on the RWA.Support.WebApp host. Requires <host_uuid> <session_id>""" + click.echo(f"Sending D-Bus request 'stop' with host ID {host_uuid} and session ID {session_id}") + response = req.stop(host_uuid, session_id) + click.echo(f"Your response is: {response}") + + +@cli.command() +@click.argument("host_uuid", type=str) +@click.argument("session_id", type=int) +def status(host_uuid: str, session_id: int): + """Get the status of a session. Requires <host_uuid> <session_id>""" + click.echo(f"Sending D-Bus request 'status' with host ID {host_uuid} and session ID {session_id}") + response = req.status(host_uuid, session_id) + click.echo(f"Your response is: {response}") + + +@cli.command() +@click.argument("host_uuid", type=str) +@click.argument("session_id", type=int) +def refresh_status(host_uuid: str, session_id: int): + """Refresh and then get the status of a session. Requires <host_uuid> <session_id>""" + click.echo( + f"Sending D-Bus request 'refresh_status' with host ID {host_uuid} and session ID {session_id}" + ) + response = req.refresh_status(host_uuid, session_id) click.echo(f"Your response is: {response}") |