Cluster Client
- class opensearchpy.client.cluster.ClusterClient(client)[source]
Bases:
NamespacedClient
- Parameters:
client (Any) –
- allocation_explain(*, body=None, params=None, headers=None)[source]
Explains how shards are allocated in the current cluster and provides an explanation for why unassigned shards can’t be allocated to a node.
- Parameters:
body (Any) – The index, shard, and primary flag for which to generate an explanation. Leave this empty to generate an explanation for the first unassigned shard.
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.
include_disk_info – When true, returns information about disk usage and shard sizes. Default is false.
include_yes_decisions – When true, returns any YES decisions in the allocation explanation. YES decisions indicate when a particular shard allocation attempt was successful for the given node. Default is false.
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.
body –
params (Any) –
headers (Any) –
- Return type:
- delete_component_template(*, name, params=None, headers=None)[source]
Deletes a component template.
- Parameters:
name (Any) – The name of the component template to delete. Supports wildcard (*) expressions.
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
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.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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 – A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
name –
params (Any) –
headers (Any) –
- Return type:
- delete_decommission_awareness(*, params=None, headers=None)[source]
Recommissions a decommissioned zone.
- Parameters:
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.
params (Any) –
headers (Any) –
- Return type:
- delete_voting_config_exclusions(*, params=None, headers=None)[source]
Clears any cluster voting configuration exclusions.
- Parameters:
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.
wait_for_removal – Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. When true, all excluded nodes are removed from the cluster before this API takes any action. When false, the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. Default is True.
params (Any) –
headers (Any) –
- Return type:
- delete_weighted_routing(*, body=None, params=None, headers=None)[source]
Delete weighted shard routing weights.
- Parameters:
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.
body (Any) –
params (Any) –
headers (Any) –
- Return type:
- exists_component_template(*, name, params=None, headers=None)[source]
Returns information about whether a particular component template exist.
- Parameters:
name (Any) – The name of the component template. Wildcard (*) expressions are supported.
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
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.
local – When true, the request retrieves information from the local node only. When false, information is retrieved from the cluster manager node. Default is false.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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.
name –
params (Any) –
headers (Any) –
- Return type:
- get_component_template(*, name=None, params=None, headers=None)[source]
Returns one or more component templates.
- Parameters:
name (Any) – The name of the component template to retrieve. Wildcard (*) expressions are supported.
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
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 – Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “cluster”: { “max_shards_per_node”: 500 } is “cluster.max_shards_per_node”: “500”. Default is false.
human – Whether to return human readable values for statistics. Default is True.
local – When true, the request retrieves information from the local node only. When false, information is retrieved from the cluster manager node. Default is false.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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.
name –
params (Any) –
headers (Any) –
- Return type:
- get_decommission_awareness(*, awareness_attribute_name, params=None, headers=None)[source]
Retrieves the decommission status for all zones.
- Parameters:
awareness_attribute_name (Any) – The name of the awareness attribute.
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.
awareness_attribute_name –
params (Any) –
headers (Any) –
- Return type:
- get_settings(*, params=None, headers=None)[source]
Returns cluster settings.
- Parameters:
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
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 – Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “cluster”: { “max_shards_per_node”: 500 } is “cluster.max_shards_per_node”: “500”. Default is false.
human – Whether to return human readable values for statistics. Default is True.
include_defaults – When true, returns default cluster settings from the local node. Default is false.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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 – A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
params (Any) –
headers (Any) –
- Return type:
- get_weighted_routing(*, attribute, params=None, headers=None)[source]
Fetches weighted shard routing weights.
- Parameters:
attribute (Any) – The name of the awareness attribute.
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.
attribute –
params (Any) –
headers (Any) –
- Return type:
- health(*, index=None, params=None, headers=None)[source]
Returns basic information about the health of the cluster.
- Parameters:
index (Any) – A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indexes, omit this parameter or use * or _all.
awareness_attribute – The name of the awareness attribute for which to return the cluster health status (for example, zone). Applicable only if level is set to awareness_attributes.
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
error_trace – Whether to include the stack trace of returned errors. Default is false.
expand_wildcards – Specifies the type of index that wildcard expressions can match. Supports comma-separated values. Valid choices are all, closed, hidden, none, open.
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.
level – Controls the amount of detail included in the cluster health response. Valid choices are awareness_attributes, cluster, indices, shards.
local – Whether to return information from the local node only instead of from the cluster manager node. Default is false.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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 – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api- reference/common-parameters/#time-units).
wait_for_active_shards – Waits until the specified number of shards is active before returning a response. Use all for all shards.
wait_for_events – Waits until all currently queued events with the given priority are processed. Valid choices are immediate, urgent, high, normal, low, languid.
wait_for_no_initializing_shards – Whether to wait until there are no initializing shards in the cluster. Default is false.
wait_for_no_relocating_shards – Whether to wait until there are no relocating shards in the cluster. Default is false.
wait_for_nodes – Waits until the specified number of nodes (N) is available. Accepts >=N, <=N, >N, and <N. You can also use ge(N), le(N), gt(N), and lt(N) notation.
wait_for_status – Waits until the cluster health reaches the specified status or better. Valid choices are green, yellow, red.
index –
params (Any) –
headers (Any) –
- Return type:
- pending_tasks(*, params=None, headers=None)[source]
Returns a list of pending cluster-level tasks, such as index creation, mapping updates, or new allocations.
- Parameters:
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
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.
local – When true, the request retrieves information from the local node only. When false, information is retrieved from the cluster manager node. Default is false.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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.
params (Any) –
headers (Any) –
- Return type:
- post_voting_config_exclusions(*, params=None, headers=None)[source]
Updates the cluster voting configuration by excluding certain node IDs or names.
- Parameters:
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.
node_ids – A comma-separated list of node IDs to exclude from the voting configuration. When using this setting, you cannot also specify node_names. Either node_ids or node_names are required to receive a valid response.
node_names – A comma-separated list of node names to exclude from the voting configuration. When using this setting, you cannot also specify node_ids. Either node_ids or node_names are required to receive a valid response.
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 – When adding a voting configuration exclusion, the API waits for the specified nodes to be excluded from the voting configuration before returning a response. If the timeout expires before the appropriate condition is satisfied, the request fails and returns an error.
params (Any) –
headers (Any) –
- Return type:
- put_component_template(*, name, body, params=None, headers=None)[source]
Creates or updates a component template.
- Parameters:
name (Any) – The name of the component template to create. OpenSearch includes the following built-in component templates: logs- mappings, logs-settings, metrics-mappings, metrics-settings, synthetics-mapping, and synthetics-settings. OpenSearch uses these templates to configure backing indexes for its data streams. If you want to overwrite one of these templates, set the replacement template version to a higher value than the current version. If you want to disable all built-in component and index templates, set stack.templates.enabled to false using the [Cluster Update Settings API](https://opensearch.org/docs/latest/api-reference/cluster- api/cluster-settings/).
body (Any) – The template definition.
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
create – When true, this request cannot replace or update existing component templates. Default is false.
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.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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 – A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
name –
body –
params (Any) –
headers (Any) –
- Return type:
- put_decommission_awareness(*, awareness_attribute_name, awareness_attribute_value, params=None, headers=None)[source]
Decommissions a cluster zone based on awareness. This can greatly benefit multi-zone deployments, where awareness attributes can aid in applying new upgrades to a cluster in a controlled fashion.
- Parameters:
awareness_attribute_name (Any) – The name of the awareness attribute.
awareness_attribute_value (Any) – The value of the awareness attribute. For example, if you have shards allocated in two different zones, you can give each zone a value of zone-a or zoneb. The cluster decommission operation decommissions the zone listed in the method.
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.
awareness_attribute_name –
awareness_attribute_value –
params (Any) –
headers (Any) –
- Return type:
- put_settings(*, body, params=None, headers=None)[source]
Updates the cluster settings.
- Parameters:
body (Any) – The cluster settings to update.
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
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 – Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “cluster”: { “max_shards_per_node”: 500 } is “cluster.max_shards_per_node”: “500”. Default is false.
human – Whether to return human readable values for statistics. Default is True.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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 – A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
body –
params (Any) –
headers (Any) –
- Return type:
- put_weighted_routing(*, attribute, body=None, params=None, headers=None)[source]
Updates weighted shard routing weights.
- Parameters:
attribute (Any) – The name of awareness attribute, usually zone.
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.
attribute –
body (Any) –
params (Any) –
headers (Any) –
- Return type:
- remote_info(*, params=None, headers=None)[source]
Returns the information about configured remote clusters.
- Parameters:
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.
params (Any) –
headers (Any) –
- Return type:
- reroute(*, body=None, params=None, headers=None)[source]
Allows to manually change the allocation of individual shards in the cluster.
- Parameters:
body (Any) – The definition of commands to perform (move, cancel, allocate)
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
dry_run – When true, the request simulates the operation and returns the resulting state.
error_trace – Whether to include the stack trace of returned errors. Default is false.
explain – When true, the response contains an explanation of why reroute certain commands can or cannot be executed.
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.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
metric – Limits the information returned to the specified metrics.
pretty – Whether to pretty format the returned JSON response. Default is false.
retry_failed – When true, retries shard allocation if it was blocked because of too many subsequent failures.
source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
timeout – A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
body –
params (Any) –
headers (Any) –
- Return type:
- state(*, metric=None, index=None, params=None, headers=None)[source]
Returns comprehensive information about the state of the cluster.
- Parameters:
metric (Any) – Limits the information returned to only the [specified metric groups](https://opensearch.org/docs/latest/api- reference/cluster-api/cluster-stats/#metric-groups).
index (Any) – A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indexes, omit this parameter or use * or _all.
allow_no_indices – Whether to ignore a wildcard index expression that resolves into no concrete indexes. This includes the _all string or when no indexes have been specified.
cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).
error_trace – Whether to include the stack trace of returned errors. Default is false.
expand_wildcards – Specifies the type of index that wildcard expressions can match. Supports comma-separated values. Valid choices are all, closed, hidden, none, open.
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 – Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “cluster”: { “max_shards_per_node”: 500 } is “cluster.max_shards_per_node”: “500”. Default is false.
human – Whether to return human readable values for statistics. Default is True.
ignore_unavailable – Whether the specified concrete indexes should be ignored when unavailable (missing or closed).
local – Whether to return information from the local node only instead of from the cluster manager node. Default is false.
(Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts 0 without a unit and -1 to indicate an unspecified value.
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.
wait_for_metadata_version – Wait for the metadata version to be equal or greater than the specified metadata version.
wait_for_timeout – The maximum time to wait for wait_for_metadata_version before timing out.
metric –
index –
params (Any) –
headers (Any) –
- Return type:
- stats(*, node_id=None, params=None, headers=None, metric=None, index_metric=None)[source]
Returns a high-level overview of cluster statistics.
- Parameters:
metric (Any) – Limit the information returned to the specified metrics.
index_metric (Any) – A comma-separated list of [index metric groups](https://opensearch.org/docs/latest/api-reference/cluster- api/cluster-stats/#index-metric-groups), for example, docs,store.
node_id (Any) – A comma-separated list of node IDs used to filter results. Supports [node filters](https://opensearch.org/docs/latest/api- reference/nodes-apis/index/#node-filters).
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 – Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of “cluster”: { “max_shards_per_node”: 500 } is “cluster.max_shards_per_node”: “500”. 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 – The amount of time to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response’s _nodes.failed property. Defaults to no timeout.
node_id –
params (Any) –
headers (Any) –
metric –
index_metric –
- Return type: