nvflare.private.fed.server.server_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 AuxCommunicateCommand[source]

Bases: CommandProcessor

To implement the server GetTask command.

get_command_name() str[source]

To get the command name.

Returns: ServerCommandNames.AUX_COMMUNICATE

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

Called to process the abort command.

Parameters
  • data – process data

  • fl_ctx – FLContext

Returns: task data

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 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 GetErrorsCommand[source]

Bases: CommandProcessor

To implement the show_errors command.

get_command_name() str[source]

To get the command name.

Returns: ServerCommandNames.GET_ERRORS

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

Called to process the abort command.

Parameters
  • data – process data

  • fl_ctx – FLContext

Returns: Engine run_info

class GetRunInfoCommand[source]

Bases: CommandProcessor

To implement the abort command.

get_command_name() str[source]

To get the command name.

Returns: ServerCommandNames.GET_RUN_INFO

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

Called to process the abort command.

Parameters
  • data – process data

  • fl_ctx – FLContext

Returns: Engine run_info

class GetTaskCommand[source]

Bases: CommandProcessor

To implement the server GetTask command.

get_command_name() str[source]

To get the command name.

Returns: ServerCommandNames.GET_TASK

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

Called to process the abort command.

Parameters
  • data – process data

  • fl_ctx – FLContext

Returns: task data

class ServerCommands[source]

Bases: object

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

commands = [<nvflare.private.fed.server.server_commands.AbortCommand object>, <nvflare.private.fed.server.server_commands.ByeCommand object>, <nvflare.private.fed.server.server_commands.GetRunInfoCommand object>, <nvflare.private.fed.server.server_commands.GetTaskCommand object>, <nvflare.private.fed.server.server_commands.SubmitUpdateCommand object>, <nvflare.private.fed.server.server_commands.AuxCommunicateCommand object>, <nvflare.private.fed.server.server_commands.ShowStatsCommand object>, <nvflare.private.fed.server.server_commands.GetErrorsCommand 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 ShowStatsCommand[source]

Bases: CommandProcessor

To implement the show_stats command.

get_command_name() str[source]

To get the command name.

Returns: ServerCommandNames.SHOW_STATS

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

Called to process the abort command.

Parameters
  • data – process data

  • fl_ctx – FLContext

Returns: Engine run_info

class SubmitUpdateCommand[source]

Bases: CommandProcessor

To implement the server GetTask command.

get_command_name() str[source]

To get the command name.

Returns: ServerCommandNames.SUBMIT_UPDATE

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

Called to process the abort command.

Parameters
  • data – process data

  • fl_ctx – FLContext

Returns: