elasticsearch9 9.0.1__py3-none-any.whl → 9.0.3__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 (52) hide show
  1. elasticsearch9/_async/client/__init__.py +47 -203
  2. elasticsearch9/_async/client/cat.py +594 -32
  3. elasticsearch9/_async/client/cluster.py +14 -4
  4. elasticsearch9/_async/client/eql.py +10 -2
  5. elasticsearch9/_async/client/esql.py +17 -4
  6. elasticsearch9/_async/client/indices.py +100 -47
  7. elasticsearch9/_async/client/inference.py +110 -75
  8. elasticsearch9/_async/client/ingest.py +0 -7
  9. elasticsearch9/_async/client/license.py +4 -4
  10. elasticsearch9/_async/client/ml.py +6 -17
  11. elasticsearch9/_async/client/monitoring.py +1 -1
  12. elasticsearch9/_async/client/rollup.py +1 -22
  13. elasticsearch9/_async/client/security.py +11 -17
  14. elasticsearch9/_async/client/snapshot.py +6 -0
  15. elasticsearch9/_async/client/synonyms.py +1 -0
  16. elasticsearch9/_async/client/watcher.py +4 -2
  17. elasticsearch9/_sync/client/__init__.py +47 -203
  18. elasticsearch9/_sync/client/cat.py +594 -32
  19. elasticsearch9/_sync/client/cluster.py +14 -4
  20. elasticsearch9/_sync/client/eql.py +10 -2
  21. elasticsearch9/_sync/client/esql.py +17 -4
  22. elasticsearch9/_sync/client/indices.py +100 -47
  23. elasticsearch9/_sync/client/inference.py +110 -75
  24. elasticsearch9/_sync/client/ingest.py +0 -7
  25. elasticsearch9/_sync/client/license.py +4 -4
  26. elasticsearch9/_sync/client/ml.py +6 -17
  27. elasticsearch9/_sync/client/monitoring.py +1 -1
  28. elasticsearch9/_sync/client/rollup.py +1 -22
  29. elasticsearch9/_sync/client/security.py +11 -17
  30. elasticsearch9/_sync/client/snapshot.py +6 -0
  31. elasticsearch9/_sync/client/synonyms.py +1 -0
  32. elasticsearch9/_sync/client/watcher.py +4 -2
  33. elasticsearch9/_version.py +1 -1
  34. elasticsearch9/compat.py +5 -0
  35. elasticsearch9/dsl/__init__.py +2 -1
  36. elasticsearch9/dsl/_async/document.py +1 -1
  37. elasticsearch9/dsl/_sync/document.py +1 -1
  38. elasticsearch9/dsl/document_base.py +176 -16
  39. elasticsearch9/dsl/field.py +223 -38
  40. elasticsearch9/dsl/query.py +49 -4
  41. elasticsearch9/dsl/types.py +107 -16
  42. elasticsearch9/dsl/utils.py +1 -1
  43. elasticsearch9/esql/__init__.py +18 -0
  44. elasticsearch9/esql/esql.py +1105 -0
  45. elasticsearch9/esql/functions.py +1738 -0
  46. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/METADATA +1 -3
  47. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/RECORD +50 -49
  48. elasticsearch9-9.0.1.dist-info/licenses/LICENSE.txt +0 -175
  49. elasticsearch9-9.0.1.dist-info/licenses/NOTICE.txt +0 -559
  50. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/WHEEL +0 -0
  51. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/licenses/LICENSE +0 -0
  52. {elasticsearch9-9.0.1.dist-info → elasticsearch9-9.0.3.dist-info}/licenses/NOTICE +0 -0
@@ -288,7 +288,6 @@ class IngestClient(NamespacedClient):
288
288
  error_trace: t.Optional[bool] = None,
289
289
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
290
290
  human: t.Optional[bool] = None,
291
- master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
292
291
  pretty: t.Optional[bool] = None,
293
292
  ) -> ObjectApiResponse[t.Any]:
294
293
  """
@@ -302,10 +301,6 @@ class IngestClient(NamespacedClient):
302
301
  :param id: Comma-separated list of database configuration IDs to retrieve. Wildcard
303
302
  (`*`) expressions are supported. To get all database configurations, omit
304
303
  this parameter or use `*`.
305
- :param master_timeout: The period to wait for a connection to the master node.
306
- If no response is received before the timeout expires, the request fails
307
- and returns an error. A value of `-1` indicates that the request should never
308
- time out.
309
304
  """
310
305
  __path_parts: t.Dict[str, str]
311
306
  if id not in SKIP_IN_PATH:
@@ -321,8 +316,6 @@ class IngestClient(NamespacedClient):
321
316
  __query["filter_path"] = filter_path
322
317
  if human is not None:
323
318
  __query["human"] = human
324
- if master_timeout is not None:
325
- __query["master_timeout"] = master_timeout
326
319
  if pretty is not None:
327
320
  __query["pretty"] = pretty
328
321
  __headers = {"accept": "application/json"}
@@ -353,7 +353,7 @@ class LicenseClient(NamespacedClient):
353
353
  human: t.Optional[bool] = None,
354
354
  master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
355
355
  pretty: t.Optional[bool] = None,
356
- type_query_string: t.Optional[str] = None,
356
+ type: t.Optional[str] = None,
357
357
  ) -> ObjectApiResponse[t.Any]:
358
358
  """
359
359
  .. raw:: html
@@ -370,7 +370,7 @@ class LicenseClient(NamespacedClient):
370
370
  :param acknowledge: whether the user has acknowledged acknowledge messages (default:
371
371
  false)
372
372
  :param master_timeout: Period to wait for a connection to the master node.
373
- :param type_query_string:
373
+ :param type: The type of trial license to generate (default: "trial")
374
374
  """
375
375
  __path_parts: t.Dict[str, str] = {}
376
376
  __path = "/_license/start_trial"
@@ -387,8 +387,8 @@ class LicenseClient(NamespacedClient):
387
387
  __query["master_timeout"] = master_timeout
388
388
  if pretty is not None:
389
389
  __query["pretty"] = pretty
390
- if type_query_string is not None:
391
- __query["type_query_string"] = type_query_string
390
+ if type is not None:
391
+ __query["type"] = type
392
392
  __headers = {"accept": "application/json"}
393
393
  return await self.perform_request( # type: ignore[return-value]
394
394
  "POST",
@@ -3549,7 +3549,8 @@ class MlClient(NamespacedClient):
3549
3549
  Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job.
3550
3550
  You can associate only one datafeed with each anomaly detection job.
3551
3551
  The datafeed contains a query that runs at a defined interval (<code>frequency</code>).
3552
- If you are concerned about delayed data, you can add a delay (<code>query_delay') at each interval. By default, the datafeed uses the following query: </code>{&quot;match_all&quot;: {&quot;boost&quot;: 1}}`.</p>
3552
+ If you are concerned about delayed data, you can add a delay (<code>query_delay</code>) at each interval.
3553
+ By default, the datafeed uses the following query: <code>{&quot;match_all&quot;: {&quot;boost&quot;: 1}}</code>.</p>
3553
3554
  <p>When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had
3554
3555
  at the time of creation and runs the query using those same roles. If you provide secondary authorization headers,
3555
3556
  those credentials are used instead.
@@ -3871,13 +3872,7 @@ class MlClient(NamespacedClient):
3871
3872
  :param description: A description of the job.
3872
3873
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
3873
3874
  request can target data streams, this argument determines whether wildcard
3874
- expressions match hidden data streams. Supports comma-separated values. Valid
3875
- values are: * `all`: Match any data stream or index, including hidden ones.
3876
- * `closed`: Match closed, non-hidden indices. Also matches any non-hidden
3877
- data stream. Data streams cannot be closed. * `hidden`: Match hidden data
3878
- streams and hidden indices. Must be combined with `open`, `closed`, or both.
3879
- * `none`: Wildcard patterns are not accepted. * `open`: Match open, non-hidden
3880
- indices. Also matches any non-hidden data stream.
3875
+ expressions match hidden data streams. Supports comma-separated values.
3881
3876
  :param groups: A list of job groups. A job can belong to no groups or many.
3882
3877
  :param ignore_throttled: If `true`, concrete, expanded or aliased indices are
3883
3878
  ignored when frozen.
@@ -4999,7 +4994,7 @@ class MlClient(NamespacedClient):
4999
4994
  <p>Update a data frame analytics job.</p>
5000
4995
 
5001
4996
 
5002
- `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-ml-update-data-frame-analytics>`_
4997
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-data-frame-analytics>`_
5003
4998
 
5004
4999
  :param id: Identifier for the data frame analytics job. This identifier can contain
5005
5000
  lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
@@ -5140,13 +5135,7 @@ class MlClient(NamespacedClient):
5140
5135
  check runs only on real-time datafeeds.
5141
5136
  :param expand_wildcards: Type of index that wildcard patterns can match. If the
5142
5137
  request can target data streams, this argument determines whether wildcard
5143
- expressions match hidden data streams. Supports comma-separated values. Valid
5144
- values are: * `all`: Match any data stream or index, including hidden ones.
5145
- * `closed`: Match closed, non-hidden indices. Also matches any non-hidden
5146
- data stream. Data streams cannot be closed. * `hidden`: Match hidden data
5147
- streams and hidden indices. Must be combined with `open`, `closed`, or both.
5148
- * `none`: Wildcard patterns are not accepted. * `open`: Match open, non-hidden
5149
- indices. Also matches any non-hidden data stream.
5138
+ expressions match hidden data streams. Supports comma-separated values.
5150
5139
  :param frequency: The interval at which scheduled queries are made while the
5151
5140
  datafeed runs in real time. The default value is either the bucket span for
5152
5141
  short bucket spans, or, for longer bucket spans, a sensible fraction of the
@@ -5801,7 +5790,7 @@ class MlClient(NamespacedClient):
5801
5790
  <p>Validate an anomaly detection job.</p>
5802
5791
 
5803
5792
 
5804
- `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/>`_
5793
+ `<https://www.elastic.co/docs/api/doc/elasticsearch>`_
5805
5794
 
5806
5795
  :param detector:
5807
5796
  """
@@ -48,7 +48,7 @@ class MonitoringClient(NamespacedClient):
48
48
  This API is used by the monitoring features to send monitoring data.</p>
49
49
 
50
50
 
51
- `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/>`_
51
+ `<https://www.elastic.co/docs/api/doc/elasticsearch>`_
52
52
 
53
53
  :param interval: Collection interval (e.g., '10s' or '10000ms') of the payload
54
54
  :param operations:
@@ -419,28 +419,7 @@ class RollupClient(NamespacedClient):
419
419
  The following functionality is not available:</p>
420
420
  <p><code>size</code>: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely.
421
421
  <code>highlighter</code>, <code>suggestors</code>, <code>post_filter</code>, <code>profile</code>, <code>explain</code>: These are similarly disallowed.</p>
422
- <p><strong>Searching both historical rollup and non-rollup data</strong></p>
423
- <p>The rollup search API has the capability to search across both &quot;live&quot; non-rollup data and the aggregated rollup data.
424
- This is done by simply adding the live indices to the URI. For example:</p>
425
- <pre><code>GET sensor-1,sensor_rollup/_rollup_search
426
- {
427
- &quot;size&quot;: 0,
428
- &quot;aggregations&quot;: {
429
- &quot;max_temperature&quot;: {
430
- &quot;max&quot;: {
431
- &quot;field&quot;: &quot;temperature&quot;
432
- }
433
- }
434
- }
435
- }
436
- </code></pre>
437
- <p>The rollup search endpoint does two things when the search runs:</p>
438
- <ul>
439
- <li>The original request is sent to the non-rollup index unaltered.</li>
440
- <li>A rewritten version of the original request is sent to the rollup index.</li>
441
- </ul>
442
- <p>When the two responses are received, the endpoint rewrites the rollup response and merges the two together.
443
- During the merging process, if there is any overlap in buckets between the two responses, the buckets from the non-rollup index are used.</p>
422
+ <p>For more detailed examples of using the rollup search API, including querying rolled-up data only or combining rolled-up and live data, refer to the External documentation.</p>
444
423
 
445
424
 
446
425
  `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-rollup-rollup-search>`_
@@ -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",
@@ -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>`_
@@ -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>`_