class_docstr: State API Client issues REST GET requests to the server for resource states.
class_docstr_tok: ["State","API","Client","issues","REST","GET","requests","to","the","server","for","resource","states","."]
docstr: Initialize a StateApiClient and check the connection to the cluster.
  
  Args:
      address: Ray bootstrap address (e.g. `127.0.0.0:6379`, `auto`), or Ray
          Client adress (e.g. `ray://<head-node-ip>:10001`), or Ray dashboard
          address (e.g. `http://<head-node-ip>:8265`).
          If not provided, it will be detected automatically from any running
          local Ray cluster.
      cookies: Cookies to use when sending requests to the HTTP job server.
      headers: Headers to use when sending requests to the HTTP job server, used
          for cases like authentication to a remote cluster.
docstr_tok: ["Initialize","a","StateApiClient","and","check","the","connection","to","the","cluster",".","Args",":","address",":","Ray","bootstrap","address","(","e.g",".","`","127.0.0.0:6379","`",",","`","auto","`",")",",","or","Ray","Client","adress","(","e.g",".","`","ray",":","\/\/","<","head-node-ip",">",":10001","`",")",",","or","Ray","dashboard","address","(","e.g",".","`","http",":","\/\/","<","head-node-ip",">",":8265","`",")",".","If","not","provided",",","it","will","be","detected","automatically","from","any","running","local","Ray","cluster",".","cookies",":","Cookies","to","use","when","sending","requests","to","the","HTTP","job","server",".","headers",":","Headers","to","use","when","sending","requests","to","the","HTTP","job","server",",","used","for","cases","like","authentication","to","a","remote","cluster","."]
code: def __init__(
      self,
      address: Optional[str] = None,
      cookies: Optional[Dict[str, Any]] = None,
      headers: Optional[Dict[str, Any]] = None,
  ):
      """Initialize a StateApiClient and check the connection to the cluster.
  
      Args:
          address: Ray bootstrap address (e.g. `127.0.0.0:6379`, `auto`), or Ray
              Client adress (e.g. `ray://<head-node-ip>:10001`), or Ray dashboard
              address (e.g. `http://<head-node-ip>:8265`).
              If not provided, it will be detected automatically from any running
              local Ray cluster.
          cookies: Cookies to use when sending requests to the HTTP job server.
          headers: Headers to use when sending requests to the HTTP job server, used
              for cases like authentication to a remote cluster.
      """
      if requests is None:
          raise RuntimeError(
              "The Ray state CLI & SDK require the ray[default] "
              "installation: `pip install 'ray[default']``"
          )
      if not headers:
          headers = {"Content-Type": "application/json"}
  
      # Resolve API server URL
      api_server_url = get_address_for_submission_client(address)
  
      super().__init__(
          address=api_server_url,
          create_cluster_if_needed=False,
          headers=headers,
          cookies=cookies,
      )
  
imports: import logging
  import threading
  import urllib
  import warnings
  from contextlib import contextmanager
  from dataclasses import fields
  from typing import Any, Dict, Generator, List, Optional, Tuple, Union
  import requests
  from ray.dashboard.modules.dashboard_sdk import SubmissionClient
  from ray.dashboard.utils import get_address_for_submission_client, ray_address_to_api_server_url
  from ray.util.annotations import DeveloperAPI
  from ray.util.state.common import DEFAULT_LIMIT, DEFAULT_RPC_TIMEOUT, ActorState, ClusterEventState, GetApiOptions, GetLogOptions, JobState, ListApiOptions, NodeState, ObjectState, PlacementGroupState, PredicateType, RuntimeEnvState, StateResource, SummaryApiOptions, SummaryResource, SupportedFilterType, TaskState, WorkerState, dict_to_state
  from ray.util.state.exception import RayStateApiException, ServerUnavailable
label_desc: Use image node_id 1 to create a new StateApiClient object from inherited base classes: SubmissionClient with example: obj = StateApiClient(address, cookies, headers)