elasticsearch9 9.0.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.
Files changed (160) hide show
  1. elasticsearch9/__init__.py +98 -0
  2. elasticsearch9/_async/__init__.py +16 -0
  3. elasticsearch9/_async/client/__init__.py +6531 -0
  4. elasticsearch9/_async/client/_base.py +430 -0
  5. elasticsearch9/_async/client/async_search.py +637 -0
  6. elasticsearch9/_async/client/autoscaling.py +252 -0
  7. elasticsearch9/_async/client/cat.py +2995 -0
  8. elasticsearch9/_async/client/ccr.py +1043 -0
  9. elasticsearch9/_async/client/cluster.py +1223 -0
  10. elasticsearch9/_async/client/connector.py +1978 -0
  11. elasticsearch9/_async/client/dangling_indices.py +192 -0
  12. elasticsearch9/_async/client/enrich.py +291 -0
  13. elasticsearch9/_async/client/eql.py +359 -0
  14. elasticsearch9/_async/client/esql.py +490 -0
  15. elasticsearch9/_async/client/features.py +130 -0
  16. elasticsearch9/_async/client/fleet.py +658 -0
  17. elasticsearch9/_async/client/graph.py +113 -0
  18. elasticsearch9/_async/client/ilm.py +668 -0
  19. elasticsearch9/_async/client/indices.py +5582 -0
  20. elasticsearch9/_async/client/inference.py +2247 -0
  21. elasticsearch9/_async/client/ingest.py +766 -0
  22. elasticsearch9/_async/client/license.py +400 -0
  23. elasticsearch9/_async/client/logstash.py +176 -0
  24. elasticsearch9/_async/client/migration.py +160 -0
  25. elasticsearch9/_async/client/ml.py +5835 -0
  26. elasticsearch9/_async/client/monitoring.py +100 -0
  27. elasticsearch9/_async/client/nodes.py +543 -0
  28. elasticsearch9/_async/client/query_rules.py +485 -0
  29. elasticsearch9/_async/client/rollup.py +616 -0
  30. elasticsearch9/_async/client/search_application.py +574 -0
  31. elasticsearch9/_async/client/searchable_snapshots.py +313 -0
  32. elasticsearch9/_async/client/security.py +4688 -0
  33. elasticsearch9/_async/client/shutdown.py +268 -0
  34. elasticsearch9/_async/client/simulate.py +145 -0
  35. elasticsearch9/_async/client/slm.py +559 -0
  36. elasticsearch9/_async/client/snapshot.py +1338 -0
  37. elasticsearch9/_async/client/sql.py +469 -0
  38. elasticsearch9/_async/client/ssl.py +76 -0
  39. elasticsearch9/_async/client/synonyms.py +413 -0
  40. elasticsearch9/_async/client/tasks.py +295 -0
  41. elasticsearch9/_async/client/text_structure.py +664 -0
  42. elasticsearch9/_async/client/transform.py +922 -0
  43. elasticsearch9/_async/client/utils.py +48 -0
  44. elasticsearch9/_async/client/watcher.py +894 -0
  45. elasticsearch9/_async/client/xpack.py +134 -0
  46. elasticsearch9/_async/helpers.py +596 -0
  47. elasticsearch9/_otel.py +110 -0
  48. elasticsearch9/_sync/__init__.py +16 -0
  49. elasticsearch9/_sync/client/__init__.py +6529 -0
  50. elasticsearch9/_sync/client/_base.py +430 -0
  51. elasticsearch9/_sync/client/async_search.py +637 -0
  52. elasticsearch9/_sync/client/autoscaling.py +252 -0
  53. elasticsearch9/_sync/client/cat.py +2995 -0
  54. elasticsearch9/_sync/client/ccr.py +1043 -0
  55. elasticsearch9/_sync/client/cluster.py +1223 -0
  56. elasticsearch9/_sync/client/connector.py +1978 -0
  57. elasticsearch9/_sync/client/dangling_indices.py +192 -0
  58. elasticsearch9/_sync/client/enrich.py +291 -0
  59. elasticsearch9/_sync/client/eql.py +359 -0
  60. elasticsearch9/_sync/client/esql.py +490 -0
  61. elasticsearch9/_sync/client/features.py +130 -0
  62. elasticsearch9/_sync/client/fleet.py +658 -0
  63. elasticsearch9/_sync/client/graph.py +113 -0
  64. elasticsearch9/_sync/client/ilm.py +668 -0
  65. elasticsearch9/_sync/client/indices.py +5582 -0
  66. elasticsearch9/_sync/client/inference.py +2247 -0
  67. elasticsearch9/_sync/client/ingest.py +766 -0
  68. elasticsearch9/_sync/client/license.py +400 -0
  69. elasticsearch9/_sync/client/logstash.py +176 -0
  70. elasticsearch9/_sync/client/migration.py +160 -0
  71. elasticsearch9/_sync/client/ml.py +5835 -0
  72. elasticsearch9/_sync/client/monitoring.py +100 -0
  73. elasticsearch9/_sync/client/nodes.py +543 -0
  74. elasticsearch9/_sync/client/query_rules.py +485 -0
  75. elasticsearch9/_sync/client/rollup.py +616 -0
  76. elasticsearch9/_sync/client/search_application.py +574 -0
  77. elasticsearch9/_sync/client/searchable_snapshots.py +313 -0
  78. elasticsearch9/_sync/client/security.py +4688 -0
  79. elasticsearch9/_sync/client/shutdown.py +268 -0
  80. elasticsearch9/_sync/client/simulate.py +145 -0
  81. elasticsearch9/_sync/client/slm.py +559 -0
  82. elasticsearch9/_sync/client/snapshot.py +1338 -0
  83. elasticsearch9/_sync/client/sql.py +469 -0
  84. elasticsearch9/_sync/client/ssl.py +76 -0
  85. elasticsearch9/_sync/client/synonyms.py +413 -0
  86. elasticsearch9/_sync/client/tasks.py +295 -0
  87. elasticsearch9/_sync/client/text_structure.py +664 -0
  88. elasticsearch9/_sync/client/transform.py +922 -0
  89. elasticsearch9/_sync/client/utils.py +475 -0
  90. elasticsearch9/_sync/client/watcher.py +894 -0
  91. elasticsearch9/_sync/client/xpack.py +134 -0
  92. elasticsearch9/_utils.py +34 -0
  93. elasticsearch9/_version.py +18 -0
  94. elasticsearch9/client.py +126 -0
  95. elasticsearch9/compat.py +79 -0
  96. elasticsearch9/dsl/__init__.py +203 -0
  97. elasticsearch9/dsl/_async/__init__.py +16 -0
  98. elasticsearch9/dsl/_async/document.py +522 -0
  99. elasticsearch9/dsl/_async/faceted_search.py +50 -0
  100. elasticsearch9/dsl/_async/index.py +639 -0
  101. elasticsearch9/dsl/_async/mapping.py +49 -0
  102. elasticsearch9/dsl/_async/search.py +237 -0
  103. elasticsearch9/dsl/_async/update_by_query.py +47 -0
  104. elasticsearch9/dsl/_sync/__init__.py +16 -0
  105. elasticsearch9/dsl/_sync/document.py +514 -0
  106. elasticsearch9/dsl/_sync/faceted_search.py +50 -0
  107. elasticsearch9/dsl/_sync/index.py +597 -0
  108. elasticsearch9/dsl/_sync/mapping.py +49 -0
  109. elasticsearch9/dsl/_sync/search.py +230 -0
  110. elasticsearch9/dsl/_sync/update_by_query.py +45 -0
  111. elasticsearch9/dsl/aggs.py +3734 -0
  112. elasticsearch9/dsl/analysis.py +341 -0
  113. elasticsearch9/dsl/async_connections.py +37 -0
  114. elasticsearch9/dsl/connections.py +142 -0
  115. elasticsearch9/dsl/document.py +20 -0
  116. elasticsearch9/dsl/document_base.py +444 -0
  117. elasticsearch9/dsl/exceptions.py +32 -0
  118. elasticsearch9/dsl/faceted_search.py +28 -0
  119. elasticsearch9/dsl/faceted_search_base.py +489 -0
  120. elasticsearch9/dsl/field.py +4392 -0
  121. elasticsearch9/dsl/function.py +180 -0
  122. elasticsearch9/dsl/index.py +23 -0
  123. elasticsearch9/dsl/index_base.py +178 -0
  124. elasticsearch9/dsl/mapping.py +19 -0
  125. elasticsearch9/dsl/mapping_base.py +219 -0
  126. elasticsearch9/dsl/query.py +2822 -0
  127. elasticsearch9/dsl/response/__init__.py +388 -0
  128. elasticsearch9/dsl/response/aggs.py +100 -0
  129. elasticsearch9/dsl/response/hit.py +53 -0
  130. elasticsearch9/dsl/search.py +20 -0
  131. elasticsearch9/dsl/search_base.py +1053 -0
  132. elasticsearch9/dsl/serializer.py +34 -0
  133. elasticsearch9/dsl/types.py +6453 -0
  134. elasticsearch9/dsl/update_by_query.py +19 -0
  135. elasticsearch9/dsl/update_by_query_base.py +149 -0
  136. elasticsearch9/dsl/utils.py +687 -0
  137. elasticsearch9/dsl/wrappers.py +144 -0
  138. elasticsearch9/exceptions.py +133 -0
  139. elasticsearch9/helpers/__init__.py +41 -0
  140. elasticsearch9/helpers/actions.py +875 -0
  141. elasticsearch9/helpers/errors.py +40 -0
  142. elasticsearch9/helpers/vectorstore/__init__.py +62 -0
  143. elasticsearch9/helpers/vectorstore/_async/__init__.py +16 -0
  144. elasticsearch9/helpers/vectorstore/_async/_utils.py +39 -0
  145. elasticsearch9/helpers/vectorstore/_async/embedding_service.py +89 -0
  146. elasticsearch9/helpers/vectorstore/_async/strategies.py +487 -0
  147. elasticsearch9/helpers/vectorstore/_async/vectorstore.py +421 -0
  148. elasticsearch9/helpers/vectorstore/_sync/__init__.py +16 -0
  149. elasticsearch9/helpers/vectorstore/_sync/_utils.py +39 -0
  150. elasticsearch9/helpers/vectorstore/_sync/embedding_service.py +89 -0
  151. elasticsearch9/helpers/vectorstore/_sync/strategies.py +487 -0
  152. elasticsearch9/helpers/vectorstore/_sync/vectorstore.py +421 -0
  153. elasticsearch9/helpers/vectorstore/_utils.py +116 -0
  154. elasticsearch9/py.typed +0 -0
  155. elasticsearch9/serializer.py +250 -0
  156. elasticsearch9-9.0.0.dist-info/METADATA +175 -0
  157. elasticsearch9-9.0.0.dist-info/RECORD +160 -0
  158. elasticsearch9-9.0.0.dist-info/WHEEL +4 -0
  159. elasticsearch9-9.0.0.dist-info/licenses/LICENSE +176 -0
  160. elasticsearch9-9.0.0.dist-info/licenses/NOTICE +2 -0
@@ -0,0 +1,400 @@
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 _rewrite_parameters
24
+
25
+
26
+ class LicenseClient(NamespacedClient):
27
+
28
+ @_rewrite_parameters()
29
+ def delete(
30
+ self,
31
+ *,
32
+ error_trace: t.Optional[bool] = None,
33
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
34
+ human: t.Optional[bool] = None,
35
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
36
+ pretty: t.Optional[bool] = None,
37
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
38
+ ) -> ObjectApiResponse[t.Any]:
39
+ """
40
+ .. raw:: html
41
+
42
+ <p>Delete the license.</p>
43
+ <p>When the license expires, your subscription level reverts to Basic.</p>
44
+ <p>If the operator privileges feature is enabled, only operator users can use this API.</p>
45
+
46
+
47
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-delete>`_
48
+
49
+ :param master_timeout: The period to wait for a connection to the master node.
50
+ :param timeout: The period to wait for a response. If no response is received
51
+ before the timeout expires, the request fails and returns an error.
52
+ """
53
+ __path_parts: t.Dict[str, str] = {}
54
+ __path = "/_license"
55
+ __query: t.Dict[str, t.Any] = {}
56
+ if error_trace is not None:
57
+ __query["error_trace"] = error_trace
58
+ if filter_path is not None:
59
+ __query["filter_path"] = filter_path
60
+ if human is not None:
61
+ __query["human"] = human
62
+ if master_timeout is not None:
63
+ __query["master_timeout"] = master_timeout
64
+ if pretty is not None:
65
+ __query["pretty"] = pretty
66
+ if timeout is not None:
67
+ __query["timeout"] = timeout
68
+ __headers = {"accept": "application/json"}
69
+ return self.perform_request( # type: ignore[return-value]
70
+ "DELETE",
71
+ __path,
72
+ params=__query,
73
+ headers=__headers,
74
+ endpoint_id="license.delete",
75
+ path_parts=__path_parts,
76
+ )
77
+
78
+ @_rewrite_parameters()
79
+ def get(
80
+ self,
81
+ *,
82
+ accept_enterprise: t.Optional[bool] = None,
83
+ error_trace: t.Optional[bool] = None,
84
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
85
+ human: t.Optional[bool] = None,
86
+ local: t.Optional[bool] = None,
87
+ pretty: t.Optional[bool] = None,
88
+ ) -> ObjectApiResponse[t.Any]:
89
+ """
90
+ .. raw:: html
91
+
92
+ <p>Get license information.</p>
93
+ <p>Get information about your Elastic license including its type, its status, when it was issued, and when it expires.</p>
94
+ <blockquote>
95
+ <p>info
96
+ If the master node is generating a new cluster state, the get license API may return a <code>404 Not Found</code> response.
97
+ If you receive an unexpected 404 response after cluster startup, wait a short period and retry the request.</p>
98
+ </blockquote>
99
+
100
+
101
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-get>`_
102
+
103
+ :param accept_enterprise: If `true`, this parameter returns enterprise for Enterprise
104
+ license types. If `false`, this parameter returns platinum for both platinum
105
+ and enterprise license types. This behavior is maintained for backwards compatibility.
106
+ This parameter is deprecated and will always be set to true in 8.x.
107
+ :param local: Specifies whether to retrieve local information. The default value
108
+ is `false`, which means the information is retrieved from the master node.
109
+ """
110
+ __path_parts: t.Dict[str, str] = {}
111
+ __path = "/_license"
112
+ __query: t.Dict[str, t.Any] = {}
113
+ if accept_enterprise is not None:
114
+ __query["accept_enterprise"] = accept_enterprise
115
+ if error_trace is not None:
116
+ __query["error_trace"] = error_trace
117
+ if filter_path is not None:
118
+ __query["filter_path"] = filter_path
119
+ if human is not None:
120
+ __query["human"] = human
121
+ if local is not None:
122
+ __query["local"] = local
123
+ if pretty is not None:
124
+ __query["pretty"] = pretty
125
+ __headers = {"accept": "application/json"}
126
+ return self.perform_request( # type: ignore[return-value]
127
+ "GET",
128
+ __path,
129
+ params=__query,
130
+ headers=__headers,
131
+ endpoint_id="license.get",
132
+ path_parts=__path_parts,
133
+ )
134
+
135
+ @_rewrite_parameters()
136
+ def get_basic_status(
137
+ self,
138
+ *,
139
+ error_trace: t.Optional[bool] = None,
140
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
141
+ human: t.Optional[bool] = None,
142
+ pretty: t.Optional[bool] = None,
143
+ ) -> ObjectApiResponse[t.Any]:
144
+ """
145
+ .. raw:: html
146
+
147
+ <p>Get the basic license status.</p>
148
+
149
+
150
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-get-basic-status>`_
151
+ """
152
+ __path_parts: t.Dict[str, str] = {}
153
+ __path = "/_license/basic_status"
154
+ __query: t.Dict[str, t.Any] = {}
155
+ if error_trace is not None:
156
+ __query["error_trace"] = error_trace
157
+ if filter_path is not None:
158
+ __query["filter_path"] = filter_path
159
+ if human is not None:
160
+ __query["human"] = human
161
+ if pretty is not None:
162
+ __query["pretty"] = pretty
163
+ __headers = {"accept": "application/json"}
164
+ return self.perform_request( # type: ignore[return-value]
165
+ "GET",
166
+ __path,
167
+ params=__query,
168
+ headers=__headers,
169
+ endpoint_id="license.get_basic_status",
170
+ path_parts=__path_parts,
171
+ )
172
+
173
+ @_rewrite_parameters()
174
+ def get_trial_status(
175
+ self,
176
+ *,
177
+ error_trace: t.Optional[bool] = None,
178
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
179
+ human: t.Optional[bool] = None,
180
+ pretty: t.Optional[bool] = None,
181
+ ) -> ObjectApiResponse[t.Any]:
182
+ """
183
+ .. raw:: html
184
+
185
+ <p>Get the trial status.</p>
186
+
187
+
188
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-get-trial-status>`_
189
+ """
190
+ __path_parts: t.Dict[str, str] = {}
191
+ __path = "/_license/trial_status"
192
+ __query: t.Dict[str, t.Any] = {}
193
+ if error_trace is not None:
194
+ __query["error_trace"] = error_trace
195
+ if filter_path is not None:
196
+ __query["filter_path"] = filter_path
197
+ if human is not None:
198
+ __query["human"] = human
199
+ if pretty is not None:
200
+ __query["pretty"] = pretty
201
+ __headers = {"accept": "application/json"}
202
+ return self.perform_request( # type: ignore[return-value]
203
+ "GET",
204
+ __path,
205
+ params=__query,
206
+ headers=__headers,
207
+ endpoint_id="license.get_trial_status",
208
+ path_parts=__path_parts,
209
+ )
210
+
211
+ @_rewrite_parameters(
212
+ body_fields=("license", "licenses"),
213
+ )
214
+ def post(
215
+ self,
216
+ *,
217
+ acknowledge: t.Optional[bool] = None,
218
+ error_trace: t.Optional[bool] = None,
219
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
220
+ human: t.Optional[bool] = None,
221
+ license: t.Optional[t.Mapping[str, t.Any]] = None,
222
+ licenses: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
223
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
224
+ pretty: t.Optional[bool] = None,
225
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
226
+ body: t.Optional[t.Dict[str, t.Any]] = None,
227
+ ) -> ObjectApiResponse[t.Any]:
228
+ """
229
+ .. raw:: html
230
+
231
+ <p>Update the license.</p>
232
+ <p>You can update your license at runtime without shutting down your nodes.
233
+ License updates take effect immediately.
234
+ If the license you are installing does not support all of the features that were available with your previous license, however, you are notified in the response.
235
+ You must then re-submit the API request with the acknowledge parameter set to true.</p>
236
+ <p>NOTE: If Elasticsearch security features are enabled and you are installing a gold or higher license, you must enable TLS on the transport networking layer before you install the license.
237
+ If the operator privileges feature is enabled, only operator users can use this API.</p>
238
+
239
+
240
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-post>`_
241
+
242
+ :param acknowledge: Specifies whether you acknowledge the license changes.
243
+ :param license:
244
+ :param licenses: A sequence of one or more JSON documents containing the license
245
+ information.
246
+ :param master_timeout: The period to wait for a connection to the master node.
247
+ :param timeout: The period to wait for a response. If no response is received
248
+ before the timeout expires, the request fails and returns an error.
249
+ """
250
+ __path_parts: t.Dict[str, str] = {}
251
+ __path = "/_license"
252
+ __query: t.Dict[str, t.Any] = {}
253
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
254
+ if acknowledge is not None:
255
+ __query["acknowledge"] = acknowledge
256
+ if error_trace is not None:
257
+ __query["error_trace"] = error_trace
258
+ if filter_path is not None:
259
+ __query["filter_path"] = filter_path
260
+ if human is not None:
261
+ __query["human"] = human
262
+ if master_timeout is not None:
263
+ __query["master_timeout"] = master_timeout
264
+ if pretty is not None:
265
+ __query["pretty"] = pretty
266
+ if timeout is not None:
267
+ __query["timeout"] = timeout
268
+ if not __body:
269
+ if license is not None:
270
+ __body["license"] = license
271
+ if licenses is not None:
272
+ __body["licenses"] = licenses
273
+ if not __body:
274
+ __body = None # type: ignore[assignment]
275
+ __headers = {"accept": "application/json"}
276
+ if __body is not None:
277
+ __headers["content-type"] = "application/json"
278
+ return self.perform_request( # type: ignore[return-value]
279
+ "PUT",
280
+ __path,
281
+ params=__query,
282
+ headers=__headers,
283
+ body=__body,
284
+ endpoint_id="license.post",
285
+ path_parts=__path_parts,
286
+ )
287
+
288
+ @_rewrite_parameters()
289
+ def post_start_basic(
290
+ self,
291
+ *,
292
+ acknowledge: t.Optional[bool] = None,
293
+ error_trace: t.Optional[bool] = None,
294
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
295
+ human: t.Optional[bool] = None,
296
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
297
+ pretty: t.Optional[bool] = None,
298
+ timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
299
+ ) -> ObjectApiResponse[t.Any]:
300
+ """
301
+ .. raw:: html
302
+
303
+ <p>Start a basic license.</p>
304
+ <p>Start an indefinite basic license, which gives access to all the basic features.</p>
305
+ <p>NOTE: In order to start a basic license, you must not currently have a basic license.</p>
306
+ <p>If the basic license does not support all of the features that are available with your current license, however, you are notified in the response.
307
+ You must then re-submit the API request with the <code>acknowledge</code> parameter set to <code>true</code>.</p>
308
+ <p>To check the status of your basic license, use the get basic license API.</p>
309
+
310
+
311
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-post-start-basic>`_
312
+
313
+ :param acknowledge: whether the user has acknowledged acknowledge messages (default:
314
+ false)
315
+ :param master_timeout: Period to wait for a connection to the master node.
316
+ :param timeout: Period to wait for a response. If no response is received before
317
+ the timeout expires, the request fails and returns an error.
318
+ """
319
+ __path_parts: t.Dict[str, str] = {}
320
+ __path = "/_license/start_basic"
321
+ __query: t.Dict[str, t.Any] = {}
322
+ if acknowledge is not None:
323
+ __query["acknowledge"] = acknowledge
324
+ if error_trace is not None:
325
+ __query["error_trace"] = error_trace
326
+ if filter_path is not None:
327
+ __query["filter_path"] = filter_path
328
+ if human is not None:
329
+ __query["human"] = human
330
+ if master_timeout is not None:
331
+ __query["master_timeout"] = master_timeout
332
+ if pretty is not None:
333
+ __query["pretty"] = pretty
334
+ if timeout is not None:
335
+ __query["timeout"] = timeout
336
+ __headers = {"accept": "application/json"}
337
+ return self.perform_request( # type: ignore[return-value]
338
+ "POST",
339
+ __path,
340
+ params=__query,
341
+ headers=__headers,
342
+ endpoint_id="license.post_start_basic",
343
+ path_parts=__path_parts,
344
+ )
345
+
346
+ @_rewrite_parameters()
347
+ def post_start_trial(
348
+ self,
349
+ *,
350
+ acknowledge: t.Optional[bool] = None,
351
+ error_trace: t.Optional[bool] = None,
352
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
353
+ human: t.Optional[bool] = None,
354
+ master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
355
+ pretty: t.Optional[bool] = None,
356
+ type_query_string: t.Optional[str] = None,
357
+ ) -> ObjectApiResponse[t.Any]:
358
+ """
359
+ .. raw:: html
360
+
361
+ <p>Start a trial.
362
+ Start a 30-day trial, which gives access to all subscription features.</p>
363
+ <p>NOTE: You are allowed to start a trial only if your cluster has not already activated a trial for the current major product version.
364
+ For example, if you have already activated a trial for v8.0, you cannot start a new trial until v9.0. You can, however, request an extended trial at <a href="https://www.elastic.co/trialextension">https://www.elastic.co/trialextension</a>.</p>
365
+ <p>To check the status of your trial, use the get trial status API.</p>
366
+
367
+
368
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-license-post-start-trial>`_
369
+
370
+ :param acknowledge: whether the user has acknowledged acknowledge messages (default:
371
+ false)
372
+ :param master_timeout: Period to wait for a connection to the master node.
373
+ :param type_query_string:
374
+ """
375
+ __path_parts: t.Dict[str, str] = {}
376
+ __path = "/_license/start_trial"
377
+ __query: t.Dict[str, t.Any] = {}
378
+ if acknowledge is not None:
379
+ __query["acknowledge"] = acknowledge
380
+ if error_trace is not None:
381
+ __query["error_trace"] = error_trace
382
+ if filter_path is not None:
383
+ __query["filter_path"] = filter_path
384
+ if human is not None:
385
+ __query["human"] = human
386
+ if master_timeout is not None:
387
+ __query["master_timeout"] = master_timeout
388
+ if pretty is not None:
389
+ __query["pretty"] = pretty
390
+ if type_query_string is not None:
391
+ __query["type_query_string"] = type_query_string
392
+ __headers = {"accept": "application/json"}
393
+ return self.perform_request( # type: ignore[return-value]
394
+ "POST",
395
+ __path,
396
+ params=__query,
397
+ headers=__headers,
398
+ endpoint_id="license.post_start_trial",
399
+ path_parts=__path_parts,
400
+ )
@@ -0,0 +1,176 @@
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 SKIP_IN_PATH, _quote, _rewrite_parameters
24
+
25
+
26
+ class LogstashClient(NamespacedClient):
27
+
28
+ @_rewrite_parameters()
29
+ def delete_pipeline(
30
+ self,
31
+ *,
32
+ id: str,
33
+ error_trace: t.Optional[bool] = None,
34
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
35
+ human: t.Optional[bool] = None,
36
+ pretty: t.Optional[bool] = None,
37
+ ) -> ObjectApiResponse[t.Any]:
38
+ """
39
+ .. raw:: html
40
+
41
+ <p>Delete a Logstash pipeline.
42
+ Delete a pipeline that is used for Logstash Central Management.
43
+ If the request succeeds, you receive an empty response with an appropriate status code.</p>
44
+
45
+
46
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-logstash-delete-pipeline>`_
47
+
48
+ :param id: An identifier for the pipeline.
49
+ """
50
+ if id in SKIP_IN_PATH:
51
+ raise ValueError("Empty value passed for parameter 'id'")
52
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
53
+ __path = f'/_logstash/pipeline/{__path_parts["id"]}'
54
+ __query: t.Dict[str, t.Any] = {}
55
+ if error_trace is not None:
56
+ __query["error_trace"] = error_trace
57
+ if filter_path is not None:
58
+ __query["filter_path"] = filter_path
59
+ if human is not None:
60
+ __query["human"] = human
61
+ if pretty is not None:
62
+ __query["pretty"] = pretty
63
+ __headers = {"accept": "application/json"}
64
+ return self.perform_request( # type: ignore[return-value]
65
+ "DELETE",
66
+ __path,
67
+ params=__query,
68
+ headers=__headers,
69
+ endpoint_id="logstash.delete_pipeline",
70
+ path_parts=__path_parts,
71
+ )
72
+
73
+ @_rewrite_parameters()
74
+ def get_pipeline(
75
+ self,
76
+ *,
77
+ id: t.Optional[t.Union[str, t.Sequence[str]]] = None,
78
+ error_trace: t.Optional[bool] = None,
79
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
80
+ human: t.Optional[bool] = None,
81
+ pretty: t.Optional[bool] = None,
82
+ ) -> ObjectApiResponse[t.Any]:
83
+ """
84
+ .. raw:: html
85
+
86
+ <p>Get Logstash pipelines.
87
+ Get pipelines that are used for Logstash Central Management.</p>
88
+
89
+
90
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-logstash-get-pipeline>`_
91
+
92
+ :param id: A comma-separated list of pipeline identifiers.
93
+ """
94
+ __path_parts: t.Dict[str, str]
95
+ if id not in SKIP_IN_PATH:
96
+ __path_parts = {"id": _quote(id)}
97
+ __path = f'/_logstash/pipeline/{__path_parts["id"]}'
98
+ else:
99
+ __path_parts = {}
100
+ __path = "/_logstash/pipeline"
101
+ __query: t.Dict[str, t.Any] = {}
102
+ if error_trace is not None:
103
+ __query["error_trace"] = error_trace
104
+ if filter_path is not None:
105
+ __query["filter_path"] = filter_path
106
+ if human is not None:
107
+ __query["human"] = human
108
+ if pretty is not None:
109
+ __query["pretty"] = pretty
110
+ __headers = {"accept": "application/json"}
111
+ return self.perform_request( # type: ignore[return-value]
112
+ "GET",
113
+ __path,
114
+ params=__query,
115
+ headers=__headers,
116
+ endpoint_id="logstash.get_pipeline",
117
+ path_parts=__path_parts,
118
+ )
119
+
120
+ @_rewrite_parameters(
121
+ body_name="pipeline",
122
+ )
123
+ def put_pipeline(
124
+ self,
125
+ *,
126
+ id: str,
127
+ pipeline: t.Optional[t.Mapping[str, t.Any]] = None,
128
+ body: t.Optional[t.Mapping[str, t.Any]] = None,
129
+ error_trace: t.Optional[bool] = None,
130
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
131
+ human: t.Optional[bool] = None,
132
+ pretty: t.Optional[bool] = None,
133
+ ) -> ObjectApiResponse[t.Any]:
134
+ """
135
+ .. raw:: html
136
+
137
+ <p>Create or update a Logstash pipeline.</p>
138
+ <p>Create a pipeline that is used for Logstash Central Management.
139
+ If the specified pipeline exists, it is replaced.</p>
140
+
141
+
142
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-logstash-put-pipeline>`_
143
+
144
+ :param id: An identifier for the pipeline.
145
+ :param pipeline:
146
+ """
147
+ if id in SKIP_IN_PATH:
148
+ raise ValueError("Empty value passed for parameter 'id'")
149
+ if pipeline is None and body is None:
150
+ raise ValueError(
151
+ "Empty value passed for parameters 'pipeline' and 'body', one of them should be set."
152
+ )
153
+ elif pipeline is not None and body is not None:
154
+ raise ValueError("Cannot set both 'pipeline' and 'body'")
155
+ __path_parts: t.Dict[str, str] = {"id": _quote(id)}
156
+ __path = f'/_logstash/pipeline/{__path_parts["id"]}'
157
+ __query: t.Dict[str, t.Any] = {}
158
+ if error_trace is not None:
159
+ __query["error_trace"] = error_trace
160
+ if filter_path is not None:
161
+ __query["filter_path"] = filter_path
162
+ if human is not None:
163
+ __query["human"] = human
164
+ if pretty is not None:
165
+ __query["pretty"] = pretty
166
+ __body = pipeline if pipeline is not None else body
167
+ __headers = {"accept": "application/json", "content-type": "application/json"}
168
+ return self.perform_request( # type: ignore[return-value]
169
+ "PUT",
170
+ __path,
171
+ params=__query,
172
+ headers=__headers,
173
+ body=__body,
174
+ endpoint_id="logstash.put_pipeline",
175
+ path_parts=__path_parts,
176
+ )