nvflare.private.fed.client.admin_commands module

FL Admin commands.

class AbortCommand[source]

Bases: CommandProcessor

To implement the abort command.

get_command_name() str[source]

To get the command name.

Returns: AdminCommandNames.ABORT

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the abort command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Returns: abort command message

class AbortTaskCommand[source]

Bases: CommandProcessor

To implement the abort_task command.

get_command_name() str[source]

To get the command name.

Returns: AdminCommandNames.ABORT_TASK

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the abort_task command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Returns: abort_task command message

class AdminCommands[source]

Bases: object

AdminCommands contains all the commands for processing the commands from the parent process.

commands = [<nvflare.private.fed.client.admin_commands.CheckStatusCommand object>, <nvflare.private.fed.client.admin_commands.AbortCommand object>, <nvflare.private.fed.client.admin_commands.AbortTaskCommand object>, <nvflare.private.fed.client.admin_commands.ByeCommand object>, <nvflare.private.fed.client.admin_commands.ShowStatsCommand object>, <nvflare.private.fed.client.admin_commands.ShowErrorsCommand object>, <nvflare.private.fed.client.admin_commands.ResetErrorsCommand object>]
static get_command(command_name)[source]

Call to return the AdminCommand object.

Parameters:

command_name – AdminCommand name

Returns: AdminCommand object

static register_command(command_processor: CommandProcessor)[source]

Call to register the AdminCommand processor.

Parameters:

command_processor – AdminCommand processor

class ByeCommand[source]

Bases: CommandProcessor

To implement the ShutdownCommand.

get_command_name() str[source]

To get the command name.

Returns: AdminCommandNames.SHUTDOWN

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the Shutdown command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Returns: Shutdown command message

class CheckStatusCommand[source]

Bases: CommandProcessor

To implement the check_status command.

get_command_name() str[source]

To get thee command name.

Returns: AdminCommandNames.CHECK_STATUSv

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the check_status command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Returns: status message

class CommandProcessor[source]

Bases: object

The CommandProcessor is responsible for processing a command from parent process.

get_command_name() str[source]

Get command name that this processor will handle.

Returns: name of the command

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the specified command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Return: reply message

class ResetErrorsCommand[source]

Bases: CommandProcessor

To implement the reset_errors command.

get_command_name() str[source]

To get the command name.

Returns: AdminCommandNames.RESET_ERRORS

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the reset_errors command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Returns: reset_errors command message

class ShowErrorsCommand[source]

Bases: CommandProcessor

To implement the show_errors command.

get_command_name() str[source]

To get the command name.

Returns: AdminCommandNames.SHOW_ERRORS

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the show_errors command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Returns: show_errors command message

class ShowStatsCommand[source]

Bases: CommandProcessor

To implement the show_stats command.

get_command_name() str[source]

To get the command name.

Returns: AdminCommandNames.SHOW_STATS

process(data: Shareable, fl_ctx: FLContext)[source]

Called to process the abort_task command.

Parameters:
  • data – process data

  • fl_ctx – FLContext

Returns: show_stats command message