necst.web.node_health¶
Read-only ROS node health evaluation for the operator console.
Phase 1 intentionally checks only whether configured ROS node names are present in the ROS graph. It never starts, stops, restarts, or kills any process.
- class ExpectedNode(name: 'str', label: 'str', node_class: 'str' = 'optional')[source]¶
Bases:
object- Parameters:
name (str) –
label (str) –
node_class (str) –
- name: str¶
- label: str¶
- node_class: str = 'optional'¶
- class NodeHealthConfig(enabled: 'bool' = False, poll_interval_sec: 'float' = 2.0, nodes: 'Sequence[ExpectedNode]' = <factory>, warnings: 'Sequence[str]' = <factory>)[source]¶
Bases:
object- Parameters:
enabled (bool) –
poll_interval_sec (float) –
nodes (Sequence[ExpectedNode]) –
warnings (Sequence[str]) –
- enabled: bool = False¶
- poll_interval_sec: float = 2.0¶
- nodes: Sequence[ExpectedNode]¶
- warnings: Sequence[str]¶
- full_node_name(name, namespace='/')[source]¶
- Parameters:
name (Any) –
namespace (Any) –
- Return type:
str
- config_from_mapping(config)[source]¶
Parse
[console.health]from a site TOML mapping.Missing
[console.health]means fully disabled. Invalid entries are kept out of the expected-node list and reported as warnings so the console can start normally.- Parameters:
config (Mapping[str, Any]) –
- Return type:
- evaluate(config, actual_nodes, *, error=None, checked_utc=None)[source]¶
Return the node_health status payload for
/api/status.- Parameters:
config (NodeHealthConfig) –
actual_nodes (Optional[Iterable[str]]) –
error (Optional[str]) –
checked_utc (Optional[str]) –
- Return type:
Dict[str, Any]