nvflare.apis.client module

class Client(name, token)[source]

Bases: object

Init Client.

Represents a client, and is managed by the client manager. The token is an uuid used for authorization.

Parameters:
  • name – client name

  • token – client token

get_fqcn()[source]
get_fqsn()[source]
get_is_leaf()[source]
get_prop(name, default=None)[source]
get_token()[source]
set_fqcn(value: str)[source]
set_fqsn(value: str)[source]
set_is_leaf(value: bool)[source]
set_prop(name, value)[source]
set_token(token)[source]
to_dict() dict[source]

Convert the Client object to a dict representation. This dict could be used included into a job’s metadata.

Returns: dict that contains essential info of the client.

Note that the client’s token is not included in the result since it is authentication data.

class ClientDictKey[source]

Bases: object

FQCN = 'fqcn'
FQSN = 'fqsn'
IS_LEAF = 'is_leaf'
NAME = 'name'
class ClientPropKey[source]

Bases: object

FQCN = 'fqcn'
FQSN = 'fqsn'
IS_LEAF = 'is_leaf'
from_dict(d: dict) Client[source]

Create a Client object from the data in the specified dict.

Parameters:

d – the dict that contains Client data. This dict should be the result of to_dict() of a Client object.

Returns: a Client object