elasticsearch 9.0.2__py3-none-any.whl → 9.0.4__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.
Files changed (61) hide show
  1. elasticsearch/_async/client/__init__.py +59 -202
  2. elasticsearch/_async/client/cat.py +1011 -59
  3. elasticsearch/_async/client/cluster.py +14 -4
  4. elasticsearch/_async/client/eql.py +10 -2
  5. elasticsearch/_async/client/esql.py +33 -10
  6. elasticsearch/_async/client/indices.py +88 -44
  7. elasticsearch/_async/client/inference.py +108 -3
  8. elasticsearch/_async/client/ingest.py +0 -7
  9. elasticsearch/_async/client/license.py +4 -4
  10. elasticsearch/_async/client/ml.py +6 -17
  11. elasticsearch/_async/client/monitoring.py +1 -1
  12. elasticsearch/_async/client/rollup.py +1 -22
  13. elasticsearch/_async/client/security.py +11 -17
  14. elasticsearch/_async/client/snapshot.py +6 -0
  15. elasticsearch/_async/client/sql.py +1 -1
  16. elasticsearch/_async/client/synonyms.py +1 -0
  17. elasticsearch/_async/client/transform.py +60 -0
  18. elasticsearch/_async/client/watcher.py +4 -2
  19. elasticsearch/_sync/client/__init__.py +59 -202
  20. elasticsearch/_sync/client/cat.py +1011 -59
  21. elasticsearch/_sync/client/cluster.py +14 -4
  22. elasticsearch/_sync/client/eql.py +10 -2
  23. elasticsearch/_sync/client/esql.py +33 -10
  24. elasticsearch/_sync/client/indices.py +88 -44
  25. elasticsearch/_sync/client/inference.py +108 -3
  26. elasticsearch/_sync/client/ingest.py +0 -7
  27. elasticsearch/_sync/client/license.py +4 -4
  28. elasticsearch/_sync/client/ml.py +6 -17
  29. elasticsearch/_sync/client/monitoring.py +1 -1
  30. elasticsearch/_sync/client/rollup.py +1 -22
  31. elasticsearch/_sync/client/security.py +11 -17
  32. elasticsearch/_sync/client/snapshot.py +6 -0
  33. elasticsearch/_sync/client/sql.py +1 -1
  34. elasticsearch/_sync/client/synonyms.py +1 -0
  35. elasticsearch/_sync/client/transform.py +60 -0
  36. elasticsearch/_sync/client/watcher.py +4 -2
  37. elasticsearch/_version.py +1 -1
  38. elasticsearch/compat.py +5 -0
  39. elasticsearch/dsl/__init__.py +2 -1
  40. elasticsearch/dsl/_async/document.py +84 -0
  41. elasticsearch/dsl/_sync/document.py +84 -0
  42. elasticsearch/dsl/document_base.py +219 -16
  43. elasticsearch/dsl/field.py +245 -57
  44. elasticsearch/dsl/query.py +7 -4
  45. elasticsearch/dsl/response/aggs.py +1 -1
  46. elasticsearch/dsl/types.py +125 -88
  47. elasticsearch/dsl/utils.py +2 -2
  48. elasticsearch/{dsl/_sync/_sync_check → esql}/__init__.py +3 -0
  49. elasticsearch/esql/esql.py +1156 -0
  50. elasticsearch/esql/functions.py +1750 -0
  51. {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/METADATA +1 -3
  52. {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/RECORD +55 -59
  53. elasticsearch/dsl/_sync/_sync_check/document.py +0 -514
  54. elasticsearch/dsl/_sync/_sync_check/faceted_search.py +0 -50
  55. elasticsearch/dsl/_sync/_sync_check/index.py +0 -597
  56. elasticsearch/dsl/_sync/_sync_check/mapping.py +0 -49
  57. elasticsearch/dsl/_sync/_sync_check/search.py +0 -230
  58. elasticsearch/dsl/_sync/_sync_check/update_by_query.py +0 -45
  59. {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/WHEEL +0 -0
  60. {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/licenses/LICENSE +0 -0
  61. {elasticsearch-9.0.2.dist-info → elasticsearch-9.0.4.dist-info}/licenses/NOTICE +0 -0
@@ -2213,13 +2213,10 @@ class SecurityClient(NamespacedClient):
2213
2213
  async def get_user_privileges(
2214
2214
  self,
2215
2215
  *,
2216
- application: t.Optional[str] = None,
2217
2216
  error_trace: t.Optional[bool] = None,
2218
2217
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2219
2218
  human: t.Optional[bool] = None,
2220
2219
  pretty: t.Optional[bool] = None,
2221
- priviledge: t.Optional[str] = None,
2222
- username: t.Optional[t.Union[None, str]] = None,
2223
2220
  ) -> ObjectApiResponse[t.Any]:
2224
2221
  """
2225
2222
  .. raw:: html
@@ -2232,19 +2229,10 @@ class SecurityClient(NamespacedClient):
2232
2229
 
2233
2230
 
2234
2231
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-get-user-privileges>`_
2235
-
2236
- :param application: The name of the application. Application privileges are always
2237
- associated with exactly one application. If you do not specify this parameter,
2238
- the API returns information about all privileges for all applications.
2239
- :param priviledge: The name of the privilege. If you do not specify this parameter,
2240
- the API returns information about all privileges for the requested application.
2241
- :param username:
2242
2232
  """
2243
2233
  __path_parts: t.Dict[str, str] = {}
2244
2234
  __path = "/_security/user/_privileges"
2245
2235
  __query: t.Dict[str, t.Any] = {}
2246
- if application is not None:
2247
- __query["application"] = application
2248
2236
  if error_trace is not None:
2249
2237
  __query["error_trace"] = error_trace
2250
2238
  if filter_path is not None:
@@ -2253,10 +2241,6 @@ class SecurityClient(NamespacedClient):
2253
2241
  __query["human"] = human
2254
2242
  if pretty is not None:
2255
2243
  __query["pretty"] = pretty
2256
- if priviledge is not None:
2257
- __query["priviledge"] = priviledge
2258
- if username is not None:
2259
- __query["username"] = username
2260
2244
  __headers = {"accept": "application/json"}
2261
2245
  return await self.perform_request( # type: ignore[return-value]
2262
2246
  "GET",
@@ -2345,6 +2329,9 @@ class SecurityClient(NamespacedClient):
2345
2329
  human: t.Optional[bool] = None,
2346
2330
  password: t.Optional[str] = None,
2347
2331
  pretty: t.Optional[bool] = None,
2332
+ refresh: t.Optional[
2333
+ t.Union[bool, str, t.Literal["false", "true", "wait_for"]]
2334
+ ] = None,
2348
2335
  run_as: t.Optional[str] = None,
2349
2336
  username: t.Optional[str] = None,
2350
2337
  body: t.Optional[t.Dict[str, t.Any]] = None,
@@ -2382,6 +2369,9 @@ class SecurityClient(NamespacedClient):
2382
2369
  types.
2383
2370
  :param password: The user's password. If you specify the `password` grant type,
2384
2371
  this parameter is required. It is not valid with other grant types.
2372
+ :param refresh: If 'true', Elasticsearch refreshes the affected shards to make
2373
+ this operation visible to search. If 'wait_for', it waits for a refresh to
2374
+ make this operation visible to search. If 'false', nothing is done with refreshes.
2385
2375
  :param run_as: The name of the user to be impersonated.
2386
2376
  :param username: The user name that identifies the user. If you specify the `password`
2387
2377
  grant type, this parameter is required. It is not valid with other grant
@@ -2403,6 +2393,8 @@ class SecurityClient(NamespacedClient):
2403
2393
  __query["human"] = human
2404
2394
  if pretty is not None:
2405
2395
  __query["pretty"] = pretty
2396
+ if refresh is not None:
2397
+ __query["refresh"] = refresh
2406
2398
  if not __body:
2407
2399
  if api_key is not None:
2408
2400
  __body["api_key"] = api_key
@@ -3553,7 +3545,8 @@ class SecurityClient(NamespacedClient):
3553
3545
  You can optionally filter the results with a query.</p>
3554
3546
  <p>To use this API, you must have at least the <code>manage_own_api_key</code> or the <code>read_security</code> cluster privileges.
3555
3547
  If you have only the <code>manage_own_api_key</code> privilege, this API returns only the API keys that you own.
3556
- If you have the <code>read_security</code>, <code>manage_api_key</code>, or greater privileges (including <code>manage_security</code>), this API returns all API keys regardless of ownership.</p>
3548
+ If you have the <code>read_security</code>, <code>manage_api_key</code>, or greater privileges (including <code>manage_security</code>), this API returns all API keys regardless of ownership.
3549
+ Refer to the linked documentation for examples of how to find API keys:</p>
3557
3550
 
3558
3551
 
3559
3552
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-query-api-keys>`_
@@ -4466,6 +4459,7 @@ class SecurityClient(NamespacedClient):
4466
4459
  <p>This API supports updates to an API key's access scope, metadata, and expiration.
4467
4460
  The owner user's information, such as the <code>username</code> and <code>realm</code>, is also updated automatically on every call.</p>
4468
4461
  <p>NOTE: This API cannot update REST API keys, which should be updated by either the update API key or bulk update API keys API.</p>
4462
+ <p>To learn more about how to use this API, refer to the <a href="https://www.elastic.co/docs/reference/elasticsearch/rest-apis/update-cc-api-key-examples">Update cross cluter API key API examples page</a>.</p>
4469
4463
 
4470
4464
 
4471
4465
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-security-update-cross-cluster-api-key>`_
@@ -403,6 +403,7 @@ class SnapshotClient(NamespacedClient):
403
403
  human: t.Optional[bool] = None,
404
404
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
405
405
  pretty: t.Optional[bool] = None,
406
+ wait_for_completion: t.Optional[bool] = None,
406
407
  ) -> ObjectApiResponse[t.Any]:
407
408
  """
408
409
  .. raw:: html
@@ -418,6 +419,9 @@ class SnapshotClient(NamespacedClient):
418
419
  :param master_timeout: The period to wait for the master node. If the master
419
420
  node is not available before the timeout expires, the request fails and returns
420
421
  an error. To indicate that the request should never timeout, set it to `-1`.
422
+ :param wait_for_completion: If `true`, the request returns a response when the
423
+ matching snapshots are all deleted. If `false`, the request returns a response
424
+ as soon as the deletes are scheduled.
421
425
  """
422
426
  if repository in SKIP_IN_PATH:
423
427
  raise ValueError("Empty value passed for parameter 'repository'")
@@ -439,6 +443,8 @@ class SnapshotClient(NamespacedClient):
439
443
  __query["master_timeout"] = master_timeout
440
444
  if pretty is not None:
441
445
  __query["pretty"] = pretty
446
+ if wait_for_completion is not None:
447
+ __query["wait_for_completion"] = wait_for_completion
442
448
  __headers = {"accept": "application/json"}
443
449
  return await self.perform_request( # type: ignore[return-value]
444
450
  "DELETE",
@@ -283,7 +283,7 @@ class SqlClient(NamespacedClient):
283
283
  keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
284
284
  keep_on_completion: t.Optional[bool] = None,
285
285
  page_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
286
- params: t.Optional[t.Mapping[str, t.Any]] = None,
286
+ params: t.Optional[t.Sequence[t.Any]] = None,
287
287
  pretty: t.Optional[bool] = None,
288
288
  query: t.Optional[str] = None,
289
289
  request_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -309,6 +309,7 @@ class SynonymsClient(NamespacedClient):
309
309
  If you need to manage more synonym rules, you can create multiple synonym sets.</p>
310
310
  <p>When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices.
311
311
  This is equivalent to invoking the reload search analyzers API for all indices that use the synonyms set.</p>
312
+ <p>For practical examples of how to create or update a synonyms set, refer to the External documentation.</p>
312
313
 
313
314
 
314
315
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-synonyms-put-synonym>`_
@@ -602,6 +602,66 @@ class TransformClient(NamespacedClient):
602
602
  path_parts=__path_parts,
603
603
  )
604
604
 
605
+ @_rewrite_parameters()
606
+ async def set_upgrade_mode(
607
+ self,
608
+ *,
609
+ enabled: t.Optional[bool] = None,
610
+ error_trace: t.Optional[bool] = None,
611
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
612
+ human: t.Optional[bool] = None,
613
+ pretty: t.Optional[bool] = None,
614
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
615
+ ) -> ObjectApiResponse[t.Any]:
616
+ """
617
+ .. raw:: html
618
+
619
+ <p>Set upgrade_mode for transform indices.
620
+ Sets a cluster wide upgrade_mode setting that prepares transform
621
+ indices for an upgrade.
622
+ When upgrading your cluster, in some circumstances you must restart your
623
+ nodes and reindex your transform indices. In those circumstances,
624
+ there must be no transforms running. You can close the transforms,
625
+ do the upgrade, then open all the transforms again. Alternatively,
626
+ you can use this API to temporarily halt tasks associated with the transforms
627
+ and prevent new transforms from opening. You can also use this API
628
+ during upgrades that do not require you to reindex your transform
629
+ indices, though stopping transforms is not a requirement in that case.
630
+ You can see the current value for the upgrade_mode setting by using the get
631
+ transform info API.</p>
632
+
633
+
634
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-set-upgrade-mode>`_
635
+
636
+ :param enabled: When `true`, it enables `upgrade_mode` which temporarily halts
637
+ all transform tasks and prohibits new transform tasks from starting.
638
+ :param timeout: The time to wait for the request to be completed.
639
+ """
640
+ __path_parts: t.Dict[str, str] = {}
641
+ __path = "/_transform/set_upgrade_mode"
642
+ __query: t.Dict[str, t.Any] = {}
643
+ if enabled is not None:
644
+ __query["enabled"] = enabled
645
+ if error_trace is not None:
646
+ __query["error_trace"] = error_trace
647
+ if filter_path is not None:
648
+ __query["filter_path"] = filter_path
649
+ if human is not None:
650
+ __query["human"] = human
651
+ if pretty is not None:
652
+ __query["pretty"] = pretty
653
+ if timeout is not None:
654
+ __query["timeout"] = timeout
655
+ __headers = {"accept": "application/json"}
656
+ return await self.perform_request( # type: ignore[return-value]
657
+ "POST",
658
+ __path,
659
+ params=__query,
660
+ headers=__headers,
661
+ endpoint_id="transform.set_upgrade_mode",
662
+ path_parts=__path_parts,
663
+ )
664
+
605
665
  @_rewrite_parameters(
606
666
  parameter_aliases={"from": "from_"},
607
667
  )
@@ -45,7 +45,8 @@ class WatcherClient(NamespacedClient):
45
45
  <p>IMPORTANT: If the specified watch is currently being executed, this API will return an error
46
46
  The reason for this behavior is to prevent overwriting the watch status from a watch execution.</p>
47
47
  <p>Acknowledging an action throttles further executions of that action until its <code>ack.state</code> is reset to <code>awaits_successful_execution</code>.
48
- This happens when the condition of the watch is not met (the condition evaluates to false).</p>
48
+ This happens when the condition of the watch is not met (the condition evaluates to false).
49
+ To demonstrate how throttling works in practice and how it can be configured for individual actions within a watch, refer to External documentation.</p>
49
50
 
50
51
 
51
52
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-watcher-ack-watch>`_
@@ -274,7 +275,8 @@ class WatcherClient(NamespacedClient):
274
275
  This serves as great tool for testing and debugging your watches prior to adding them to Watcher.</p>
275
276
  <p>When Elasticsearch security features are enabled on your cluster, watches are run with the privileges of the user that stored the watches.
276
277
  If your user is allowed to read index <code>a</code>, but not index <code>b</code>, then the exact same set of rules will apply during execution of a watch.</p>
277
- <p>When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch.</p>
278
+ <p>When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch.
279
+ Refer to the external documentation for examples of watch execution requests, including existing, customized, and inline watches.</p>
278
280
 
279
281
 
280
282
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-watcher-execute-watch>`_