elasticsearch 8.19.1__py3-none-any.whl → 8.19.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 (112) hide show
  1. elasticsearch/_async/client/__init__.py +66 -67
  2. elasticsearch/_async/client/async_search.py +3 -3
  3. elasticsearch/_async/client/autoscaling.py +8 -4
  4. elasticsearch/_async/client/cat.py +521 -27
  5. elasticsearch/_async/client/ccr.py +2 -2
  6. elasticsearch/_async/client/cluster.py +10 -9
  7. elasticsearch/_async/client/connector.py +37 -36
  8. elasticsearch/_async/client/dangling_indices.py +6 -10
  9. elasticsearch/_async/client/eql.py +2 -2
  10. elasticsearch/_async/client/esql.py +1 -1
  11. elasticsearch/_async/client/features.py +2 -2
  12. elasticsearch/_async/client/fleet.py +4 -8
  13. elasticsearch/_async/client/graph.py +1 -5
  14. elasticsearch/_async/client/ilm.py +2 -10
  15. elasticsearch/_async/client/indices.py +393 -56
  16. elasticsearch/_async/client/inference.py +35 -121
  17. elasticsearch/_async/client/ingest.py +1 -1
  18. elasticsearch/_async/client/license.py +3 -5
  19. elasticsearch/_async/client/ml.py +61 -21
  20. elasticsearch/_async/client/monitoring.py +2 -1
  21. elasticsearch/_async/client/nodes.py +9 -9
  22. elasticsearch/_async/client/rollup.py +9 -9
  23. elasticsearch/_async/client/search_application.py +11 -11
  24. elasticsearch/_async/client/searchable_snapshots.py +4 -4
  25. elasticsearch/_async/client/security.py +4 -4
  26. elasticsearch/_async/client/shutdown.py +12 -17
  27. elasticsearch/_async/client/simulate.py +2 -2
  28. elasticsearch/_async/client/slm.py +2 -6
  29. elasticsearch/_async/client/snapshot.py +3 -2
  30. elasticsearch/_async/client/streams.py +185 -0
  31. elasticsearch/_async/client/tasks.py +4 -4
  32. elasticsearch/_async/client/text_structure.py +5 -1
  33. elasticsearch/_async/client/transform.py +37 -0
  34. elasticsearch/_async/client/utils.py +4 -2
  35. elasticsearch/_async/client/watcher.py +3 -7
  36. elasticsearch/_async/client/xpack.py +2 -1
  37. elasticsearch/_async/helpers.py +58 -9
  38. elasticsearch/_sync/client/__init__.py +68 -67
  39. elasticsearch/_sync/client/async_search.py +3 -3
  40. elasticsearch/_sync/client/autoscaling.py +8 -4
  41. elasticsearch/_sync/client/cat.py +521 -27
  42. elasticsearch/_sync/client/ccr.py +2 -2
  43. elasticsearch/_sync/client/cluster.py +10 -9
  44. elasticsearch/_sync/client/connector.py +37 -36
  45. elasticsearch/_sync/client/dangling_indices.py +6 -10
  46. elasticsearch/_sync/client/eql.py +2 -2
  47. elasticsearch/_sync/client/esql.py +1 -1
  48. elasticsearch/_sync/client/features.py +2 -2
  49. elasticsearch/_sync/client/fleet.py +4 -8
  50. elasticsearch/_sync/client/graph.py +1 -5
  51. elasticsearch/_sync/client/ilm.py +2 -10
  52. elasticsearch/_sync/client/indices.py +393 -56
  53. elasticsearch/_sync/client/inference.py +35 -121
  54. elasticsearch/_sync/client/ingest.py +1 -1
  55. elasticsearch/_sync/client/license.py +3 -5
  56. elasticsearch/_sync/client/ml.py +61 -21
  57. elasticsearch/_sync/client/monitoring.py +2 -1
  58. elasticsearch/_sync/client/nodes.py +9 -9
  59. elasticsearch/_sync/client/rollup.py +9 -9
  60. elasticsearch/_sync/client/search_application.py +11 -11
  61. elasticsearch/_sync/client/searchable_snapshots.py +4 -4
  62. elasticsearch/_sync/client/security.py +4 -4
  63. elasticsearch/_sync/client/shutdown.py +12 -17
  64. elasticsearch/_sync/client/simulate.py +2 -2
  65. elasticsearch/_sync/client/slm.py +2 -6
  66. elasticsearch/_sync/client/snapshot.py +3 -2
  67. elasticsearch/_sync/client/streams.py +185 -0
  68. elasticsearch/_sync/client/tasks.py +4 -4
  69. elasticsearch/_sync/client/text_structure.py +5 -1
  70. elasticsearch/_sync/client/transform.py +37 -0
  71. elasticsearch/_sync/client/utils.py +16 -2
  72. elasticsearch/_sync/client/watcher.py +3 -7
  73. elasticsearch/_sync/client/xpack.py +2 -1
  74. elasticsearch/_version.py +2 -1
  75. elasticsearch/client.py +2 -0
  76. elasticsearch/compat.py +45 -1
  77. elasticsearch/dsl/__init__.py +28 -0
  78. elasticsearch/dsl/_async/document.py +4 -5
  79. elasticsearch/dsl/_async/index.py +1 -1
  80. elasticsearch/dsl/_async/search.py +2 -3
  81. elasticsearch/dsl/_sync/document.py +4 -5
  82. elasticsearch/dsl/_sync/index.py +1 -1
  83. elasticsearch/dsl/_sync/search.py +2 -3
  84. elasticsearch/dsl/aggs.py +104 -7
  85. elasticsearch/dsl/async_connections.py +1 -2
  86. elasticsearch/dsl/connections.py +1 -2
  87. elasticsearch/dsl/document_base.py +16 -1
  88. elasticsearch/dsl/field.py +12 -1
  89. elasticsearch/dsl/query.py +24 -1
  90. elasticsearch/dsl/response/__init__.py +3 -0
  91. elasticsearch/dsl/serializer.py +1 -2
  92. elasticsearch/dsl/types.py +187 -9
  93. elasticsearch/dsl/utils.py +1 -2
  94. elasticsearch/esql/esql.py +1 -1
  95. elasticsearch/esql/functions.py +2 -2
  96. elasticsearch/helpers/__init__.py +10 -1
  97. elasticsearch/helpers/actions.py +106 -33
  98. elasticsearch/helpers/vectorstore/__init__.py +7 -7
  99. elasticsearch/helpers/vectorstore/_async/_utils.py +1 -1
  100. elasticsearch/helpers/vectorstore/_async/embedding_service.py +2 -2
  101. elasticsearch/helpers/vectorstore/_async/strategies.py +3 -3
  102. elasticsearch/helpers/vectorstore/_async/vectorstore.py +5 -5
  103. elasticsearch/helpers/vectorstore/_sync/_utils.py +1 -1
  104. elasticsearch/helpers/vectorstore/_sync/embedding_service.py +2 -2
  105. elasticsearch/helpers/vectorstore/_sync/strategies.py +3 -3
  106. elasticsearch/helpers/vectorstore/_sync/vectorstore.py +5 -5
  107. {elasticsearch-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/METADATA +2 -2
  108. elasticsearch-8.19.3.dist-info/RECORD +166 -0
  109. {elasticsearch-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/WHEEL +1 -1
  110. elasticsearch-8.19.1.dist-info/RECORD +0 -164
  111. {elasticsearch-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/licenses/LICENSE +0 -0
  112. {elasticsearch-8.19.1.dist-info → elasticsearch-8.19.3.dist-info}/licenses/NOTICE +0 -0
@@ -78,11 +78,7 @@ class InferenceClient(NamespacedClient):
78
78
  __body["input"] = input
79
79
  if task_settings is not None:
80
80
  __body["task_settings"] = task_settings
81
- if not __body:
82
- __body = None # type: ignore[assignment]
83
- __headers = {"accept": "application/json"}
84
- if __body is not None:
85
- __headers["content-type"] = "application/json"
81
+ __headers = {"accept": "application/json", "content-type": "application/json"}
86
82
  return self.perform_request( # type: ignore[return-value]
87
83
  "POST",
88
84
  __path,
@@ -338,11 +334,7 @@ class InferenceClient(NamespacedClient):
338
334
  __body["query"] = query
339
335
  if task_settings is not None:
340
336
  __body["task_settings"] = task_settings
341
- if not __body:
342
- __body = None # type: ignore[assignment]
343
- __headers = {"accept": "application/json"}
344
- if __body is not None:
345
- __headers["content-type"] = "application/json"
337
+ __headers = {"accept": "application/json", "content-type": "application/json"}
346
338
  return self.perform_request( # type: ignore[return-value]
347
339
  "POST",
348
340
  __path,
@@ -546,11 +538,7 @@ class InferenceClient(NamespacedClient):
546
538
  __body["chunking_settings"] = chunking_settings
547
539
  if task_settings is not None:
548
540
  __body["task_settings"] = task_settings
549
- if not __body:
550
- __body = None # type: ignore[assignment]
551
- __headers = {"accept": "application/json"}
552
- if __body is not None:
553
- __headers["content-type"] = "application/json"
541
+ __headers = {"accept": "application/json", "content-type": "application/json"}
554
542
  return self.perform_request( # type: ignore[return-value]
555
543
  "PUT",
556
544
  __path,
@@ -646,11 +634,7 @@ class InferenceClient(NamespacedClient):
646
634
  __body["chunking_settings"] = chunking_settings
647
635
  if task_settings is not None:
648
636
  __body["task_settings"] = task_settings
649
- if not __body:
650
- __body = None # type: ignore[assignment]
651
- __headers = {"accept": "application/json"}
652
- if __body is not None:
653
- __headers["content-type"] = "application/json"
637
+ __headers = {"accept": "application/json", "content-type": "application/json"}
654
638
  return self.perform_request( # type: ignore[return-value]
655
639
  "PUT",
656
640
  __path,
@@ -752,11 +736,7 @@ class InferenceClient(NamespacedClient):
752
736
  __body["chunking_settings"] = chunking_settings
753
737
  if task_settings is not None:
754
738
  __body["task_settings"] = task_settings
755
- if not __body:
756
- __body = None # type: ignore[assignment]
757
- __headers = {"accept": "application/json"}
758
- if __body is not None:
759
- __headers["content-type"] = "application/json"
739
+ __headers = {"accept": "application/json", "content-type": "application/json"}
760
740
  return self.perform_request( # type: ignore[return-value]
761
741
  "PUT",
762
742
  __path,
@@ -849,11 +829,7 @@ class InferenceClient(NamespacedClient):
849
829
  __body["chunking_settings"] = chunking_settings
850
830
  if task_settings is not None:
851
831
  __body["task_settings"] = task_settings
852
- if not __body:
853
- __body = None # type: ignore[assignment]
854
- __headers = {"accept": "application/json"}
855
- if __body is not None:
856
- __headers["content-type"] = "application/json"
832
+ __headers = {"accept": "application/json", "content-type": "application/json"}
857
833
  return self.perform_request( # type: ignore[return-value]
858
834
  "PUT",
859
835
  __path,
@@ -945,11 +921,7 @@ class InferenceClient(NamespacedClient):
945
921
  __body["chunking_settings"] = chunking_settings
946
922
  if task_settings is not None:
947
923
  __body["task_settings"] = task_settings
948
- if not __body:
949
- __body = None # type: ignore[assignment]
950
- __headers = {"accept": "application/json"}
951
- if __body is not None:
952
- __headers["content-type"] = "application/json"
924
+ __headers = {"accept": "application/json", "content-type": "application/json"}
953
925
  return self.perform_request( # type: ignore[return-value]
954
926
  "PUT",
955
927
  __path,
@@ -1049,11 +1021,7 @@ class InferenceClient(NamespacedClient):
1049
1021
  __body["chunking_settings"] = chunking_settings
1050
1022
  if task_settings is not None:
1051
1023
  __body["task_settings"] = task_settings
1052
- if not __body:
1053
- __body = None # type: ignore[assignment]
1054
- __headers = {"accept": "application/json"}
1055
- if __body is not None:
1056
- __headers["content-type"] = "application/json"
1024
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1057
1025
  return self.perform_request( # type: ignore[return-value]
1058
1026
  "PUT",
1059
1027
  __path,
@@ -1143,11 +1111,7 @@ class InferenceClient(NamespacedClient):
1143
1111
  __body["chunking_settings"] = chunking_settings
1144
1112
  if task_settings is not None:
1145
1113
  __body["task_settings"] = task_settings
1146
- if not __body:
1147
- __body = None # type: ignore[assignment]
1148
- __headers = {"accept": "application/json"}
1149
- if __body is not None:
1150
- __headers["content-type"] = "application/json"
1114
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1151
1115
  return self.perform_request( # type: ignore[return-value]
1152
1116
  "PUT",
1153
1117
  __path,
@@ -1274,11 +1238,7 @@ class InferenceClient(NamespacedClient):
1274
1238
  __body["chunking_settings"] = chunking_settings
1275
1239
  if task_settings is not None:
1276
1240
  __body["task_settings"] = task_settings
1277
- if not __body:
1278
- __body = None # type: ignore[assignment]
1279
- __headers = {"accept": "application/json"}
1280
- if __body is not None:
1281
- __headers["content-type"] = "application/json"
1241
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1282
1242
  return self.perform_request( # type: ignore[return-value]
1283
1243
  "PUT",
1284
1244
  __path,
@@ -1358,11 +1318,7 @@ class InferenceClient(NamespacedClient):
1358
1318
  __body["service_settings"] = service_settings
1359
1319
  if chunking_settings is not None:
1360
1320
  __body["chunking_settings"] = chunking_settings
1361
- if not __body:
1362
- __body = None # type: ignore[assignment]
1363
- __headers = {"accept": "application/json"}
1364
- if __body is not None:
1365
- __headers["content-type"] = "application/json"
1321
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1366
1322
  return self.perform_request( # type: ignore[return-value]
1367
1323
  "PUT",
1368
1324
  __path,
@@ -1470,11 +1426,7 @@ class InferenceClient(NamespacedClient):
1470
1426
  __body["chunking_settings"] = chunking_settings
1471
1427
  if task_settings is not None:
1472
1428
  __body["task_settings"] = task_settings
1473
- if not __body:
1474
- __body = None # type: ignore[assignment]
1475
- __headers = {"accept": "application/json"}
1476
- if __body is not None:
1477
- __headers["content-type"] = "application/json"
1429
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1478
1430
  return self.perform_request( # type: ignore[return-value]
1479
1431
  "PUT",
1480
1432
  __path,
@@ -1568,11 +1520,7 @@ class InferenceClient(NamespacedClient):
1568
1520
  __body["service_settings"] = service_settings
1569
1521
  if chunking_settings is not None:
1570
1522
  __body["chunking_settings"] = chunking_settings
1571
- if not __body:
1572
- __body = None # type: ignore[assignment]
1573
- __headers = {"accept": "application/json"}
1574
- if __body is not None:
1575
- __headers["content-type"] = "application/json"
1523
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1576
1524
  return self.perform_request( # type: ignore[return-value]
1577
1525
  "PUT",
1578
1526
  __path,
@@ -1654,11 +1602,7 @@ class InferenceClient(NamespacedClient):
1654
1602
  __body["service_settings"] = service_settings
1655
1603
  if chunking_settings is not None:
1656
1604
  __body["chunking_settings"] = chunking_settings
1657
- if not __body:
1658
- __body = None # type: ignore[assignment]
1659
- __headers = {"accept": "application/json"}
1660
- if __body is not None:
1661
- __headers["content-type"] = "application/json"
1605
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1662
1606
  return self.perform_request( # type: ignore[return-value]
1663
1607
  "PUT",
1664
1608
  __path,
@@ -1752,11 +1696,7 @@ class InferenceClient(NamespacedClient):
1752
1696
  __body["chunking_settings"] = chunking_settings
1753
1697
  if task_settings is not None:
1754
1698
  __body["task_settings"] = task_settings
1755
- if not __body:
1756
- __body = None # type: ignore[assignment]
1757
- __headers = {"accept": "application/json"}
1758
- if __body is not None:
1759
- __headers["content-type"] = "application/json"
1699
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1760
1700
  return self.perform_request( # type: ignore[return-value]
1761
1701
  "PUT",
1762
1702
  __path,
@@ -1884,11 +1824,7 @@ class InferenceClient(NamespacedClient):
1884
1824
  __body["chunking_settings"] = chunking_settings
1885
1825
  if task_settings is not None:
1886
1826
  __body["task_settings"] = task_settings
1887
- if not __body:
1888
- __body = None # type: ignore[assignment]
1889
- __headers = {"accept": "application/json"}
1890
- if __body is not None:
1891
- __headers["content-type"] = "application/json"
1827
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1892
1828
  return self.perform_request( # type: ignore[return-value]
1893
1829
  "PUT",
1894
1830
  __path,
@@ -1980,11 +1916,7 @@ class InferenceClient(NamespacedClient):
1980
1916
  __body["chunking_settings"] = chunking_settings
1981
1917
  if task_settings is not None:
1982
1918
  __body["task_settings"] = task_settings
1983
- if not __body:
1984
- __body = None # type: ignore[assignment]
1985
- __headers = {"accept": "application/json"}
1986
- if __body is not None:
1987
- __headers["content-type"] = "application/json"
1919
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1988
1920
  return self.perform_request( # type: ignore[return-value]
1989
1921
  "PUT",
1990
1922
  __path,
@@ -2066,11 +1998,7 @@ class InferenceClient(NamespacedClient):
2066
1998
  __body["service_settings"] = service_settings
2067
1999
  if chunking_settings is not None:
2068
2000
  __body["chunking_settings"] = chunking_settings
2069
- if not __body:
2070
- __body = None # type: ignore[assignment]
2071
- __headers = {"accept": "application/json"}
2072
- if __body is not None:
2073
- __headers["content-type"] = "application/json"
2001
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2074
2002
  return self.perform_request( # type: ignore[return-value]
2075
2003
  "PUT",
2076
2004
  __path,
@@ -2164,11 +2092,7 @@ class InferenceClient(NamespacedClient):
2164
2092
  __body["chunking_settings"] = chunking_settings
2165
2093
  if task_settings is not None:
2166
2094
  __body["task_settings"] = task_settings
2167
- if not __body:
2168
- __body = None # type: ignore[assignment]
2169
- __headers = {"accept": "application/json"}
2170
- if __body is not None:
2171
- __headers["content-type"] = "application/json"
2095
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2172
2096
  return self.perform_request( # type: ignore[return-value]
2173
2097
  "PUT",
2174
2098
  __path,
@@ -2259,11 +2183,7 @@ class InferenceClient(NamespacedClient):
2259
2183
  __body["chunking_settings"] = chunking_settings
2260
2184
  if task_settings is not None:
2261
2185
  __body["task_settings"] = task_settings
2262
- if not __body:
2263
- __body = None # type: ignore[assignment]
2264
- __headers = {"accept": "application/json"}
2265
- if __body is not None:
2266
- __headers["content-type"] = "application/json"
2186
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2267
2187
  return self.perform_request( # type: ignore[return-value]
2268
2188
  "PUT",
2269
2189
  __path,
@@ -2342,11 +2262,7 @@ class InferenceClient(NamespacedClient):
2342
2262
  __body["service"] = service
2343
2263
  if service_settings is not None:
2344
2264
  __body["service_settings"] = service_settings
2345
- if not __body:
2346
- __body = None # type: ignore[assignment]
2347
- __headers = {"accept": "application/json"}
2348
- if __body is not None:
2349
- __headers["content-type"] = "application/json"
2265
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2350
2266
  return self.perform_request( # type: ignore[return-value]
2351
2267
  "PUT",
2352
2268
  __path,
@@ -2419,11 +2335,7 @@ class InferenceClient(NamespacedClient):
2419
2335
  __body["query"] = query
2420
2336
  if task_settings is not None:
2421
2337
  __body["task_settings"] = task_settings
2422
- if not __body:
2423
- __body = None # type: ignore[assignment]
2424
- __headers = {"accept": "application/json"}
2425
- if __body is not None:
2426
- __headers["content-type"] = "application/json"
2338
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2427
2339
  return self.perform_request( # type: ignore[return-value]
2428
2340
  "POST",
2429
2341
  __path,
@@ -2487,11 +2399,7 @@ class InferenceClient(NamespacedClient):
2487
2399
  __body["input"] = input
2488
2400
  if task_settings is not None:
2489
2401
  __body["task_settings"] = task_settings
2490
- if not __body:
2491
- __body = None # type: ignore[assignment]
2492
- __headers = {"accept": "application/json"}
2493
- if __body is not None:
2494
- __headers["content-type"] = "application/json"
2402
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2495
2403
  return self.perform_request( # type: ignore[return-value]
2496
2404
  "POST",
2497
2405
  __path,
@@ -2503,7 +2411,7 @@ class InferenceClient(NamespacedClient):
2503
2411
  )
2504
2412
 
2505
2413
  @_rewrite_parameters(
2506
- body_fields=("input", "task_settings"),
2414
+ body_fields=("input", "input_type", "task_settings"),
2507
2415
  )
2508
2416
  def text_embedding(
2509
2417
  self,
@@ -2513,6 +2421,7 @@ class InferenceClient(NamespacedClient):
2513
2421
  error_trace: t.Optional[bool] = None,
2514
2422
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
2515
2423
  human: t.Optional[bool] = None,
2424
+ input_type: t.Optional[str] = None,
2516
2425
  pretty: t.Optional[bool] = None,
2517
2426
  task_settings: t.Optional[t.Any] = None,
2518
2427
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
@@ -2528,6 +2437,13 @@ class InferenceClient(NamespacedClient):
2528
2437
 
2529
2438
  :param inference_id: The inference Id
2530
2439
  :param input: Inference input. Either a string or an array of strings.
2440
+ :param input_type: The input data type for the text embedding model. Possible
2441
+ values include: * `SEARCH` * `INGEST` * `CLASSIFICATION` * `CLUSTERING` Not
2442
+ all services support all values. Unsupported values will trigger a validation
2443
+ exception. Accepted values depend on the configured inference service, refer
2444
+ to the relevant service-specific documentation for more info. > info > The
2445
+ `input_type` parameter specified on the root level of the request body will
2446
+ take precedence over the `input_type` parameter specified in `task_settings`.
2531
2447
  :param task_settings: Optional task settings
2532
2448
  :param timeout: Specifies the amount of time to wait for the inference request
2533
2449
  to complete.
@@ -2553,13 +2469,11 @@ class InferenceClient(NamespacedClient):
2553
2469
  if not __body:
2554
2470
  if input is not None:
2555
2471
  __body["input"] = input
2472
+ if input_type is not None:
2473
+ __body["input_type"] = input_type
2556
2474
  if task_settings is not None:
2557
2475
  __body["task_settings"] = task_settings
2558
- if not __body:
2559
- __body = None # type: ignore[assignment]
2560
- __headers = {"accept": "application/json"}
2561
- if __body is not None:
2562
- __headers["content-type"] = "application/json"
2476
+ __headers = {"accept": "application/json", "content-type": "application/json"}
2563
2477
  return self.perform_request( # type: ignore[return-value]
2564
2478
  "POST",
2565
2479
  __path,
@@ -355,7 +355,7 @@ class IngestClient(NamespacedClient):
355
355
  :param master_timeout: Period to wait for a connection to the master node. If
356
356
  no response is received before the timeout expires, the request fails and
357
357
  returns an error.
358
- :param summary: Return pipelines without their definitions (default: false)
358
+ :param summary: Return pipelines without their definitions
359
359
  """
360
360
  __path_parts: t.Dict[str, str]
361
361
  if id not in SKIP_IN_PATH:
@@ -310,8 +310,7 @@ class LicenseClient(NamespacedClient):
310
310
 
311
311
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/start-basic.html>`_
312
312
 
313
- :param acknowledge: whether the user has acknowledged acknowledge messages (default:
314
- false)
313
+ :param acknowledge: Whether the user has acknowledged acknowledge messages
315
314
  :param master_timeout: Period to wait for a connection to the master node.
316
315
  :param timeout: Period to wait for a response. If no response is received before
317
316
  the timeout expires, the request fails and returns an error.
@@ -367,10 +366,9 @@ class LicenseClient(NamespacedClient):
367
366
 
368
367
  `<https://www.elastic.co/guide/en/elasticsearch/reference/8.19/start-trial.html>`_
369
368
 
370
- :param acknowledge: whether the user has acknowledged acknowledge messages (default:
371
- false)
369
+ :param acknowledge: Whether the user has acknowledged acknowledge messages
372
370
  :param master_timeout: Period to wait for a connection to the master node.
373
- :param type: The type of trial license to generate (default: "trial")
371
+ :param type: The type of trial license to generate
374
372
  """
375
373
  __path_parts: t.Dict[str, str] = {}
376
374
  __path = "/_license/start_trial"
@@ -20,7 +20,14 @@ import typing as t
20
20
  from elastic_transport import ObjectApiResponse
21
21
 
22
22
  from ._base import NamespacedClient
23
- from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
23
+ from .utils import (
24
+ SKIP_IN_PATH,
25
+ Stability,
26
+ Visibility,
27
+ _availability_warning,
28
+ _quote,
29
+ _rewrite_parameters,
30
+ )
24
31
 
25
32
 
26
33
  class MlClient(NamespacedClient):
@@ -3050,10 +3057,7 @@ class MlClient(NamespacedClient):
3050
3057
  if reset_start is not None:
3051
3058
  __query["reset_start"] = reset_start
3052
3059
  __body = data if data is not None else body
3053
- __headers = {
3054
- "accept": "application/json",
3055
- "content-type": "application/x-ndjson",
3056
- }
3060
+ __headers = {"accept": "application/json", "content-type": "application/json"}
3057
3061
  return self.perform_request( # type: ignore[return-value]
3058
3062
  "POST",
3059
3063
  __path,
@@ -4526,7 +4530,9 @@ class MlClient(NamespacedClient):
4526
4530
  path_parts=__path_parts,
4527
4531
  )
4528
4532
 
4529
- @_rewrite_parameters()
4533
+ @_rewrite_parameters(
4534
+ body_fields=("timeout",),
4535
+ )
4530
4536
  def start_data_frame_analytics(
4531
4537
  self,
4532
4538
  *,
@@ -4536,6 +4542,7 @@ class MlClient(NamespacedClient):
4536
4542
  human: t.Optional[bool] = None,
4537
4543
  pretty: t.Optional[bool] = None,
4538
4544
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4545
+ body: t.Optional[t.Dict[str, t.Any]] = None,
4539
4546
  ) -> ObjectApiResponse[t.Any]:
4540
4547
  """
4541
4548
  .. raw:: html
@@ -4567,6 +4574,7 @@ class MlClient(NamespacedClient):
4567
4574
  __path_parts: t.Dict[str, str] = {"id": _quote(id)}
4568
4575
  __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_start'
4569
4576
  __query: t.Dict[str, t.Any] = {}
4577
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
4570
4578
  if error_trace is not None:
4571
4579
  __query["error_trace"] = error_trace
4572
4580
  if filter_path is not None:
@@ -4575,14 +4583,20 @@ class MlClient(NamespacedClient):
4575
4583
  __query["human"] = human
4576
4584
  if pretty is not None:
4577
4585
  __query["pretty"] = pretty
4578
- if timeout is not None:
4579
- __query["timeout"] = timeout
4586
+ if not __body:
4587
+ if timeout is not None:
4588
+ __body["timeout"] = timeout
4589
+ if not __body:
4590
+ __body = None # type: ignore[assignment]
4580
4591
  __headers = {"accept": "application/json"}
4592
+ if __body is not None:
4593
+ __headers["content-type"] = "application/json"
4581
4594
  return self.perform_request( # type: ignore[return-value]
4582
4595
  "POST",
4583
4596
  __path,
4584
4597
  params=__query,
4585
4598
  headers=__headers,
4599
+ body=__body,
4586
4600
  endpoint_id="ml.start_data_frame_analytics",
4587
4601
  path_parts=__path_parts,
4588
4602
  )
@@ -4712,7 +4726,7 @@ class MlClient(NamespacedClient):
4712
4726
  is greater than the number of hardware threads it will automatically be changed
4713
4727
  to a value less than the number of hardware threads. If adaptive_allocations
4714
4728
  is enabled, do not set this value, because it’s automatically set.
4715
- :param priority: The deployment priority.
4729
+ :param priority: The deployment priority
4716
4730
  :param queue_capacity: Specifies the number of inference requests that are allowed
4717
4731
  in the queue. After the number of requests exceeds this value, new requests
4718
4732
  are rejected with a 429 error.
@@ -4774,7 +4788,9 @@ class MlClient(NamespacedClient):
4774
4788
  path_parts=__path_parts,
4775
4789
  )
4776
4790
 
4777
- @_rewrite_parameters()
4791
+ @_rewrite_parameters(
4792
+ body_fields=("allow_no_match", "force", "timeout"),
4793
+ )
4778
4794
  def stop_data_frame_analytics(
4779
4795
  self,
4780
4796
  *,
@@ -4786,6 +4802,7 @@ class MlClient(NamespacedClient):
4786
4802
  human: t.Optional[bool] = None,
4787
4803
  pretty: t.Optional[bool] = None,
4788
4804
  timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4805
+ body: t.Optional[t.Dict[str, t.Any]] = None,
4789
4806
  ) -> ObjectApiResponse[t.Any]:
4790
4807
  """
4791
4808
  .. raw:: html
@@ -4817,26 +4834,33 @@ class MlClient(NamespacedClient):
4817
4834
  __path_parts: t.Dict[str, str] = {"id": _quote(id)}
4818
4835
  __path = f'/_ml/data_frame/analytics/{__path_parts["id"]}/_stop'
4819
4836
  __query: t.Dict[str, t.Any] = {}
4820
- if allow_no_match is not None:
4821
- __query["allow_no_match"] = allow_no_match
4837
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
4822
4838
  if error_trace is not None:
4823
4839
  __query["error_trace"] = error_trace
4824
4840
  if filter_path is not None:
4825
4841
  __query["filter_path"] = filter_path
4826
- if force is not None:
4827
- __query["force"] = force
4828
4842
  if human is not None:
4829
4843
  __query["human"] = human
4830
4844
  if pretty is not None:
4831
4845
  __query["pretty"] = pretty
4832
- if timeout is not None:
4833
- __query["timeout"] = timeout
4846
+ if not __body:
4847
+ if allow_no_match is not None:
4848
+ __body["allow_no_match"] = allow_no_match
4849
+ if force is not None:
4850
+ __body["force"] = force
4851
+ if timeout is not None:
4852
+ __body["timeout"] = timeout
4853
+ if not __body:
4854
+ __body = None # type: ignore[assignment]
4834
4855
  __headers = {"accept": "application/json"}
4856
+ if __body is not None:
4857
+ __headers["content-type"] = "application/json"
4835
4858
  return self.perform_request( # type: ignore[return-value]
4836
4859
  "POST",
4837
4860
  __path,
4838
4861
  params=__query,
4839
4862
  headers=__headers,
4863
+ body=__body,
4840
4864
  endpoint_id="ml.stop_data_frame_analytics",
4841
4865
  path_parts=__path_parts,
4842
4866
  )
@@ -4912,7 +4936,9 @@ class MlClient(NamespacedClient):
4912
4936
  path_parts=__path_parts,
4913
4937
  )
4914
4938
 
4915
- @_rewrite_parameters()
4939
+ @_rewrite_parameters(
4940
+ body_fields=("allow_no_match", "force", "id"),
4941
+ )
4916
4942
  def stop_trained_model_deployment(
4917
4943
  self,
4918
4944
  *,
@@ -4922,7 +4948,9 @@ class MlClient(NamespacedClient):
4922
4948
  filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
4923
4949
  force: t.Optional[bool] = None,
4924
4950
  human: t.Optional[bool] = None,
4951
+ id: t.Optional[str] = None,
4925
4952
  pretty: t.Optional[bool] = None,
4953
+ body: t.Optional[t.Dict[str, t.Any]] = None,
4926
4954
  ) -> ObjectApiResponse[t.Any]:
4927
4955
  """
4928
4956
  .. raw:: html
@@ -4942,30 +4970,40 @@ class MlClient(NamespacedClient):
4942
4970
  no matches or only partial matches.
4943
4971
  :param force: Forcefully stops the deployment, even if it is used by ingest pipelines.
4944
4972
  You can't use these pipelines until you restart the model deployment.
4973
+ :param id: If provided, must be the same identifier as in the path.
4945
4974
  """
4946
4975
  if model_id in SKIP_IN_PATH:
4947
4976
  raise ValueError("Empty value passed for parameter 'model_id'")
4948
4977
  __path_parts: t.Dict[str, str] = {"model_id": _quote(model_id)}
4949
4978
  __path = f'/_ml/trained_models/{__path_parts["model_id"]}/deployment/_stop'
4950
4979
  __query: t.Dict[str, t.Any] = {}
4951
- if allow_no_match is not None:
4952
- __query["allow_no_match"] = allow_no_match
4980
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
4953
4981
  if error_trace is not None:
4954
4982
  __query["error_trace"] = error_trace
4955
4983
  if filter_path is not None:
4956
4984
  __query["filter_path"] = filter_path
4957
- if force is not None:
4958
- __query["force"] = force
4959
4985
  if human is not None:
4960
4986
  __query["human"] = human
4961
4987
  if pretty is not None:
4962
4988
  __query["pretty"] = pretty
4989
+ if not __body:
4990
+ if allow_no_match is not None:
4991
+ __body["allow_no_match"] = allow_no_match
4992
+ if force is not None:
4993
+ __body["force"] = force
4994
+ if id is not None:
4995
+ __body["id"] = id
4996
+ if not __body:
4997
+ __body = None # type: ignore[assignment]
4963
4998
  __headers = {"accept": "application/json"}
4999
+ if __body is not None:
5000
+ __headers["content-type"] = "application/json"
4964
5001
  return self.perform_request( # type: ignore[return-value]
4965
5002
  "POST",
4966
5003
  __path,
4967
5004
  params=__query,
4968
5005
  headers=__headers,
5006
+ body=__body,
4969
5007
  endpoint_id="ml.stop_trained_model_deployment",
4970
5008
  path_parts=__path_parts,
4971
5009
  )
@@ -5697,6 +5735,7 @@ class MlClient(NamespacedClient):
5697
5735
  "results_index_name",
5698
5736
  ),
5699
5737
  )
5738
+ @_availability_warning(Stability.STABLE, Visibility.PRIVATE)
5700
5739
  def validate(
5701
5740
  self,
5702
5741
  *,
@@ -5778,6 +5817,7 @@ class MlClient(NamespacedClient):
5778
5817
  @_rewrite_parameters(
5779
5818
  body_name="detector",
5780
5819
  )
5820
+ @_availability_warning(Stability.STABLE, Visibility.PRIVATE)
5781
5821
  def validate_detector(
5782
5822
  self,
5783
5823
  *,
@@ -20,7 +20,7 @@ import typing as t
20
20
  from elastic_transport import ObjectApiResponse
21
21
 
22
22
  from ._base import NamespacedClient
23
- from .utils import _rewrite_parameters
23
+ from .utils import Stability, Visibility, _availability_warning, _rewrite_parameters
24
24
 
25
25
 
26
26
  class MonitoringClient(NamespacedClient):
@@ -28,6 +28,7 @@ class MonitoringClient(NamespacedClient):
28
28
  @_rewrite_parameters(
29
29
  body_name="operations",
30
30
  )
31
+ @_availability_warning(Stability.STABLE, Visibility.PRIVATE)
31
32
  def bulk(
32
33
  self,
33
34
  *,