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 cpu, wait, block.

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

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • 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.

  • snapshots – Number of samples of thread stacktrace. 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, 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.

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

  • filter_path – Comma-separated list of filters used to reduce the response.

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

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • 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

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.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • 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 indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified.

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

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

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

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

  • filter_path – Comma-separated list of filters used to reduce the response.

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

  • human – Whether to return human readable values for statistics.

  • 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.

  • 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.

  • filter_path – Comma-separated list of filters used to reduce the response.

  • human – Whether to return human readable values for statistics.

  • pretty – Whether to pretty format the returned JSON response.

  • 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