p2pfl.management.p2pfl_web_services moduleΒΆ
Communication with P2PFL Web Services (via REST API).
Todo
Implement batch sending.
Todo
Implement get_pending_actions.
Todo
Implement unregister_node.
Todo
Implement get_experiment_id.
- class p2pfl.management.p2pfl_web_services.P2pflWebServices(url, key)[source]ΒΆ
Bases:
object
Class that manages the communication with the p2pfl-web services.
- Parameters:
url (
str
) β The URL of the p2pfl-web services.key (
str
) β The key to access the services.
- register_node(node, is_simulated)[source]ΒΆ
Register a node.
- Parameters:
node (
str
) β The node address.is_simulated (
bool
) β If the node is simulated.
- Return type:
None
- send_global_metric(exp, round, metric, node, value)[source]ΒΆ
Send a local metric.
- Parameters:
exp (
str
) β The experiment.round (
int
) β The round.metric (
str
) β The metric.node (
str
) β The node address.value (
float
) β The value.
- send_local_metric(exp, round, metric, node, value, step)[source]ΒΆ
Send a local metric.
- Parameters:
exp (
str
) β The experiment.round (
int
) β The round.metric (
str
) β The metric.node (
str
) β The node address.value (
float
) β The value.step (
int
) β The step.
- Return type:
None
- send_log(time, node, level, message)[source]ΒΆ
Send a log message.
- Parameters:
time (
datetime
) β The time of the message.node (
str
) β The node address.level (
int
) β The log level.message (
str
) β The message.
- Return type:
None