nvflare.private.fed.server.cmd_utils module

class CommandUtil[source]

Bases: object

JOB = 'job'
JOB_ID = 'job_id'
TARGET_CLIENTS = 'target_clients'
TARGET_CLIENT_NAMES = 'target_client_names'
TARGET_CLIENT_TOKENS = 'target_client_tokens'
TARGET_TYPE = 'target_type'
TARGET_TYPE_ALL = 'all'
TARGET_TYPE_CLIENT = 'client'
TARGET_TYPE_SERVER = 'server'
authorize_client_operation(conn: Connection, args: List[str]) PreAuthzReturnCode[source]
authorize_server_operation(conn: Connection, args: List[str])[source]
command_authz_required(conn: Connection, args: List[str]) PreAuthzReturnCode[source]
static get_job_name(meta: dict) str[source]

Gets job name from job meta.

must_be_project_admin(conn: Connection, args: List[str])[source]
process_replies_to_table(conn: Connection, replies)[source]

Process the clients’ replies and put in a table format.

Parameters:
  • conn – A Connection object.

  • replies – replies from clients

send_request_to_clients(conn, message)[source]
validate_command_targets(conn: Connection, args: List[str]) str[source]

Validate specified args and determine and set target type and target names in the Connection.

The args must be like this:

target_type client_names …

where target_type is one of ‘all’, ‘client’, ‘server’

Parameters:
  • conn – A Connection object.

  • args – Specified arguments.

Returns:

An error message. It is empty “” if no error found.