elasticsearch 9.2.0__py3-none-any.whl → 9.3.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 +108 -85
- elasticsearch/_async/client/async_search.py +7 -6
- elasticsearch/_async/client/autoscaling.py +15 -4
- elasticsearch/_async/client/cat.py +203 -10
- elasticsearch/_async/client/ccr.py +10 -10
- elasticsearch/_async/client/cluster.py +98 -66
- elasticsearch/_async/client/connector.py +42 -41
- elasticsearch/_async/client/dangling_indices.py +8 -12
- elasticsearch/_async/client/enrich.py +10 -10
- elasticsearch/_async/client/eql.py +17 -16
- elasticsearch/_async/client/esql.py +173 -24
- elasticsearch/_async/client/features.py +6 -6
- elasticsearch/_async/client/fleet.py +8 -8
- elasticsearch/_async/client/graph.py +3 -3
- elasticsearch/_async/client/ilm.py +18 -18
- elasticsearch/_async/client/indices.py +564 -149
- elasticsearch/_async/client/inference.py +374 -64
- elasticsearch/_async/client/ingest.py +9 -9
- elasticsearch/_async/client/license.py +5 -7
- elasticsearch/_async/client/logstash.py +4 -4
- elasticsearch/_async/client/migration.py +6 -6
- elasticsearch/_async/client/ml.py +132 -88
- elasticsearch/_async/client/monitoring.py +4 -3
- elasticsearch/_async/client/nodes.py +182 -20
- elasticsearch/_async/client/project.py +13 -4
- elasticsearch/_async/client/query_rules.py +16 -16
- elasticsearch/_async/client/rollup.py +21 -21
- elasticsearch/_async/client/search_application.py +19 -19
- elasticsearch/_async/client/searchable_snapshots.py +10 -10
- elasticsearch/_async/client/security.py +34 -10
- elasticsearch/_async/client/shutdown.py +15 -4
- elasticsearch/_async/client/simulate.py +4 -4
- elasticsearch/_async/client/slm.py +17 -17
- elasticsearch/_async/client/snapshot.py +21 -21
- elasticsearch/_async/client/sql.py +17 -16
- elasticsearch/_async/client/streams.py +6 -7
- elasticsearch/_async/client/synonyms.py +10 -10
- elasticsearch/_async/client/tasks.py +8 -8
- elasticsearch/_async/client/text_structure.py +16 -12
- elasticsearch/_async/client/transform.py +51 -12
- elasticsearch/_async/client/utils.py +4 -2
- elasticsearch/_async/client/watcher.py +26 -26
- elasticsearch/_async/client/xpack.py +6 -5
- elasticsearch/_sync/client/__init__.py +110 -85
- elasticsearch/_sync/client/async_search.py +7 -6
- elasticsearch/_sync/client/autoscaling.py +15 -4
- elasticsearch/_sync/client/cat.py +203 -10
- elasticsearch/_sync/client/ccr.py +10 -10
- elasticsearch/_sync/client/cluster.py +98 -66
- elasticsearch/_sync/client/connector.py +42 -41
- elasticsearch/_sync/client/dangling_indices.py +8 -12
- elasticsearch/_sync/client/enrich.py +10 -10
- elasticsearch/_sync/client/eql.py +17 -16
- elasticsearch/_sync/client/esql.py +173 -24
- elasticsearch/_sync/client/features.py +6 -6
- elasticsearch/_sync/client/fleet.py +8 -8
- elasticsearch/_sync/client/graph.py +3 -3
- elasticsearch/_sync/client/ilm.py +18 -18
- elasticsearch/_sync/client/indices.py +564 -149
- elasticsearch/_sync/client/inference.py +374 -64
- elasticsearch/_sync/client/ingest.py +9 -9
- elasticsearch/_sync/client/license.py +5 -7
- elasticsearch/_sync/client/logstash.py +4 -4
- elasticsearch/_sync/client/migration.py +6 -6
- elasticsearch/_sync/client/ml.py +132 -88
- elasticsearch/_sync/client/monitoring.py +4 -3
- elasticsearch/_sync/client/nodes.py +182 -20
- elasticsearch/_sync/client/project.py +13 -4
- elasticsearch/_sync/client/project_routing.py +264 -0
- elasticsearch/_sync/client/query_rules.py +16 -16
- elasticsearch/_sync/client/rollup.py +21 -21
- elasticsearch/_sync/client/search_application.py +19 -19
- elasticsearch/_sync/client/searchable_snapshots.py +10 -10
- elasticsearch/_sync/client/security.py +34 -10
- elasticsearch/_sync/client/shutdown.py +15 -4
- elasticsearch/_sync/client/simulate.py +4 -4
- elasticsearch/_sync/client/slm.py +17 -17
- elasticsearch/_sync/client/snapshot.py +21 -21
- elasticsearch/_sync/client/sql.py +17 -16
- elasticsearch/_sync/client/streams.py +6 -7
- elasticsearch/_sync/client/synonyms.py +10 -10
- elasticsearch/_sync/client/tasks.py +8 -8
- elasticsearch/_sync/client/text_structure.py +16 -12
- elasticsearch/_sync/client/transform.py +51 -12
- elasticsearch/_sync/client/utils.py +16 -2
- elasticsearch/_sync/client/watcher.py +26 -26
- elasticsearch/_sync/client/xpack.py +6 -5
- elasticsearch/_version.py +2 -2
- elasticsearch/dsl/__init__.py +4 -0
- elasticsearch/dsl/_async/document.py +4 -5
- elasticsearch/dsl/_async/index.py +1 -1
- elasticsearch/dsl/_async/search.py +2 -3
- elasticsearch/dsl/_sync/document.py +4 -5
- elasticsearch/dsl/_sync/index.py +1 -1
- elasticsearch/dsl/_sync/search.py +2 -3
- elasticsearch/dsl/aggs.py +9 -9
- elasticsearch/dsl/async_connections.py +1 -2
- elasticsearch/dsl/connections.py +1 -2
- elasticsearch/dsl/document_base.py +1 -1
- elasticsearch/dsl/field.py +90 -6
- elasticsearch/dsl/pydantic.py +1 -1
- elasticsearch/dsl/query.py +25 -2
- elasticsearch/dsl/response/__init__.py +2 -0
- elasticsearch/dsl/serializer.py +1 -2
- elasticsearch/dsl/types.py +63 -8
- elasticsearch/dsl/utils.py +12 -4
- elasticsearch/esql/esql.py +1 -1
- elasticsearch/esql/functions.py +926 -252
- elasticsearch/helpers/__init__.py +2 -0
- elasticsearch/helpers/actions.py +21 -0
- elasticsearch/helpers/vectorstore/__init__.py +7 -7
- elasticsearch/helpers/vectorstore/_async/_utils.py +1 -1
- elasticsearch/helpers/vectorstore/_async/embedding_service.py +2 -2
- elasticsearch/helpers/vectorstore/_async/strategies.py +3 -3
- elasticsearch/helpers/vectorstore/_async/vectorstore.py +8 -5
- elasticsearch/helpers/vectorstore/_sync/_utils.py +1 -1
- elasticsearch/helpers/vectorstore/_sync/embedding_service.py +2 -2
- elasticsearch/helpers/vectorstore/_sync/strategies.py +3 -3
- elasticsearch/helpers/vectorstore/_sync/vectorstore.py +8 -5
- {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/METADATA +2 -1
- elasticsearch-9.3.0.dist-info/RECORD +169 -0
- {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/WHEEL +1 -1
- elasticsearch-9.2.0.dist-info/RECORD +0 -168
- {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch-9.2.0.dist-info → elasticsearch-9.3.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -23,16 +23,16 @@ from ._base import NamespacedClient
|
|
|
23
23
|
from .utils import (
|
|
24
24
|
SKIP_IN_PATH,
|
|
25
25
|
Stability,
|
|
26
|
+
_availability_warning,
|
|
26
27
|
_quote,
|
|
27
28
|
_rewrite_parameters,
|
|
28
|
-
_stability_warning,
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class NodesClient(NamespacedClient):
|
|
33
33
|
|
|
34
34
|
@_rewrite_parameters()
|
|
35
|
-
@
|
|
35
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
36
36
|
def clear_repositories_metering_archive(
|
|
37
37
|
self,
|
|
38
38
|
*,
|
|
@@ -46,8 +46,8 @@ class NodesClient(NamespacedClient):
|
|
|
46
46
|
"""
|
|
47
47
|
.. raw:: html
|
|
48
48
|
|
|
49
|
-
<p>Clear the archived repositories metering
|
|
50
|
-
Clear the archived repositories metering information in the cluster.</p>
|
|
49
|
+
<p>Clear the archived repositories metering.</p>
|
|
50
|
+
<p>Clear the archived repositories metering information in the cluster.</p>
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-clear-repositories-metering-archive>`_
|
|
@@ -86,7 +86,7 @@ class NodesClient(NamespacedClient):
|
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
@_rewrite_parameters()
|
|
89
|
-
@
|
|
89
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
90
90
|
def get_repositories_metering_info(
|
|
91
91
|
self,
|
|
92
92
|
*,
|
|
@@ -99,8 +99,8 @@ class NodesClient(NamespacedClient):
|
|
|
99
99
|
"""
|
|
100
100
|
.. raw:: html
|
|
101
101
|
|
|
102
|
-
<p>Get cluster repositories metering
|
|
103
|
-
Get repositories metering information for a cluster.
|
|
102
|
+
<p>Get cluster repositories metering.</p>
|
|
103
|
+
<p>Get repositories metering information for a cluster.
|
|
104
104
|
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.
|
|
105
105
|
Additionally, the information exposed by this API is volatile, meaning that it will not be present after node restarts.</p>
|
|
106
106
|
|
|
@@ -157,8 +157,8 @@ class NodesClient(NamespacedClient):
|
|
|
157
157
|
"""
|
|
158
158
|
.. raw:: html
|
|
159
159
|
|
|
160
|
-
<p>Get the hot threads for nodes
|
|
161
|
-
Get a breakdown of the hot threads on each selected node in the cluster.
|
|
160
|
+
<p>Get the hot threads for nodes.</p>
|
|
161
|
+
<p>Get a breakdown of the hot threads on each selected node in the cluster.
|
|
162
162
|
The output is plain text with a breakdown of the top hot threads for each node.</p>
|
|
163
163
|
|
|
164
164
|
|
|
@@ -169,7 +169,7 @@ class NodesClient(NamespacedClient):
|
|
|
169
169
|
select, or to get a task from an empty queue) are filtered out.
|
|
170
170
|
:param interval: The interval to do the second sampling of threads.
|
|
171
171
|
:param snapshots: Number of samples of thread stacktrace.
|
|
172
|
-
:param sort: The sort order for 'cpu' type
|
|
172
|
+
:param sort: The sort order for 'cpu' type
|
|
173
173
|
:param threads: Specifies the number of hot threads to provide information for.
|
|
174
174
|
:param timeout: Period to wait for a response. If no response is received before
|
|
175
175
|
the timeout expires, the request fails and returns an error.
|
|
@@ -220,7 +220,50 @@ class NodesClient(NamespacedClient):
|
|
|
220
220
|
self,
|
|
221
221
|
*,
|
|
222
222
|
node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
223
|
-
metric: t.Optional[
|
|
223
|
+
metric: t.Optional[
|
|
224
|
+
t.Union[
|
|
225
|
+
t.Sequence[
|
|
226
|
+
t.Union[
|
|
227
|
+
str,
|
|
228
|
+
t.Literal[
|
|
229
|
+
"_all",
|
|
230
|
+
"_none",
|
|
231
|
+
"aggregations",
|
|
232
|
+
"http",
|
|
233
|
+
"indices",
|
|
234
|
+
"ingest",
|
|
235
|
+
"jvm",
|
|
236
|
+
"os",
|
|
237
|
+
"plugins",
|
|
238
|
+
"process",
|
|
239
|
+
"remote_cluster_server",
|
|
240
|
+
"settings",
|
|
241
|
+
"thread_pool",
|
|
242
|
+
"transport",
|
|
243
|
+
],
|
|
244
|
+
]
|
|
245
|
+
],
|
|
246
|
+
t.Union[
|
|
247
|
+
str,
|
|
248
|
+
t.Literal[
|
|
249
|
+
"_all",
|
|
250
|
+
"_none",
|
|
251
|
+
"aggregations",
|
|
252
|
+
"http",
|
|
253
|
+
"indices",
|
|
254
|
+
"ingest",
|
|
255
|
+
"jvm",
|
|
256
|
+
"os",
|
|
257
|
+
"plugins",
|
|
258
|
+
"process",
|
|
259
|
+
"remote_cluster_server",
|
|
260
|
+
"settings",
|
|
261
|
+
"thread_pool",
|
|
262
|
+
"transport",
|
|
263
|
+
],
|
|
264
|
+
],
|
|
265
|
+
]
|
|
266
|
+
] = None,
|
|
224
267
|
error_trace: t.Optional[bool] = None,
|
|
225
268
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
226
269
|
flat_settings: t.Optional[bool] = None,
|
|
@@ -357,8 +400,120 @@ class NodesClient(NamespacedClient):
|
|
|
357
400
|
self,
|
|
358
401
|
*,
|
|
359
402
|
node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
360
|
-
metric: t.Optional[
|
|
361
|
-
|
|
403
|
+
metric: t.Optional[
|
|
404
|
+
t.Union[
|
|
405
|
+
t.Sequence[
|
|
406
|
+
t.Union[
|
|
407
|
+
str,
|
|
408
|
+
t.Literal[
|
|
409
|
+
"_all",
|
|
410
|
+
"_none",
|
|
411
|
+
"adaptive_selection",
|
|
412
|
+
"allocations",
|
|
413
|
+
"breaker",
|
|
414
|
+
"discovery",
|
|
415
|
+
"fs",
|
|
416
|
+
"http",
|
|
417
|
+
"indexing_pressure",
|
|
418
|
+
"indices",
|
|
419
|
+
"ingest",
|
|
420
|
+
"jvm",
|
|
421
|
+
"os",
|
|
422
|
+
"process",
|
|
423
|
+
"repositories",
|
|
424
|
+
"script",
|
|
425
|
+
"script_cache",
|
|
426
|
+
"thread_pool",
|
|
427
|
+
"transport",
|
|
428
|
+
],
|
|
429
|
+
]
|
|
430
|
+
],
|
|
431
|
+
t.Union[
|
|
432
|
+
str,
|
|
433
|
+
t.Literal[
|
|
434
|
+
"_all",
|
|
435
|
+
"_none",
|
|
436
|
+
"adaptive_selection",
|
|
437
|
+
"allocations",
|
|
438
|
+
"breaker",
|
|
439
|
+
"discovery",
|
|
440
|
+
"fs",
|
|
441
|
+
"http",
|
|
442
|
+
"indexing_pressure",
|
|
443
|
+
"indices",
|
|
444
|
+
"ingest",
|
|
445
|
+
"jvm",
|
|
446
|
+
"os",
|
|
447
|
+
"process",
|
|
448
|
+
"repositories",
|
|
449
|
+
"script",
|
|
450
|
+
"script_cache",
|
|
451
|
+
"thread_pool",
|
|
452
|
+
"transport",
|
|
453
|
+
],
|
|
454
|
+
],
|
|
455
|
+
]
|
|
456
|
+
] = None,
|
|
457
|
+
index_metric: t.Optional[
|
|
458
|
+
t.Union[
|
|
459
|
+
t.Sequence[
|
|
460
|
+
t.Union[
|
|
461
|
+
str,
|
|
462
|
+
t.Literal[
|
|
463
|
+
"_all",
|
|
464
|
+
"bulk",
|
|
465
|
+
"completion",
|
|
466
|
+
"dense_vector",
|
|
467
|
+
"docs",
|
|
468
|
+
"fielddata",
|
|
469
|
+
"flush",
|
|
470
|
+
"get",
|
|
471
|
+
"indexing",
|
|
472
|
+
"mappings",
|
|
473
|
+
"merge",
|
|
474
|
+
"query_cache",
|
|
475
|
+
"recovery",
|
|
476
|
+
"refresh",
|
|
477
|
+
"request_cache",
|
|
478
|
+
"search",
|
|
479
|
+
"segments",
|
|
480
|
+
"shard_stats",
|
|
481
|
+
"sparse_vector",
|
|
482
|
+
"store",
|
|
483
|
+
"translog",
|
|
484
|
+
"warmer",
|
|
485
|
+
],
|
|
486
|
+
]
|
|
487
|
+
],
|
|
488
|
+
t.Union[
|
|
489
|
+
str,
|
|
490
|
+
t.Literal[
|
|
491
|
+
"_all",
|
|
492
|
+
"bulk",
|
|
493
|
+
"completion",
|
|
494
|
+
"dense_vector",
|
|
495
|
+
"docs",
|
|
496
|
+
"fielddata",
|
|
497
|
+
"flush",
|
|
498
|
+
"get",
|
|
499
|
+
"indexing",
|
|
500
|
+
"mappings",
|
|
501
|
+
"merge",
|
|
502
|
+
"query_cache",
|
|
503
|
+
"recovery",
|
|
504
|
+
"refresh",
|
|
505
|
+
"request_cache",
|
|
506
|
+
"search",
|
|
507
|
+
"segments",
|
|
508
|
+
"shard_stats",
|
|
509
|
+
"sparse_vector",
|
|
510
|
+
"store",
|
|
511
|
+
"translog",
|
|
512
|
+
"warmer",
|
|
513
|
+
],
|
|
514
|
+
],
|
|
515
|
+
]
|
|
516
|
+
] = None,
|
|
362
517
|
completion_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
363
518
|
error_trace: t.Optional[bool] = None,
|
|
364
519
|
fielddata_fields: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
@@ -376,8 +531,8 @@ class NodesClient(NamespacedClient):
|
|
|
376
531
|
"""
|
|
377
532
|
.. raw:: html
|
|
378
533
|
|
|
379
|
-
<p>Get node statistics
|
|
380
|
-
Get statistics for nodes in a cluster.
|
|
534
|
+
<p>Get node statistics.</p>
|
|
535
|
+
<p>Get statistics for nodes in a cluster.
|
|
381
536
|
By default, all stats are returned. You can limit the returned information by using metrics.</p>
|
|
382
537
|
|
|
383
538
|
|
|
@@ -385,7 +540,7 @@ class NodesClient(NamespacedClient):
|
|
|
385
540
|
|
|
386
541
|
:param node_id: Comma-separated list of node IDs or names used to limit returned
|
|
387
542
|
information.
|
|
388
|
-
:param metric:
|
|
543
|
+
:param metric: Limits the information returned to the specific metrics.
|
|
389
544
|
:param index_metric: Limit the information returned for indices metric to the
|
|
390
545
|
specific index metrics. It can be used only if indices (or all) metric is
|
|
391
546
|
specified.
|
|
@@ -483,7 +638,14 @@ class NodesClient(NamespacedClient):
|
|
|
483
638
|
self,
|
|
484
639
|
*,
|
|
485
640
|
node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
486
|
-
metric: t.Optional[
|
|
641
|
+
metric: t.Optional[
|
|
642
|
+
t.Union[
|
|
643
|
+
t.Sequence[
|
|
644
|
+
t.Union[str, t.Literal["_all", "aggregations", "rest_actions"]]
|
|
645
|
+
],
|
|
646
|
+
t.Union[str, t.Literal["_all", "aggregations", "rest_actions"]],
|
|
647
|
+
]
|
|
648
|
+
] = None,
|
|
487
649
|
error_trace: t.Optional[bool] = None,
|
|
488
650
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
489
651
|
human: t.Optional[bool] = None,
|
|
@@ -499,10 +661,10 @@ class NodesClient(NamespacedClient):
|
|
|
499
661
|
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-usage>`_
|
|
500
662
|
|
|
501
663
|
:param node_id: A comma-separated list of node IDs or names to limit the returned
|
|
502
|
-
information
|
|
503
|
-
to, leave empty to get information from all nodes
|
|
664
|
+
information. Use `_local` to return information from the node you're connecting
|
|
665
|
+
to, leave empty to get information from all nodes.
|
|
504
666
|
:param metric: Limits the information returned to the specific metrics. A comma-separated
|
|
505
|
-
list of the following options: `_all`, `rest_actions`.
|
|
667
|
+
list of the following options: `_all`, `rest_actions`, `aggregations`.
|
|
506
668
|
:param timeout: Period to wait for a response. If no response is received before
|
|
507
669
|
the timeout expires, the request fails and returns an error.
|
|
508
670
|
"""
|
|
@@ -22,15 +22,15 @@ from elastic_transport import ObjectApiResponse
|
|
|
22
22
|
from ._base import NamespacedClient
|
|
23
23
|
from .utils import (
|
|
24
24
|
Stability,
|
|
25
|
+
_availability_warning,
|
|
25
26
|
_rewrite_parameters,
|
|
26
|
-
_stability_warning,
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class ProjectClient(NamespacedClient):
|
|
31
31
|
|
|
32
32
|
@_rewrite_parameters()
|
|
33
|
-
@
|
|
33
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
34
34
|
def tags(
|
|
35
35
|
self,
|
|
36
36
|
*,
|
|
@@ -38,12 +38,19 @@ class ProjectClient(NamespacedClient):
|
|
|
38
38
|
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
39
39
|
human: t.Optional[bool] = None,
|
|
40
40
|
pretty: t.Optional[bool] = None,
|
|
41
|
+
project_routing: t.Optional[str] = None,
|
|
41
42
|
) -> ObjectApiResponse[t.Any]:
|
|
42
43
|
"""
|
|
43
44
|
.. raw:: html
|
|
44
45
|
|
|
45
|
-
<p>
|
|
46
|
+
<p>Get tags.</p>
|
|
47
|
+
<p>Get the tags that are defined for the project.</p>
|
|
46
48
|
|
|
49
|
+
|
|
50
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-project-tags>`_
|
|
51
|
+
|
|
52
|
+
:param project_routing: A Lucene query using project metadata tags used to filter
|
|
53
|
+
which projects are returned in the response, such as _alias:_origin or _alias:*pr*.
|
|
47
54
|
"""
|
|
48
55
|
__path_parts: t.Dict[str, str] = {}
|
|
49
56
|
__path = "/_project/tags"
|
|
@@ -56,9 +63,11 @@ class ProjectClient(NamespacedClient):
|
|
|
56
63
|
__query["human"] = human
|
|
57
64
|
if pretty is not None:
|
|
58
65
|
__query["pretty"] = pretty
|
|
66
|
+
if project_routing is not None:
|
|
67
|
+
__query["project_routing"] = project_routing
|
|
59
68
|
__headers = {"accept": "application/json"}
|
|
60
69
|
return self.perform_request( # type: ignore[return-value]
|
|
61
|
-
"
|
|
70
|
+
"POST",
|
|
62
71
|
__path,
|
|
63
72
|
params=__query,
|
|
64
73
|
headers=__headers,
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright
|
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
18
|
+
import typing as t
|
|
19
|
+
|
|
20
|
+
from elastic_transport import ObjectApiResponse
|
|
21
|
+
|
|
22
|
+
from ._base import NamespacedClient
|
|
23
|
+
from .utils import (
|
|
24
|
+
SKIP_IN_PATH,
|
|
25
|
+
Stability,
|
|
26
|
+
_availability_warning,
|
|
27
|
+
_quote,
|
|
28
|
+
_rewrite_parameters,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ProjectRoutingClient(NamespacedClient):
|
|
33
|
+
|
|
34
|
+
@_rewrite_parameters(
|
|
35
|
+
body_name="expressions",
|
|
36
|
+
)
|
|
37
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
38
|
+
def create(
|
|
39
|
+
self,
|
|
40
|
+
*,
|
|
41
|
+
name: str,
|
|
42
|
+
expressions: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
43
|
+
body: t.Optional[t.Mapping[str, t.Any]] = None,
|
|
44
|
+
error_trace: t.Optional[bool] = None,
|
|
45
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
46
|
+
human: t.Optional[bool] = None,
|
|
47
|
+
pretty: t.Optional[bool] = None,
|
|
48
|
+
) -> ObjectApiResponse[t.Any]:
|
|
49
|
+
"""
|
|
50
|
+
.. raw:: html
|
|
51
|
+
|
|
52
|
+
<p>Create of update a single named project routing expression.</p>
|
|
53
|
+
<p>Create of update a single named project routing expression.</p>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
:param name: The name of project routing expression
|
|
57
|
+
:param expressions:
|
|
58
|
+
"""
|
|
59
|
+
if name in SKIP_IN_PATH:
|
|
60
|
+
raise ValueError("Empty value passed for parameter 'name'")
|
|
61
|
+
if expressions is None and body is None:
|
|
62
|
+
raise ValueError(
|
|
63
|
+
"Empty value passed for parameters 'expressions' and 'body', one of them should be set."
|
|
64
|
+
)
|
|
65
|
+
elif expressions is not None and body is not None:
|
|
66
|
+
raise ValueError("Cannot set both 'expressions' and 'body'")
|
|
67
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
68
|
+
__path = f'/_project_routing/{__path_parts["name"]}'
|
|
69
|
+
__query: t.Dict[str, t.Any] = {}
|
|
70
|
+
if error_trace is not None:
|
|
71
|
+
__query["error_trace"] = error_trace
|
|
72
|
+
if filter_path is not None:
|
|
73
|
+
__query["filter_path"] = filter_path
|
|
74
|
+
if human is not None:
|
|
75
|
+
__query["human"] = human
|
|
76
|
+
if pretty is not None:
|
|
77
|
+
__query["pretty"] = pretty
|
|
78
|
+
__body = expressions if expressions is not None else body
|
|
79
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
80
|
+
return self.perform_request( # type: ignore[return-value]
|
|
81
|
+
"PUT",
|
|
82
|
+
__path,
|
|
83
|
+
params=__query,
|
|
84
|
+
headers=__headers,
|
|
85
|
+
body=__body,
|
|
86
|
+
endpoint_id="project_routing.create",
|
|
87
|
+
path_parts=__path_parts,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
@_rewrite_parameters(
|
|
91
|
+
body_name="expressions",
|
|
92
|
+
)
|
|
93
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
94
|
+
def create_many(
|
|
95
|
+
self,
|
|
96
|
+
*,
|
|
97
|
+
expressions: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
98
|
+
body: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
|
|
99
|
+
error_trace: t.Optional[bool] = None,
|
|
100
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
101
|
+
human: t.Optional[bool] = None,
|
|
102
|
+
pretty: t.Optional[bool] = None,
|
|
103
|
+
) -> ObjectApiResponse[t.Any]:
|
|
104
|
+
"""
|
|
105
|
+
.. raw:: html
|
|
106
|
+
|
|
107
|
+
<p>Create of update named project routing expressions.</p>
|
|
108
|
+
<p>Create or update named project routing expressions.</p>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
:param expressions:
|
|
112
|
+
"""
|
|
113
|
+
if expressions is None and body is None:
|
|
114
|
+
raise ValueError(
|
|
115
|
+
"Empty value passed for parameters 'expressions' and 'body', one of them should be set."
|
|
116
|
+
)
|
|
117
|
+
elif expressions is not None and body is not None:
|
|
118
|
+
raise ValueError("Cannot set both 'expressions' and 'body'")
|
|
119
|
+
__path_parts: t.Dict[str, str] = {}
|
|
120
|
+
__path = "/_project_routing"
|
|
121
|
+
__query: t.Dict[str, t.Any] = {}
|
|
122
|
+
if error_trace is not None:
|
|
123
|
+
__query["error_trace"] = error_trace
|
|
124
|
+
if filter_path is not None:
|
|
125
|
+
__query["filter_path"] = filter_path
|
|
126
|
+
if human is not None:
|
|
127
|
+
__query["human"] = human
|
|
128
|
+
if pretty is not None:
|
|
129
|
+
__query["pretty"] = pretty
|
|
130
|
+
__body = expressions if expressions is not None else body
|
|
131
|
+
__headers = {"accept": "application/json", "content-type": "application/json"}
|
|
132
|
+
return self.perform_request( # type: ignore[return-value]
|
|
133
|
+
"PUT",
|
|
134
|
+
__path,
|
|
135
|
+
params=__query,
|
|
136
|
+
headers=__headers,
|
|
137
|
+
body=__body,
|
|
138
|
+
endpoint_id="project_routing.create_many",
|
|
139
|
+
path_parts=__path_parts,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
@_rewrite_parameters()
|
|
143
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
144
|
+
def delete(
|
|
145
|
+
self,
|
|
146
|
+
*,
|
|
147
|
+
name: str,
|
|
148
|
+
error_trace: t.Optional[bool] = None,
|
|
149
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
150
|
+
human: t.Optional[bool] = None,
|
|
151
|
+
pretty: t.Optional[bool] = None,
|
|
152
|
+
) -> ObjectApiResponse[t.Any]:
|
|
153
|
+
"""
|
|
154
|
+
.. raw:: html
|
|
155
|
+
|
|
156
|
+
<p>Delete named project routing expressions.</p>
|
|
157
|
+
<p>Delete named project routing expressions.</p>
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
:param name: The name of project routing expression
|
|
161
|
+
"""
|
|
162
|
+
if name in SKIP_IN_PATH:
|
|
163
|
+
raise ValueError("Empty value passed for parameter 'name'")
|
|
164
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
165
|
+
__path = f'/_project_routing/{__path_parts["name"]}'
|
|
166
|
+
__query: t.Dict[str, t.Any] = {}
|
|
167
|
+
if error_trace is not None:
|
|
168
|
+
__query["error_trace"] = error_trace
|
|
169
|
+
if filter_path is not None:
|
|
170
|
+
__query["filter_path"] = filter_path
|
|
171
|
+
if human is not None:
|
|
172
|
+
__query["human"] = human
|
|
173
|
+
if pretty is not None:
|
|
174
|
+
__query["pretty"] = pretty
|
|
175
|
+
__headers = {"accept": "application/json"}
|
|
176
|
+
return self.perform_request( # type: ignore[return-value]
|
|
177
|
+
"DELETE",
|
|
178
|
+
__path,
|
|
179
|
+
params=__query,
|
|
180
|
+
headers=__headers,
|
|
181
|
+
endpoint_id="project_routing.delete",
|
|
182
|
+
path_parts=__path_parts,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
@_rewrite_parameters()
|
|
186
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
187
|
+
def get(
|
|
188
|
+
self,
|
|
189
|
+
*,
|
|
190
|
+
name: str,
|
|
191
|
+
error_trace: t.Optional[bool] = None,
|
|
192
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
193
|
+
human: t.Optional[bool] = None,
|
|
194
|
+
pretty: t.Optional[bool] = None,
|
|
195
|
+
) -> ObjectApiResponse[t.Any]:
|
|
196
|
+
"""
|
|
197
|
+
.. raw:: html
|
|
198
|
+
|
|
199
|
+
<p>Get named project routing expressions.</p>
|
|
200
|
+
<p>Get named project routing expressions.</p>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
:param name: The name of project routing expression
|
|
204
|
+
"""
|
|
205
|
+
if name in SKIP_IN_PATH:
|
|
206
|
+
raise ValueError("Empty value passed for parameter 'name'")
|
|
207
|
+
__path_parts: t.Dict[str, str] = {"name": _quote(name)}
|
|
208
|
+
__path = f'/_project_routing/{__path_parts["name"]}'
|
|
209
|
+
__query: t.Dict[str, t.Any] = {}
|
|
210
|
+
if error_trace is not None:
|
|
211
|
+
__query["error_trace"] = error_trace
|
|
212
|
+
if filter_path is not None:
|
|
213
|
+
__query["filter_path"] = filter_path
|
|
214
|
+
if human is not None:
|
|
215
|
+
__query["human"] = human
|
|
216
|
+
if pretty is not None:
|
|
217
|
+
__query["pretty"] = pretty
|
|
218
|
+
__headers = {"accept": "application/json"}
|
|
219
|
+
return self.perform_request( # type: ignore[return-value]
|
|
220
|
+
"GET",
|
|
221
|
+
__path,
|
|
222
|
+
params=__query,
|
|
223
|
+
headers=__headers,
|
|
224
|
+
endpoint_id="project_routing.get",
|
|
225
|
+
path_parts=__path_parts,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
@_rewrite_parameters()
|
|
229
|
+
@_availability_warning(Stability.EXPERIMENTAL)
|
|
230
|
+
def get_many(
|
|
231
|
+
self,
|
|
232
|
+
*,
|
|
233
|
+
error_trace: t.Optional[bool] = None,
|
|
234
|
+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
|
|
235
|
+
human: t.Optional[bool] = None,
|
|
236
|
+
pretty: t.Optional[bool] = None,
|
|
237
|
+
) -> ObjectApiResponse[t.Any]:
|
|
238
|
+
"""
|
|
239
|
+
.. raw:: html
|
|
240
|
+
|
|
241
|
+
<p>Get named project routing expressions.</p>
|
|
242
|
+
<p>Get named project routing expressions.</p>
|
|
243
|
+
|
|
244
|
+
"""
|
|
245
|
+
__path_parts: t.Dict[str, str] = {}
|
|
246
|
+
__path = "/_project_routing"
|
|
247
|
+
__query: t.Dict[str, t.Any] = {}
|
|
248
|
+
if error_trace is not None:
|
|
249
|
+
__query["error_trace"] = error_trace
|
|
250
|
+
if filter_path is not None:
|
|
251
|
+
__query["filter_path"] = filter_path
|
|
252
|
+
if human is not None:
|
|
253
|
+
__query["human"] = human
|
|
254
|
+
if pretty is not None:
|
|
255
|
+
__query["pretty"] = pretty
|
|
256
|
+
__headers = {"accept": "application/json"}
|
|
257
|
+
return self.perform_request( # type: ignore[return-value]
|
|
258
|
+
"GET",
|
|
259
|
+
__path,
|
|
260
|
+
params=__query,
|
|
261
|
+
headers=__headers,
|
|
262
|
+
endpoint_id="project_routing.get_many",
|
|
263
|
+
path_parts=__path_parts,
|
|
264
|
+
)
|