Skip to content

Commit

Permalink
conflict + minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KatHellg committed Nov 13, 2024
1 parent 7c24f1a commit 4a1d035
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 22 deletions.
6 changes: 2 additions & 4 deletions fedn/cli/client_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ def list_clients(ctx, protocol: str, host: str, port: str, token: str = None, n_
if _token:
headers["Authorization"] = _token


click.echo(f"\nListing clients: {url}\n")
click.echo(f"Headers: {headers}")

try:
response = requests.get(url, headers=headers)
print_response(response, "clients", None)
Expand All @@ -74,7 +74,7 @@ def list_clients(ctx, protocol: str, host: str, port: str, token: str = None, n_
@click.option("-H", "--host", required=False, default=CONTROLLER_DEFAULTS["host"], help="Hostname of controller (api)")
@click.option("-P", "--port", required=False, default=CONTROLLER_DEFAULTS["port"], help="Port of controller (api)")
@click.option("-t", "--token", required=False, help="Authentication token")
@click.option("-id", "--id", required=False, help="Client ID")
@click.option("-id", "--id", required=True, help="Client ID")
@client_cmd.command("get")
@click.pass_context
def get_client(ctx, protocol: str, host: str, port: str, token: str = None, id: str = None):
Expand All @@ -94,7 +94,6 @@ def get_client(ctx, protocol: str, host: str, port: str, token: str = None, id:

if id:
url = f"{url}{id}"
headers["id"] = id


click.echo(f"\nRetrieving client: {url}\n")
Expand All @@ -105,7 +104,6 @@ def get_client(ctx, protocol: str, host: str, port: str, token: str = None, id:
except requests.exceptions.ConnectionError:
click.echo(f"Error: Could not connect to {url}")

@client_cmd.command("start")
@client_cmd.command("start-v1")
@click.option("-d", "--discoverhost", required=False, help="Hostname for discovery services(reducer).")
@click.option("-p", "--discoverport", required=False, help="Port for discovery services (reducer).")
Expand Down
3 changes: 1 addition & 2 deletions fedn/cli/combiner_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def list_combiners(ctx, protocol: str, host: str, port: str, token: str = None,
@click.option("-H", "--host", required=False, default=CONTROLLER_DEFAULTS["host"], help="Hostname of controller (api)")
@click.option("-P", "--port", required=False, default=CONTROLLER_DEFAULTS["port"], help="Port of controller (api)")
@click.option("-t", "--token", required=False, help="Authentication token")
@click.option("-id", "--id", required=False, help="Combiner ID")
@click.option("-id", "--id", required=True, help="Combiner ID")
@combiner_cmd.command("get")
@click.pass_context
def get_combiner(ctx, protocol: str, host: str, port: str, token: str = None, id: str = None):
Expand All @@ -122,7 +122,6 @@ def get_combiner(ctx, protocol: str, host: str, port: str, token: str = None, id

if id:
url = f"{url}{id}"
headers["id"] = id


click.echo(f"\nRetrieving combiner: {url}\n")
Expand Down
4 changes: 1 addition & 3 deletions fedn/cli/model_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def list_models(ctx, protocol: str, host: str, port: str, token: str = None, ses

if session_id:
url = f"{url}?session_id={session_id}"
headers["session_id"] = session_id

click.echo(f"\nListing models: {url}\n")
click.echo(f"Headers: {headers}")
Expand All @@ -58,7 +57,7 @@ def list_models(ctx, protocol: str, host: str, port: str, token: str = None, ses
@click.option("-H", "--host", required=False, default=CONTROLLER_DEFAULTS["host"], help="Hostname of controller (api)")
@click.option("-P", "--port", required=False, default=CONTROLLER_DEFAULTS["port"], help="Port of controller (api)")
@click.option("-t", "--token", required=False, help="Authentication token")
@click.option("-id", "--id", required=False, help="Model ID")
@click.option("-id", "--id", required=True, help="Model ID")
@model_cmd.command("get")
@click.pass_context
def get_model(ctx, protocol: str, host: str, port: str, token: str = None, id: str = None):
Expand All @@ -80,7 +79,6 @@ def get_model(ctx, protocol: str, host: str, port: str, token: str = None, id: s

if id:
url = f"{url}{id}"
headers["id"] = id

click.echo(f"\nRetrieving model: {url}\n")
click.echo(f"Headers: {headers}")
Expand Down
3 changes: 1 addition & 2 deletions fedn/cli/package_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def list_packages(ctx, protocol: str, host: str, port: str, token: str = None, n
@click.option("-H", "--host", required=False, default=CONTROLLER_DEFAULTS["host"], help="Hostname of controller (api)")
@click.option("-P", "--port", required=False, default=CONTROLLER_DEFAULTS["port"], help="Port of controller (api)")
@click.option("-t", "--token", required=False, help="Authentication token")
@click.option("-id", "--id", required=False, help="Package ID")
@click.option("-id", "--id", required=True, help="Package ID")
@package_cmd.command("get")
@click.pass_context
def get_package(ctx, protocol: str, host: str, port: str, token: str = None, id: str = None):
Expand All @@ -100,7 +100,6 @@ def get_package(ctx, protocol: str, host: str, port: str, token: str = None, id:

if id:
url = f"{url}{id}"
headers["id"] = id


click.echo(f"\nretrieving package: {url}\n")
Expand Down
4 changes: 1 addition & 3 deletions fedn/cli/round_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def list_rounds(ctx, protocol: str, host: str, port: str, token: str = None, ses

if session_id:
url = f"{url}?round_config.session_id={session_id}"
headers["session_id"] = session_id

click.echo(f"\nListing rounds: {url}\n")
click.echo(f"Headers: {headers}")
Expand All @@ -57,7 +56,7 @@ def list_rounds(ctx, protocol: str, host: str, port: str, token: str = None, ses
@click.option("-p", "--protocol", required=False, default=CONTROLLER_DEFAULTS["protocol"], help="Communication protocol of controller (api)")
@click.option("-H", "--host", required=False, default=CONTROLLER_DEFAULTS["host"], help="Hostname of controller (api)")
@click.option("-P", "--port", required=False, default=CONTROLLER_DEFAULTS["port"], help="Port of controller (api)")
@click.option("-id", "--id", required=False, help="Round ID")
@click.option("-id", "--id", required=True, help="Round ID")
@click.option("-t", "--token", required=False, help="Authentication token")
@round_cmd.command("get")
@click.pass_context
Expand All @@ -79,7 +78,6 @@ def get_round(ctx, protocol: str, host: str, port: str, token: str = None, id: s

if id:
url = f"{url}{id}"
headers["id"] = id


click.echo(f"\nRetrieving round: {url}\n")
Expand Down
1 change: 0 additions & 1 deletion fedn/cli/session_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def get_session(ctx, protocol: str, host: str, port: str, token: str = None, id:

if id:
url = f"{url}{id}"
headers["id"] = id


click.echo(f"\nRetrieving session: {url}\n")
Expand Down
5 changes: 1 addition & 4 deletions fedn/cli/status_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def list_statuses(ctx, protocol: str, host: str, port: str, token: str = None, s

if session_id:
url = f"{url}?sessionId={session_id}"
headers["session_id"] = session_id


click.echo(f"\nListing statuses: {url}\n")
Expand All @@ -56,7 +55,7 @@ def list_statuses(ctx, protocol: str, host: str, port: str, token: str = None, s
@click.option("-H", "--host", required=False, default=CONTROLLER_DEFAULTS["host"], help="Hostname of controller (api)")
@click.option("-P", "--port", required=False, default=CONTROLLER_DEFAULTS["port"], help="Port of controller (api)")
@click.option("-t", "--token", required=False, help="Authentication token")
@click.option("-id", "--id", required=False, help="Status ID")
@click.option("-id", "--id", required=True, help="Status ID")
@status_cmd.command("get")
@click.pass_context
def get_status(ctx, protocol: str, host: str, port: str, token: str = None, id: str = None):
Expand All @@ -76,8 +75,6 @@ def get_status(ctx, protocol: str, host: str, port: str, token: str = None, id:

if id:
url = f"{url}{id}"
headers["id"] = id


click.echo(f"\nRetrieving status: {url}\n")
click.echo(f"Headers: {headers}")
Expand Down
4 changes: 1 addition & 3 deletions fedn/cli/validation_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def list_validations(ctx, protocol: str, host: str, port: str, token: str = None

if session_id:
url = f"{url}?sessionId={session_id}"
headers["session_id"] = session_id

click.echo(f"\nListing validations: {url}\n")
click.echo(f"Headers: {headers}")
Expand All @@ -56,7 +55,7 @@ def list_validations(ctx, protocol: str, host: str, port: str, token: str = None
@click.option("-H", "--host", required=False, default=CONTROLLER_DEFAULTS["host"], help="Hostname of controller (api)")
@click.option("-P", "--port", required=False, default=CONTROLLER_DEFAULTS["port"], help="Port of controller (api)")
@click.option("-t", "--token", required=False, help="Authentication token")
@click.option("-id", "--id", required=False, help="validation ID")
@click.option("-id", "--id", required=True, help="validation ID")
@validation_cmd.command("get")
@click.pass_context
def get_validation(ctx, protocol: str, host: str, port: str, token: str = None, id: str = None):
Expand All @@ -75,7 +74,6 @@ def get_validation(ctx, protocol: str, host: str, port: str, token: str = None,

if id:
url = f"{url}{id}"
headers["id"] = id


click.echo(f"\nRetrieving validation: {url}\n")
Expand Down

0 comments on commit 4a1d035

Please sign in to comment.