ray.util.state.get_node#

ray.util.state.get_node(id: str, address: str | None = None, timeout: int = 30, _explain: bool = False) NodeState | None[source]#

Get a node by id.

Parameters:
  • id – Id of the node.

  • address – Ray bootstrap address, could be auto, localhost:6379. If None, it will be resolved automatically from an initialized ray.

  • timeout – Max timeout value for the state APIs requests made.

  • _explain – Print the API information such as API latency or failed query information.

Returns:

None if actor not found, or NodeState.

Raises:

ExceptionsRayStateApiException if the CLI is failed to query the data.

DeveloperAPI: This API may change across minor Ray releases.