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: Summarize resources states
  
  Args:
      resource_name: Resource names,
          see `SummaryResource` for details.
      options: summary options. See `SummaryApiOptions` for details.
      raise_on_missing_output: Raise an exception if the output has missing data.
          Output can have missing data if (1) there's a partial network failure
          when the source is distributed. (2) data is truncated
          because it is too large.
      _explain: Print the API information such as API
          latency or failed query information.
  
  Returns:
      A dictionary of queried result from `SummaryApiResponse`.
  
  Raises:
      This doesn't catch any exceptions raised when the underlying request
      call raises exceptions. For example, it could raise `requests.Timeout`
      when timeout occurs.
docstr_tok: ["Summarize","resources","states","Args",":","resource_name",":","Resource","names",",","see","`","SummaryResource","`","for","details",".","options",":","summary","options",".","See","`","SummaryApiOptions","`","for","details",".","raise_on_missing_output",":","Raise","an","exception","if","the","output","has","missing","data",".","Output","can","have","missing","data","if","(","1",")","there","'s","a","partial","network","failure","when","the","source","is","distributed",".","(","2",")","data","is","truncated","because","it","is","too","large",".","_explain",":","Print","the","API","information","such","as","API","latency","or","failed","query","information",".","Returns",":","A","dictionary","of","queried","result","from","`","SummaryApiResponse","`",".","Raises",":","This","does","n't","catch","any","exceptions","raised","when","the","underlying","request","call","raises","exceptions",".","For","example",",","it","could","raise","`","requests.Timeout","`","when","timeout","occurs","."]
code: def summary(
      self,
      resource: SummaryResource,
      *,
      options: SummaryApiOptions,
      raise_on_missing_output: bool,
      _explain: bool = False,
  ) -> Dict:
      """Summarize resources states
  
      Args:
          resource_name: Resource names,
              see `SummaryResource` for details.
          options: summary options. See `SummaryApiOptions` for details.
          raise_on_missing_output: Raise an exception if the output has missing data.
              Output can have missing data if (1) there's a partial network failure
              when the source is distributed. (2) data is truncated
              because it is too large.
          _explain: Print the API information such as API
              latency or failed query information.
  
      Returns:
          A dictionary of queried result from `SummaryApiResponse`.
  
      Raises:
          This doesn't catch any exceptions raised when the underlying request
          call raises exceptions. For example, it could raise `requests.Timeout`
          when timeout occurs.
      """
      params = {"timeout": options.timeout}
      endpoint = f"/api/v0/{resource.value}/summarize"
      summary_api_response = self._make_http_get_request(
          endpoint=endpoint,
          params=params,
          timeout=options.timeout,
          _explain=_explain,
      )
      if raise_on_missing_output:
          self._raise_on_missing_output(resource, summary_api_response)
      if _explain:
          # There's no limit applied to summary, so we shouldn't warn.
          self._print_api_warning(
              resource, summary_api_response, warn_limit=False
          )
      return summary_api_response["result"]["node_id_to_summary"]
  
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 8 for calling the StateApiClient obj's underlying member method code with example usage: obj.summary(resource) and returns: summary_api_response