# Nodes

class elasticsearch.client.NodesClient

  To use this client, access `client.nodes` from an `Elasticsearch` client. For example:

      from elasticsearch import Elasticsearch

      # Create the client instance
      client = Elasticsearch(...)
      # Use the nodes client
      client.nodes.<method>(...)

  clear_repositories_metering_archive(*, node_id, max_archive_version, error_trace=None, filter_path=None, human=None, pretty=None)

    Clear the archived repositories metering.

    Clear the archived repositories metering information in the cluster.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation-nodes-clear-repositories-metering-archive

    Parameters:

      - node_id (str | Sequence[str]) – Comma-separated list of node IDs or names used to limit returned information.

      - max_archive_version (int) – Specifies the maximum archive_version to be cleared from the archive.

      - error_trace (bool | None)

      - filter_path (str | Sequence[str] | None)

      - human (bool | None)

      - pretty (bool | None)

    Return type:

      ObjectApiResponse[Any]

  get_repositories_metering_info(*, node_id, error_trace=None, filter_path=None, human=None, pretty=None)

    Get cluster repositories metering.

    Get repositories metering information for a cluster. This API exposes monotonically non-decreasing counters and it is expected that clients would durably store the information needed to compute aggregations over a period of time. Additionally, the information exposed by this API is volatile, meaning that it will not be present after node restarts.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation-nodes-get-repositories-metering-info

    Parameters:

      - node_id (str | Sequence[str]) – Comma-separated list of node IDs or names used to limit returned information.

      - error_trace (bool | None)

      - filter_path (str | Sequence[str] | None)

      - human (bool | None)

      - pretty (bool | None)

    Return type:

      ObjectApiResponse[Any]

  hot_threads(*, node_id=None, error_trace=None, filter_path=None, human=None, ignore_idle_threads=None, interval=None, pretty=None, snapshots=None, sort=None, threads=None, timeout=None, type=None)

    Get the hot threads for nodes.

    Get a breakdown of the hot threads on each selected node in the cluster. The output is plain text with a breakdown of the top hot threads for each node.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation-nodes-hot-threads

    Parameters:

      - node_id (str | Sequence[str] | None) – List of node IDs or names used to limit returned information.

      - ignore_idle_threads (bool | None) – If true, known idle threads (e.g. waiting in a socket select, or to get a task from an empty queue) are filtered out.

      - interval (str | Literal[-1] | ~typing.Literal[0] | None) – The interval to do the second sampling of threads.

      - snapshots (int | None) – Number of samples of thread stacktrace.

      - sort (str | Literal['block', 'cpu', 'gpu', 'mem', 'wait'] | None) – The sort order for ‘cpu’ type

      - threads (int | None) – Specifies the number of hot threads to provide information for.

      - timeout (str | Literal[-1] | ~typing.Literal[0] | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

      - type (str | Literal['block', 'cpu', 'gpu', 'mem', 'wait'] | None) – The type to sample.

      - error_trace (bool | None)

      - filter_path (str | Sequence[str] | None)

      - human (bool | None)

      - pretty (bool | None)

    Return type:

      TextApiResponse

  info(*, node_id=None, metric=None, error_trace=None, filter_path=None, flat_settings=None, human=None, pretty=None, timeout=None)

    Get node information.

    By default, the API returns all attributes and core settings for cluster nodes.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation-nodes-info

    Parameters:

      - node_id (str | Sequence[str] | None) – Comma-separated list of node IDs or names used to limit returned information.

      - metric (Sequence[str | Literal['_all', '_none', 'aggregations', 'http', 'indices', 'ingest', 'jvm', 'os', 'plugins', 'process', 'remote_cluster_server', 'settings', 'thread_pool', 'transport']] | str | ~typing.Literal['_all', '_none', 'aggregations', 'http', 'indices', 'ingest', 'jvm', 'os', 'plugins', 'process', 'remote_cluster_server', 'settings', 'thread_pool', 'transport'] | None) – Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest.

      - flat_settings (bool | None) – If true, returns settings in flat format.

      - timeout (str | Literal[-1] | ~typing.Literal[0] | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

      - error_trace (bool | None)

      - filter_path (str | Sequence[str] | None)

      - human (bool | None)

      - pretty (bool | None)

    Return type:

      ObjectApiResponse[Any]

  reload_secure_settings(*, node_id=None, error_trace=None, filter_path=None, human=None, pretty=None, secure_settings_password=None, timeout=None, body=None)

    Reload the keystore on nodes in the cluster.

    Secure settings are stored in an on-disk keystore. Certain of these settings are reloadable. That is, you can change them on disk and reload them without restarting any nodes in the cluster. When you have updated reloadable secure settings in your keystore, you can use this API to reload those settings on each node.

    When the Elasticsearch keystore is password protected and not simply obfuscated, you must provide the password for the keystore when you reload the secure settings. Reloading the settings for the whole cluster assumes that the keystores for all nodes are protected with the same password; this method is allowed only when inter-node communications are encrypted. Alternatively, you can reload the secure settings on each node by locally accessing the API and passing the node-specific Elasticsearch keystore password.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation-nodes-reload-secure-settings

    Parameters:

      - node_id (str | Sequence[str] | None) – The names of particular nodes in the cluster to target.

      - secure_settings_password (str | None) – The password for the Elasticsearch keystore.

      - timeout (str | Literal[-1] | ~typing.Literal[0] | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

      - error_trace (bool | None)

      - filter_path (str | Sequence[str] | None)

      - human (bool | None)

      - pretty (bool | None)

      - body (Dict[str, Any] | None)

    Return type:

      ObjectApiResponse[Any]

  stats(*, node_id=None, metric=None, index_metric=None, completion_fields=None, error_trace=None, fielddata_fields=None, fields=None, filter_path=None, groups=None, human=None, include_segment_file_sizes=None, include_unloaded_segments=None, level=None, pretty=None, timeout=None, types=None)

    Get node statistics.

    Get statistics for nodes in a cluster. By default, all stats are returned. You can limit the returned information by using metrics.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation-nodes-stats

    Parameters:

      - node_id (str | Sequence[str] | None) – Comma-separated list of node IDs or names used to limit returned information.

      - metric (Sequence[str | Literal['_all', '_none', 'adaptive_selection', 'allocations', 'breaker', 'discovery', 'fs', 'http', 'indexing_pressure', 'indices', 'ingest', 'jvm', 'os', 'process', 'repositories', 'script', 'script_cache', 'thread_pool', 'transport']] | str | ~typing.Literal['_all', '_none', 'adaptive_selection', 'allocations', 'breaker', 'discovery', 'fs', 'http', 'indexing_pressure', 'indices', 'ingest', 'jvm', 'os', 'process', 'repositories', 'script', 'script_cache', 'thread_pool', 'transport'] | None) – Limits the information returned to the specific metrics.

      - index_metric (Sequence[str | Literal['_all', 'bulk', 'completion', 'dense_vector', 'docs', 'fielddata', 'flush', 'get', 'indexing', 'mappings', 'merge', 'query_cache', 'recovery', 'refresh', 'request_cache', 'search', 'segments', 'shard_stats', 'sparse_vector', 'store', 'translog', 'warmer']] | str | ~typing.Literal['_all', 'bulk', 'completion', 'dense_vector', 'docs', 'fielddata', 'flush', 'get', 'indexing', 'mappings', 'merge', 'query_cache', 'recovery', 'refresh', 'request_cache', 'search', 'segments', 'shard_stats', 'sparse_vector', 'store', 'translog', 'warmer'] | None) – Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.

      - completion_fields (str | Sequence[str] | None) – Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics.

      - fielddata_fields (str | Sequence[str] | None) – Comma-separated list or wildcard expressions of fields to include in fielddata statistics.

      - fields (str | Sequence[str] | None) – Comma-separated list or wildcard expressions of fields to include in the statistics.

      - groups (bool | None) – Comma-separated list of search groups to include in the search statistics.

      - include_segment_file_sizes (bool | None) – If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested).

      - include_unloaded_segments (bool | None) – If true, the response includes information from segments that are not loaded into memory.

      - level (str | Literal['indices', 'node', 'shards'] | None) – Indicates whether statistics are aggregated at the node, indices, or shards level.

      - timeout (str | Literal[-1] | ~typing.Literal[0] | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

      - types (Sequence[str] | None) – A comma-separated list of document types for the indexing index metric.

      - error_trace (bool | None)

      - filter_path (str | Sequence[str] | None)

      - human (bool | None)

      - pretty (bool | None)

    Return type:

      ObjectApiResponse[Any]

  usage(*, node_id=None, metric=None, error_trace=None, filter_path=None, human=None, pretty=None, timeout=None)

    Get feature usage information.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation-nodes-usage

    Parameters:

      - node_id (str | Sequence[str] | None) – A comma-separated list of node IDs or names to limit the returned information. Use _local to return information from the node you’re connecting to, leave empty to get information from all nodes.

      - metric (Sequence[str | Literal['_all', 'aggregations', 'rest_actions']] | str | ~typing.Literal['_all', 'aggregations', 'rest_actions'] | None) – Limits the information returned to the specific metrics. A comma-separated list of the following options: _all, rest_actions, aggregations.

      - timeout (str | Literal[-1] | ~typing.Literal[0] | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

      - error_trace (bool | None)

      - filter_path (str | Sequence[str] | None)

      - human (bool | None)

      - pretty (bool | None)

    Return type:

      ObjectApiResponse[Any]