elasticsearch 8.15.1__py3-none-any.whl → 8.17.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch/_async/client/__init__.py +237 -120
- elasticsearch/_async/client/async_search.py +33 -43
- elasticsearch/_async/client/autoscaling.py +59 -11
- elasticsearch/_async/client/cat.py +75 -66
- elasticsearch/_async/client/ccr.py +85 -35
- elasticsearch/_async/client/cluster.py +165 -70
- elasticsearch/_async/client/connector.py +112 -51
- elasticsearch/_async/client/dangling_indices.py +27 -12
- elasticsearch/_async/client/enrich.py +11 -11
- elasticsearch/_async/client/eql.py +13 -11
- elasticsearch/_async/client/esql.py +44 -5
- elasticsearch/_async/client/features.py +29 -6
- elasticsearch/_async/client/fleet.py +10 -2
- elasticsearch/_async/client/graph.py +9 -3
- elasticsearch/_async/client/ilm.py +74 -35
- elasticsearch/_async/client/indices.py +422 -152
- elasticsearch/_async/client/inference.py +4 -4
- elasticsearch/_async/client/ingest.py +47 -26
- elasticsearch/_async/client/license.py +38 -22
- elasticsearch/_async/client/logstash.py +3 -3
- elasticsearch/_async/client/migration.py +3 -3
- elasticsearch/_async/client/ml.py +346 -291
- elasticsearch/_async/client/monitoring.py +1 -1
- elasticsearch/_async/client/nodes.py +43 -21
- elasticsearch/_async/client/query_rules.py +69 -15
- elasticsearch/_async/client/rollup.py +23 -9
- elasticsearch/_async/client/search_application.py +35 -16
- elasticsearch/_async/client/searchable_snapshots.py +13 -5
- elasticsearch/_async/client/security.py +378 -180
- elasticsearch/_async/client/slm.py +9 -9
- elasticsearch/_async/client/snapshot.py +97 -12
- elasticsearch/_async/client/sql.py +21 -16
- elasticsearch/_async/client/ssl.py +18 -3
- elasticsearch/_async/client/synonyms.py +17 -14
- elasticsearch/_async/client/tasks.py +19 -9
- elasticsearch/_async/client/text_structure.py +2 -2
- elasticsearch/_async/client/transform.py +78 -72
- elasticsearch/_async/client/utils.py +4 -0
- elasticsearch/_async/client/watcher.py +11 -11
- elasticsearch/_async/client/xpack.py +5 -3
- elasticsearch/_async/helpers.py +19 -10
- elasticsearch/_otel.py +2 -2
- elasticsearch/_sync/client/__init__.py +237 -120
- elasticsearch/_sync/client/async_search.py +33 -43
- elasticsearch/_sync/client/autoscaling.py +59 -11
- elasticsearch/_sync/client/cat.py +75 -66
- elasticsearch/_sync/client/ccr.py +85 -35
- elasticsearch/_sync/client/cluster.py +165 -70
- elasticsearch/_sync/client/connector.py +112 -51
- elasticsearch/_sync/client/dangling_indices.py +27 -12
- elasticsearch/_sync/client/enrich.py +11 -11
- elasticsearch/_sync/client/eql.py +13 -11
- elasticsearch/_sync/client/esql.py +44 -5
- elasticsearch/_sync/client/features.py +29 -6
- elasticsearch/_sync/client/fleet.py +10 -2
- elasticsearch/_sync/client/graph.py +9 -3
- elasticsearch/_sync/client/ilm.py +74 -35
- elasticsearch/_sync/client/indices.py +422 -152
- elasticsearch/_sync/client/inference.py +4 -4
- elasticsearch/_sync/client/ingest.py +47 -26
- elasticsearch/_sync/client/license.py +38 -22
- elasticsearch/_sync/client/logstash.py +3 -3
- elasticsearch/_sync/client/migration.py +3 -3
- elasticsearch/_sync/client/ml.py +346 -291
- elasticsearch/_sync/client/monitoring.py +1 -1
- elasticsearch/_sync/client/nodes.py +43 -21
- elasticsearch/_sync/client/query_rules.py +69 -15
- elasticsearch/_sync/client/rollup.py +23 -9
- elasticsearch/_sync/client/search_application.py +35 -16
- elasticsearch/_sync/client/searchable_snapshots.py +13 -5
- elasticsearch/_sync/client/security.py +378 -180
- elasticsearch/_sync/client/slm.py +9 -9
- elasticsearch/_sync/client/snapshot.py +97 -12
- elasticsearch/_sync/client/sql.py +21 -16
- elasticsearch/_sync/client/ssl.py +18 -3
- elasticsearch/_sync/client/synonyms.py +17 -14
- elasticsearch/_sync/client/tasks.py +19 -9
- elasticsearch/_sync/client/text_structure.py +2 -2
- elasticsearch/_sync/client/transform.py +78 -72
- elasticsearch/_sync/client/utils.py +40 -0
- elasticsearch/_sync/client/watcher.py +11 -11
- elasticsearch/_sync/client/xpack.py +5 -3
- elasticsearch/_version.py +1 -1
- elasticsearch/exceptions.py +4 -0
- elasticsearch/helpers/actions.py +19 -10
- elasticsearch/helpers/errors.py +12 -4
- elasticsearch/helpers/vectorstore/_async/strategies.py +30 -9
- elasticsearch/helpers/vectorstore/_sync/strategies.py +30 -9
- {elasticsearch-8.15.1.dist-info → elasticsearch-8.17.0.dist-info}/METADATA +4 -3
- elasticsearch-8.17.0.dist-info/RECORD +117 -0
- {elasticsearch-8.15.1.dist-info → elasticsearch-8.17.0.dist-info}/WHEEL +1 -1
- elasticsearch-8.15.1.dist-info/RECORD +0 -117
- {elasticsearch-8.15.1.dist-info → elasticsearch-8.17.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-8.15.1.dist-info → elasticsearch-8.17.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -44,9 +44,15 @@ class ClusterClient(NamespacedClient):
|
|
|
44
44
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
45
45
|
) -> ObjectApiResponse[t.Any]:
|
|
46
46
|
"""
|
|
47
|
-
|
|
47
|
+
Explain the shard allocations. Get explanations for shard allocations in the
|
|
48
|
+
cluster. For unassigned shards, it provides an explanation for why the shard
|
|
49
|
+
is unassigned. For assigned shards, it provides an explanation for why the shard
|
|
50
|
+
is remaining on its current node and has not moved or rebalanced to another node.
|
|
51
|
+
This API can be very useful when attempting to diagnose why a shard is unassigned
|
|
52
|
+
or why a shard continues to remain on its current node when you might expect
|
|
53
|
+
otherwise.
|
|
48
54
|
|
|
49
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
55
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-allocation-explain.html>`_
|
|
50
56
|
|
|
51
57
|
:param current_node: Specifies the node ID or the name of the node to only explain
|
|
52
58
|
a shard that is currently located on the specified node.
|
|
@@ -113,10 +119,11 @@ class ClusterClient(NamespacedClient):
|
|
|
113
119
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
114
120
|
) -> ObjectApiResponse[t.Any]:
|
|
115
121
|
"""
|
|
116
|
-
Deletes component templates. Component templates
|
|
117
|
-
index templates that specify index mappings,
|
|
122
|
+
Delete component templates. Deletes component templates. Component templates
|
|
123
|
+
are building blocks for constructing index templates that specify index mappings,
|
|
124
|
+
settings, and aliases.
|
|
118
125
|
|
|
119
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
126
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
|
|
120
127
|
|
|
121
128
|
:param name: Comma-separated list or wildcard expression of component template
|
|
122
129
|
names used to limit the request.
|
|
@@ -164,9 +171,10 @@ class ClusterClient(NamespacedClient):
|
|
|
164
171
|
wait_for_removal: t.Optional[bool] = None,
|
|
165
172
|
) -> ObjectApiResponse[t.Any]:
|
|
166
173
|
"""
|
|
167
|
-
|
|
174
|
+
Clear cluster voting config exclusions. Remove master-eligible nodes from the
|
|
175
|
+
voting configuration exclusion list.
|
|
168
176
|
|
|
169
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
177
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/voting-config-exclusions.html>`_
|
|
170
178
|
|
|
171
179
|
:param wait_for_removal: Specifies whether to wait for all excluded nodes to
|
|
172
180
|
be removed from the cluster before clearing the voting configuration exclusions
|
|
@@ -211,9 +219,10 @@ class ClusterClient(NamespacedClient):
|
|
|
211
219
|
pretty: t.Optional[bool] = None,
|
|
212
220
|
) -> HeadApiResponse:
|
|
213
221
|
"""
|
|
214
|
-
Returns information about whether a particular component
|
|
222
|
+
Check component templates. Returns information about whether a particular component
|
|
223
|
+
template exists.
|
|
215
224
|
|
|
216
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
225
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
|
|
217
226
|
|
|
218
227
|
:param name: Comma-separated list of component template names used to limit the
|
|
219
228
|
request. Wildcard (*) expressions are supported.
|
|
@@ -266,9 +275,9 @@ class ClusterClient(NamespacedClient):
|
|
|
266
275
|
pretty: t.Optional[bool] = None,
|
|
267
276
|
) -> ObjectApiResponse[t.Any]:
|
|
268
277
|
"""
|
|
269
|
-
Retrieves information about component templates.
|
|
278
|
+
Get component templates. Retrieves information about component templates.
|
|
270
279
|
|
|
271
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
280
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
|
|
272
281
|
|
|
273
282
|
:param name: Comma-separated list of component template names used to limit the
|
|
274
283
|
request. Wildcard (`*`) expressions are supported.
|
|
@@ -329,10 +338,10 @@ class ClusterClient(NamespacedClient):
|
|
|
329
338
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
330
339
|
) -> ObjectApiResponse[t.Any]:
|
|
331
340
|
"""
|
|
332
|
-
|
|
333
|
-
|
|
341
|
+
Get cluster-wide settings. By default, it returns only settings that have been
|
|
342
|
+
explicitly defined.
|
|
334
343
|
|
|
335
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
344
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-get-settings.html>`_
|
|
336
345
|
|
|
337
346
|
:param flat_settings: If `true`, returns settings in flat format.
|
|
338
347
|
:param include_defaults: If `true`, returns default cluster settings from the
|
|
@@ -412,17 +421,18 @@ class ClusterClient(NamespacedClient):
|
|
|
412
421
|
] = None,
|
|
413
422
|
) -> ObjectApiResponse[t.Any]:
|
|
414
423
|
"""
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
424
|
+
Get the cluster health status. You can also use the API to get the health status
|
|
425
|
+
of only specified data streams and indices. For data streams, the API retrieves
|
|
426
|
+
the health status of the stream’s backing indices. The cluster health status
|
|
427
|
+
is: green, yellow or red. On the shard level, a red status indicates that the
|
|
428
|
+
specific shard is not allocated in the cluster. Yellow means that the primary
|
|
429
|
+
shard is allocated but replicas are not. Green means that all shards are allocated.
|
|
430
|
+
The index level status is controlled by the worst shard status. One of the main
|
|
431
|
+
benefits of the API is the ability to wait until the cluster reaches a certain
|
|
432
|
+
high watermark health level. The cluster status is controlled by the worst index
|
|
423
433
|
status.
|
|
424
434
|
|
|
425
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
435
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-health.html>`_
|
|
426
436
|
|
|
427
437
|
:param index: Comma-separated list of data streams, indices, and index aliases
|
|
428
438
|
used to limit the request. Wildcard expressions (`*`) are supported. To target
|
|
@@ -524,9 +534,9 @@ class ClusterClient(NamespacedClient):
|
|
|
524
534
|
pretty: t.Optional[bool] = None,
|
|
525
535
|
) -> ObjectApiResponse[t.Any]:
|
|
526
536
|
"""
|
|
527
|
-
Returns
|
|
537
|
+
Get cluster info. Returns basic information about the cluster.
|
|
528
538
|
|
|
529
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
539
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-info.html>`_
|
|
530
540
|
|
|
531
541
|
:param target: Limits the information returned to the specific target. Supports
|
|
532
542
|
a comma-separated list, such as http,ingest.
|
|
@@ -566,16 +576,16 @@ class ClusterClient(NamespacedClient):
|
|
|
566
576
|
pretty: t.Optional[bool] = None,
|
|
567
577
|
) -> ObjectApiResponse[t.Any]:
|
|
568
578
|
"""
|
|
569
|
-
|
|
570
|
-
or fail shard) that have not yet
|
|
571
|
-
of any pending updates to the cluster state.
|
|
572
|
-
reported by the
|
|
573
|
-
by the user, such as node stats, search queries,
|
|
574
|
-
if a user-initiated task such as a create
|
|
575
|
-
update, the activity of this task might
|
|
576
|
-
cluster tasks API.
|
|
579
|
+
Get the pending cluster tasks. Get information about cluster-level changes (such
|
|
580
|
+
as create index, update mapping, allocate or fail shard) that have not yet taken
|
|
581
|
+
effect. NOTE: This API returns a list of any pending updates to the cluster state.
|
|
582
|
+
These are distinct from the tasks reported by the task management API which include
|
|
583
|
+
periodic tasks and tasks initiated by the user, such as node stats, search queries,
|
|
584
|
+
or create index requests. However, if a user-initiated task such as a create
|
|
585
|
+
index command causes a cluster state update, the activity of this task might
|
|
586
|
+
be reported by both task api and pending cluster tasks API.
|
|
577
587
|
|
|
578
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
588
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-pending.html>`_
|
|
579
589
|
|
|
580
590
|
:param local: If `true`, the request retrieves information from the local node
|
|
581
591
|
only. If `false`, information is retrieved from the master node.
|
|
@@ -621,9 +631,35 @@ class ClusterClient(NamespacedClient):
|
|
|
621
631
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
622
632
|
) -> ObjectApiResponse[t.Any]:
|
|
623
633
|
"""
|
|
624
|
-
|
|
634
|
+
Update voting configuration exclusions. Update the cluster voting config exclusions
|
|
635
|
+
by node IDs or node names. By default, if there are more than three master-eligible
|
|
636
|
+
nodes in the cluster and you remove fewer than half of the master-eligible nodes
|
|
637
|
+
in the cluster at once, the voting configuration automatically shrinks. If you
|
|
638
|
+
want to shrink the voting configuration to contain fewer than three nodes or
|
|
639
|
+
to remove half or more of the master-eligible nodes in the cluster at once, use
|
|
640
|
+
this API to remove departing nodes from the voting configuration manually. The
|
|
641
|
+
API adds an entry for each specified node to the cluster’s voting configuration
|
|
642
|
+
exclusions list. It then waits until the cluster has reconfigured its voting
|
|
643
|
+
configuration to exclude the specified nodes. Clusters should have no voting
|
|
644
|
+
configuration exclusions in normal operation. Once the excluded nodes have stopped,
|
|
645
|
+
clear the voting configuration exclusions with `DELETE /_cluster/voting_config_exclusions`.
|
|
646
|
+
This API waits for the nodes to be fully removed from the cluster before it returns.
|
|
647
|
+
If your cluster has voting configuration exclusions for nodes that you no longer
|
|
648
|
+
intend to remove, use `DELETE /_cluster/voting_config_exclusions?wait_for_removal=false`
|
|
649
|
+
to clear the voting configuration exclusions without waiting for the nodes to
|
|
650
|
+
leave the cluster. A response to `POST /_cluster/voting_config_exclusions` with
|
|
651
|
+
an HTTP status code of 200 OK guarantees that the node has been removed from
|
|
652
|
+
the voting configuration and will not be reinstated until the voting configuration
|
|
653
|
+
exclusions are cleared by calling `DELETE /_cluster/voting_config_exclusions`.
|
|
654
|
+
If the call to `POST /_cluster/voting_config_exclusions` fails or returns a response
|
|
655
|
+
with an HTTP status code other than 200 OK then the node may not have been removed
|
|
656
|
+
from the voting configuration. In that case, you may safely retry the call. NOTE:
|
|
657
|
+
Voting exclusions are required only when you remove at least half of the master-eligible
|
|
658
|
+
nodes from a cluster in a short time period. They are not required when removing
|
|
659
|
+
master-ineligible nodes or when removing fewer than half of the master-eligible
|
|
660
|
+
nodes.
|
|
625
661
|
|
|
626
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
662
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/voting-config-exclusions.html>`_
|
|
627
663
|
|
|
628
664
|
:param node_ids: A comma-separated list of the persistent ids of the nodes to
|
|
629
665
|
exclude from the voting configuration. If specified, you may not also specify
|
|
@@ -683,24 +719,25 @@ class ClusterClient(NamespacedClient):
|
|
|
683
719
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
684
720
|
) -> ObjectApiResponse[t.Any]:
|
|
685
721
|
"""
|
|
686
|
-
|
|
687
|
-
for constructing index templates that
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
722
|
+
Create or update a component template. Creates or updates a component template.
|
|
723
|
+
Component templates are building blocks for constructing index templates that
|
|
724
|
+
specify index mappings, settings, and aliases. An index template can be composed
|
|
725
|
+
of multiple component templates. To use a component template, specify it in an
|
|
726
|
+
index template’s `composed_of` list. Component templates are only applied to
|
|
727
|
+
new data streams and indices as part of a matching index template. Settings and
|
|
728
|
+
mappings specified directly in the index template or the create index request
|
|
729
|
+
override any settings or mappings specified in a component template. Component
|
|
730
|
+
templates are only used during index creation. For data streams, this includes
|
|
731
|
+
data stream creation and the creation of a stream’s backing indices. Changes
|
|
732
|
+
to component templates do not affect existing indices, including a stream’s backing
|
|
733
|
+
indices. You can use C-style `/* *\\/` block comments in component templates.
|
|
697
734
|
You can include comments anywhere in the request body except before the opening
|
|
698
735
|
curly bracket.
|
|
699
736
|
|
|
700
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
737
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
|
|
701
738
|
|
|
702
739
|
:param name: Name of the component template to create. Elasticsearch includes
|
|
703
|
-
the following built-in component templates: `logs-mappings`;
|
|
740
|
+
the following built-in component templates: `logs-mappings`; `logs-settings`;
|
|
704
741
|
`metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`.
|
|
705
742
|
Elastic Agent uses these templates to configure backing indices for its data
|
|
706
743
|
streams. If you use Elastic Agent and want to overwrite one of these templates,
|
|
@@ -784,9 +821,28 @@ class ClusterClient(NamespacedClient):
|
|
|
784
821
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
785
822
|
) -> ObjectApiResponse[t.Any]:
|
|
786
823
|
"""
|
|
787
|
-
|
|
824
|
+
Update the cluster settings. Configure and update dynamic settings on a running
|
|
825
|
+
cluster. You can also configure dynamic settings locally on an unstarted or shut
|
|
826
|
+
down node in `elasticsearch.yml`. Updates made with this API can be persistent,
|
|
827
|
+
which apply across cluster restarts, or transient, which reset after a cluster
|
|
828
|
+
restart. You can also reset transient or persistent settings by assigning them
|
|
829
|
+
a null value. If you configure the same setting using multiple methods, Elasticsearch
|
|
830
|
+
applies the settings in following order of precedence: 1) Transient setting;
|
|
831
|
+
2) Persistent setting; 3) `elasticsearch.yml` setting; 4) Default setting value.
|
|
832
|
+
For example, you can apply a transient setting to override a persistent setting
|
|
833
|
+
or `elasticsearch.yml` setting. However, a change to an `elasticsearch.yml` setting
|
|
834
|
+
will not override a defined transient or persistent setting. TIP: In Elastic
|
|
835
|
+
Cloud, use the user settings feature to configure all cluster settings. This
|
|
836
|
+
method automatically rejects unsafe settings that could break your cluster. If
|
|
837
|
+
you run Elasticsearch on your own hardware, use this API to configure dynamic
|
|
838
|
+
cluster settings. Only use `elasticsearch.yml` for static cluster settings and
|
|
839
|
+
node settings. The API doesn’t require a restart and ensures a setting’s value
|
|
840
|
+
is the same on all nodes. WARNING: Transient cluster settings are no longer recommended.
|
|
841
|
+
Use persistent cluster settings instead. If a cluster becomes unstable, transient
|
|
842
|
+
settings can clear unexpectedly, resulting in a potentially undesired cluster
|
|
843
|
+
configuration.
|
|
788
844
|
|
|
789
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
845
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-update-settings.html>`_
|
|
790
846
|
|
|
791
847
|
:param flat_settings: Return settings in flat format (default: false)
|
|
792
848
|
:param master_timeout: Explicit operation timeout for connection to master node
|
|
@@ -838,11 +894,11 @@ class ClusterClient(NamespacedClient):
|
|
|
838
894
|
pretty: t.Optional[bool] = None,
|
|
839
895
|
) -> ObjectApiResponse[t.Any]:
|
|
840
896
|
"""
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
897
|
+
Get remote cluster information. Get all of the configured remote cluster information.
|
|
898
|
+
This API returns connection and endpoint information keyed by the configured
|
|
899
|
+
remote cluster alias.
|
|
844
900
|
|
|
845
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
901
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-remote-info.html>`_
|
|
846
902
|
"""
|
|
847
903
|
__path_parts: t.Dict[str, str] = {}
|
|
848
904
|
__path = "/_remote/info"
|
|
@@ -885,15 +941,35 @@ class ClusterClient(NamespacedClient):
|
|
|
885
941
|
body: t.Optional[t.Dict[str, t.Any]] = None,
|
|
886
942
|
) -> ObjectApiResponse[t.Any]:
|
|
887
943
|
"""
|
|
888
|
-
|
|
944
|
+
Reroute the cluster. Manually change the allocation of individual shards in the
|
|
945
|
+
cluster. For example, a shard can be moved from one node to another explicitly,
|
|
946
|
+
an allocation can be canceled, and an unassigned shard can be explicitly allocated
|
|
947
|
+
to a specific node. It is important to note that after processing any reroute
|
|
948
|
+
commands Elasticsearch will perform rebalancing as normal (respecting the values
|
|
949
|
+
of settings such as `cluster.routing.rebalance.enable`) in order to remain in
|
|
950
|
+
a balanced state. For example, if the requested allocation includes moving a
|
|
951
|
+
shard from node1 to node2 then this may cause a shard to be moved from node2
|
|
952
|
+
back to node1 to even things out. The cluster can be set to disable allocations
|
|
953
|
+
using the `cluster.routing.allocation.enable` setting. If allocations are disabled
|
|
954
|
+
then the only allocations that will be performed are explicit ones given using
|
|
955
|
+
the reroute command, and consequent allocations due to rebalancing. The cluster
|
|
956
|
+
will attempt to allocate a shard a maximum of `index.allocation.max_retries`
|
|
957
|
+
times in a row (defaults to `5`), before giving up and leaving the shard unallocated.
|
|
958
|
+
This scenario can be caused by structural problems such as having an analyzer
|
|
959
|
+
which refers to a stopwords file which doesn’t exist on all nodes. Once the problem
|
|
960
|
+
has been corrected, allocation can be manually retried by calling the reroute
|
|
961
|
+
API with the `?retry_failed` URI query parameter, which will attempt a single
|
|
962
|
+
retry round for these shards.
|
|
889
963
|
|
|
890
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
964
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-reroute.html>`_
|
|
891
965
|
|
|
892
966
|
:param commands: Defines the commands to perform.
|
|
893
|
-
:param dry_run: If true, then the request simulates the operation
|
|
894
|
-
the
|
|
967
|
+
:param dry_run: If true, then the request simulates the operation. It will calculate
|
|
968
|
+
the result of applying the commands to the current cluster state and return
|
|
969
|
+
the resulting cluster state after the commands (and rebalancing) have been
|
|
970
|
+
applied; it will not actually perform the requested changes.
|
|
895
971
|
:param explain: If true, then the response contains an explanation of why the
|
|
896
|
-
commands can or cannot
|
|
972
|
+
commands can or cannot run.
|
|
897
973
|
:param master_timeout: Period to wait for a connection to the master node. If
|
|
898
974
|
no response is received before the timeout expires, the request fails and
|
|
899
975
|
returns an error.
|
|
@@ -972,9 +1048,28 @@ class ClusterClient(NamespacedClient):
|
|
|
972
1048
|
wait_for_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
973
1049
|
) -> ObjectApiResponse[t.Any]:
|
|
974
1050
|
"""
|
|
975
|
-
|
|
1051
|
+
Get the cluster state. Get comprehensive information about the state of the cluster.
|
|
1052
|
+
The cluster state is an internal data structure which keeps track of a variety
|
|
1053
|
+
of information needed by every node, including the identity and attributes of
|
|
1054
|
+
the other nodes in the cluster; cluster-wide settings; index metadata, including
|
|
1055
|
+
the mapping and settings for each index; the location and status of every shard
|
|
1056
|
+
copy in the cluster. The elected master node ensures that every node in the cluster
|
|
1057
|
+
has a copy of the same cluster state. This API lets you retrieve a representation
|
|
1058
|
+
of this internal state for debugging or diagnostic purposes. You may need to
|
|
1059
|
+
consult the Elasticsearch source code to determine the precise meaning of the
|
|
1060
|
+
response. By default the API will route requests to the elected master node since
|
|
1061
|
+
this node is the authoritative source of cluster states. You can also retrieve
|
|
1062
|
+
the cluster state held on the node handling the API request by adding the `?local=true`
|
|
1063
|
+
query parameter. Elasticsearch may need to expend significant effort to compute
|
|
1064
|
+
a response to this API in larger clusters, and the response may comprise a very
|
|
1065
|
+
large quantity of data. If you use this API repeatedly, your cluster may become
|
|
1066
|
+
unstable. WARNING: The response is a representation of an internal data structure.
|
|
1067
|
+
Its format is not subject to the same compatibility guarantees as other more
|
|
1068
|
+
stable APIs and may change from version to version. Do not query this API using
|
|
1069
|
+
external monitoring tools. Instead, obtain the information you require using
|
|
1070
|
+
other more stable cluster APIs.
|
|
976
1071
|
|
|
977
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1072
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-state.html>`_
|
|
978
1073
|
|
|
979
1074
|
:param metric: Limit the information returned to the specified metrics
|
|
980
1075
|
:param index: A comma-separated list of index names; use `_all` or empty string
|
|
@@ -1050,21 +1145,21 @@ class ClusterClient(NamespacedClient):
|
|
|
1050
1145
|
node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1051
1146
|
error_trace: t.Optional[bool] = None,
|
|
1052
1147
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
1053
|
-
flat_settings: t.Optional[bool] = None,
|
|
1054
1148
|
human: t.Optional[bool] = None,
|
|
1149
|
+
include_remotes: t.Optional[bool] = None,
|
|
1055
1150
|
pretty: t.Optional[bool] = None,
|
|
1056
1151
|
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
|
|
1057
1152
|
) -> ObjectApiResponse[t.Any]:
|
|
1058
1153
|
"""
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1154
|
+
Get cluster statistics. Get basic index metrics (shard numbers, store size, memory
|
|
1155
|
+
usage) and information about the current nodes that form the cluster (number,
|
|
1156
|
+
roles, os, jvm versions, memory usage, cpu and installed plugins).
|
|
1062
1157
|
|
|
1063
|
-
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.
|
|
1158
|
+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/cluster-stats.html>`_
|
|
1064
1159
|
|
|
1065
1160
|
:param node_id: Comma-separated list of node filters used to limit returned information.
|
|
1066
1161
|
Defaults to all nodes in the cluster.
|
|
1067
|
-
:param
|
|
1162
|
+
:param include_remotes: Include remote cluster data into the response
|
|
1068
1163
|
:param timeout: Period to wait for each node to respond. If a node does not respond
|
|
1069
1164
|
before its timeout expires, the response does not include its stats. However,
|
|
1070
1165
|
timed out nodes are included in the response’s `_nodes.failed` property.
|
|
@@ -1082,10 +1177,10 @@ class ClusterClient(NamespacedClient):
|
|
|
1082
1177
|
__query["error_trace"] = error_trace
|
|
1083
1178
|
if filter_path is not None:
|
|
1084
1179
|
__query["filter_path"] = filter_path
|
|
1085
|
-
if flat_settings is not None:
|
|
1086
|
-
__query["flat_settings"] = flat_settings
|
|
1087
1180
|
if human is not None:
|
|
1088
1181
|
__query["human"] = human
|
|
1182
|
+
if include_remotes is not None:
|
|
1183
|
+
__query["include_remotes"] = include_remotes
|
|
1089
1184
|
if pretty is not None:
|
|
1090
1185
|
__query["pretty"] = pretty
|
|
1091
1186
|
if timeout is not None:
|