Nodes Client

class opensearchpy.client.nodes.NodesClient(client)[source]

Bases: NamespacedClient

Parameters:

client (Any) –

hot_threads(node_id=None, params=None, headers=None)[source]

Returns information about hot threads on each node in the cluster.

Parameters:
  • node_id (Any) – 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.

  • doc_type – The type to sample. Valid choices are block, cpu, wait.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • ignore_idle_threads – Don’t show threads that are in known- idle places, such as waiting on a socket select or pulling from an empty task queue. Default is True.

  • interval – The interval for the second sampling of threads.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • snapshots – Number of samples of thread stack trace. Default is 10.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • threads – Specify the number of threads to provide information for. Default is 3.

  • timeout – Operation timeout.

  • node_id

  • params (Any) –

  • headers (Any) –

Return type:

Any

info(node_id=None, metric=None, node_id_or_metric=None, params=None, headers=None)[source]

Returns information about nodes in the cluster.

Parameters:
  • node_id (Any) – Comma-separated list of node IDs or names used to limit returned information.

  • metric (Any) – Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest.

  • node_id_or_metric (Any) – Limits the information returned to a list of node IDs or specific metrics. Supports a comma-separated list, such as node1,node2 or http,ingest.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • flat_settings – If true, returns settings in flat format. Default is false.

  • human – Whether to return human readable values for statistics. Default is True.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • node_id

  • metric

  • node_id_or_metric

  • params (Any) –

  • headers (Any) –

Return type:

Any

reload_secure_settings(body=None, node_id=None, params=None, headers=None)[source]

Reloads secure settings.

Parameters:
  • body (Any) – An object containing the password for the OpenSearch keystore.

  • node_id (Any) – The names of particular nodes in the cluster to target.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • body

  • node_id

  • params (Any) –

  • headers (Any) –

Return type:

Any

stats(node_id=None, metric=None, index_metric=None, params=None, headers=None)[source]

Returns statistical information about nodes in the cluster.

Parameters:
  • node_id (Any) – Comma-separated list of node IDs or names used to limit returned information.

  • metric (Any) – Limit the information returned to the specified metrics

  • index_metric (Any) – Limit the information returned for indexes metric to the specific index metrics. It can be used only if indexes (or all) metric is specified.

  • completion_fields – Comma-separated list or wildcard expressions of fields to include in field data and suggest statistics.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • fielddata_fields – Comma-separated list or wildcard expressions of fields to include in field data statistics.

  • fields – Comma-separated list or wildcard expressions of fields to include in the statistics.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • groups – Comma-separated list of search groups to include in the search statistics.

  • human – Whether to return human readable values for statistics. Default is True.

  • include_segment_file_sizes – If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). Default is false.

  • level – Indicates whether statistics are aggregated at the cluster, index, or shard level. Valid choices are cluster, indices, shards.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • types – A comma-separated list of document types for the indexing index metric.

  • node_id

  • metric

  • index_metric

  • params (Any) –

  • headers (Any) –

Return type:

Any

usage(node_id=None, metric=None, params=None, headers=None)[source]

Returns low-level information about REST actions usage on nodes.

Parameters:
  • node_id (Any) – 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 (Any) – Limits the information returned to the specific metrics. A comma-separated list of the following options: _all, rest_actions.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

  • node_id

  • metric

  • params (Any) –

  • headers (Any) –

Return type:

Any