nvflare.fuel.hci.proto module

class Buffer[source]

Bases: object

Buffer to append to for nvflare.fuel.hci.conn.Connection.

append_command(cmd: str)[source]
append_dict(data: dict, meta: dict | None = None)[source]
append_error(data: str, meta: dict | None = None)[source]
append_shutdown(msg: str)[source]
append_string(data: str, meta: dict | None = None)[source]
append_success(data: str, meta: dict | None = None)[source]
append_table(headers: List[str], name=None) Table[source]
append_token(token: str)[source]
encode()[source]
reset()[source]
update_meta(meta: dict)[source]
class ConfirmMethod[source]

Bases: object

AUTH = 'auth'
YESNO = 'yesno'
class InternalCommands[source]

Bases: object

CERT_LOGIN = '_cert_login'
CHECK_SESSION = '_check_session'
GET_CMD_LIST = '_commands'
LIST_SESSIONS = 'list_sessions'
LOGOUT = '_logout'
commands = ['_cert_login', '_logout', '_commands', '_check_session', 'list_sessions']
classmethod contains_command(command: str)[source]
class MetaKey[source]

Bases: object

APP_NAME = 'app_name'
CLIENTS = 'clients'
CLIENT_LAST_CONNECT_TIME = 'client_last_conn_time'
CLIENT_NAME = 'client_name'
CLIENT_STATUS = 'client_status'
CMD_HEADERS = 'cmd_headers'
CMD_NAME = 'cmd_name'
CMD_PROPS = 'cmd_props'
CMD_TIMEOUT = 'cmd_timeout'
CUSTOM_PROPS = 'custom_props'
DATA_TYPE = 'data_type'
DURATION = 'duration'
FILES = 'files'
FOLDER_NAME = 'folder_name'
FQCN = 'fqcn'
INFO = 'info'
JOBS = 'jobs'
JOB_COMPONENTS = 'job_components'
JOB_DATA = 'job_data'
JOB_DOWNLOAD_URL = 'job_download_url'
JOB_ID = 'job_id'
JOB_META = 'job_meta'
JOB_NAME = 'job_name'
LOCATION = 'location'
SERVER_START_TIME = 'server_start_time'
SERVER_STATUS = 'server_status'
SOURCE_FQCN = 'source_fqcn'
STATUS = 'status'
SUBMIT_TIME = 'submit_time'
TX_ID = 'tx_id'
WORKSPACE = 'workspace'
class MetaStatusValue[source]

Bases: object

CLIENTS_RUNNING = 'clients_running'
ERROR = 'error'
INTERNAL_ERROR = 'internal_error'
INVALID_JOB_DEFINITION = 'invalid_job_def'
INVALID_JOB_ID = 'invalid_job_id'
INVALID_TARGET = 'invalid_target'
JOB_NOT_RUNNING = 'job_not_running'
JOB_RUNNING = 'job_running'
NOT_AUTHENTICATED = 'not_authenticated'
NOT_AUTHORIZED = 'not_authorized'
NO_CLIENTS = 'no_clients'
NO_JOBS = 'no_jobs'
NO_JOB_COMPONENTS = 'no_job_compoents'
NO_REPLY = 'no_reply'
OK = 'ok'
SYNTAX_ERROR = 'syntax_error'
class ProtoKey[source]

Bases: object

APP_DATA = 'app_data'
COMMAND = 'command'
DATA = 'data'
DETAILS = 'details'
DICT = 'dict'
ERROR = 'error'
META = 'meta'
ROWS = 'rows'
SHUTDOWN = 'shutdown'
STATUS = 'status'
STRING = 'string'
SUCCESS = 'success'
TABLE = 'table'
TIME = 'time'
TOKEN = 'token'
TYPE = 'type'
class ReplyKeyword[source]

Bases: object

Admin API relies on certain keywords in the server reply to determine command status. We define these keywords here to assure that the server and client sides use the keywords consistently.

COMM_FAILURE = 'Failed to communicate'
INVALID_CLIENT = 'invalid client'
NOT_AUTHORIZED = 'not authorized'
NO_CLIENTS = 'no clients available'
SESSION_INACTIVE = 'session_inactive'
UNKNOWN_SITE = 'unknown site'
WRONG_SERVER = 'wrong server'
class StreamChannel[source]

Bases: object

DOWNLOAD = 'hci.download'
UPLOAD = 'hci.upload'
class StreamTopic[source]

Bases: object

FILE = 'file'
FOLDER = 'folder'
make_error(data: str)[source]
make_meta(status: str, info: str = '', extra: dict | None = None) dict[source]
validate_proto(line: str)[source]

Validate that the line being received is of the expected format.

Parameters:

line – str containing a JSON document

Returns: deserialized JSON document