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,1978 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ import typing as t
19
+
20
+ from elastic_transport import ObjectApiResponse
21
+
22
+ from ._base import NamespacedClient
23
+ from .utils import (
24
+ SKIP_IN_PATH,
25
+ Stability,
26
+ _quote,
27
+ _rewrite_parameters,
28
+ _stability_warning,
29
+ )
30
+
31
+
32
+ class ConnectorClient(NamespacedClient):
33
+
34
+ @_rewrite_parameters()
35
+ @_stability_warning(Stability.EXPERIMENTAL)
36
+ async def check_in(
37
+ self,
38
+ *,
39
+ connector_id: str,
40
+ error_trace: t.Optional[bool] = None,
41
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
42
+ human: t.Optional[bool] = None,
43
+ pretty: t.Optional[bool] = None,
44
+ ) -> ObjectApiResponse[t.Any]:
45
+ """
46
+ .. raw:: html
47
+
48
+ <p>Check in a connector.</p>
49
+ <p>Update the <code>last_seen</code> field in the connector and set it to the current timestamp.</p>
50
+
51
+
52
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-check-in>`_
53
+
54
+ :param connector_id: The unique identifier of the connector to be checked in
55
+ """
56
+ if connector_id in SKIP_IN_PATH:
57
+ raise ValueError("Empty value passed for parameter 'connector_id'")
58
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
59
+ __path = f'/_connector/{__path_parts["connector_id"]}/_check_in'
60
+ __query: t.Dict[str, t.Any] = {}
61
+ if error_trace is not None:
62
+ __query["error_trace"] = error_trace
63
+ if filter_path is not None:
64
+ __query["filter_path"] = filter_path
65
+ if human is not None:
66
+ __query["human"] = human
67
+ if pretty is not None:
68
+ __query["pretty"] = pretty
69
+ __headers = {"accept": "application/json"}
70
+ return await self.perform_request( # type: ignore[return-value]
71
+ "PUT",
72
+ __path,
73
+ params=__query,
74
+ headers=__headers,
75
+ endpoint_id="connector.check_in",
76
+ path_parts=__path_parts,
77
+ )
78
+
79
+ @_rewrite_parameters()
80
+ @_stability_warning(Stability.BETA)
81
+ async def delete(
82
+ self,
83
+ *,
84
+ connector_id: str,
85
+ delete_sync_jobs: t.Optional[bool] = None,
86
+ error_trace: t.Optional[bool] = None,
87
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
88
+ hard: t.Optional[bool] = None,
89
+ human: t.Optional[bool] = None,
90
+ pretty: t.Optional[bool] = None,
91
+ ) -> ObjectApiResponse[t.Any]:
92
+ """
93
+ .. raw:: html
94
+
95
+ <p>Delete a connector.</p>
96
+ <p>Removes a connector and associated sync jobs.
97
+ This is a destructive action that is not recoverable.
98
+ NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector.
99
+ These need to be removed manually.</p>
100
+
101
+
102
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-delete>`_
103
+
104
+ :param connector_id: The unique identifier of the connector to be deleted
105
+ :param delete_sync_jobs: A flag indicating if associated sync jobs should be
106
+ also removed. Defaults to false.
107
+ :param hard: A flag indicating if the connector should be hard deleted.
108
+ """
109
+ if connector_id in SKIP_IN_PATH:
110
+ raise ValueError("Empty value passed for parameter 'connector_id'")
111
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
112
+ __path = f'/_connector/{__path_parts["connector_id"]}'
113
+ __query: t.Dict[str, t.Any] = {}
114
+ if delete_sync_jobs is not None:
115
+ __query["delete_sync_jobs"] = delete_sync_jobs
116
+ if error_trace is not None:
117
+ __query["error_trace"] = error_trace
118
+ if filter_path is not None:
119
+ __query["filter_path"] = filter_path
120
+ if hard is not None:
121
+ __query["hard"] = hard
122
+ if human is not None:
123
+ __query["human"] = human
124
+ if pretty is not None:
125
+ __query["pretty"] = pretty
126
+ __headers = {"accept": "application/json"}
127
+ return await self.perform_request( # type: ignore[return-value]
128
+ "DELETE",
129
+ __path,
130
+ params=__query,
131
+ headers=__headers,
132
+ endpoint_id="connector.delete",
133
+ path_parts=__path_parts,
134
+ )
135
+
136
+ @_rewrite_parameters()
137
+ @_stability_warning(Stability.BETA)
138
+ async def get(
139
+ self,
140
+ *,
141
+ connector_id: str,
142
+ error_trace: t.Optional[bool] = None,
143
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
144
+ human: t.Optional[bool] = None,
145
+ include_deleted: t.Optional[bool] = None,
146
+ pretty: t.Optional[bool] = None,
147
+ ) -> ObjectApiResponse[t.Any]:
148
+ """
149
+ .. raw:: html
150
+
151
+ <p>Get a connector.</p>
152
+ <p>Get the details about a connector.</p>
153
+
154
+
155
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-get>`_
156
+
157
+ :param connector_id: The unique identifier of the connector
158
+ :param include_deleted: A flag to indicate if the desired connector should be
159
+ fetched, even if it was soft-deleted.
160
+ """
161
+ if connector_id in SKIP_IN_PATH:
162
+ raise ValueError("Empty value passed for parameter 'connector_id'")
163
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
164
+ __path = f'/_connector/{__path_parts["connector_id"]}'
165
+ __query: t.Dict[str, t.Any] = {}
166
+ if error_trace is not None:
167
+ __query["error_trace"] = error_trace
168
+ if filter_path is not None:
169
+ __query["filter_path"] = filter_path
170
+ if human is not None:
171
+ __query["human"] = human
172
+ if include_deleted is not None:
173
+ __query["include_deleted"] = include_deleted
174
+ if pretty is not None:
175
+ __query["pretty"] = pretty
176
+ __headers = {"accept": "application/json"}
177
+ return await self.perform_request( # type: ignore[return-value]
178
+ "GET",
179
+ __path,
180
+ params=__query,
181
+ headers=__headers,
182
+ endpoint_id="connector.get",
183
+ path_parts=__path_parts,
184
+ )
185
+
186
+ @_rewrite_parameters(
187
+ body_fields=(
188
+ "last_access_control_sync_error",
189
+ "last_access_control_sync_scheduled_at",
190
+ "last_access_control_sync_status",
191
+ "last_deleted_document_count",
192
+ "last_incremental_sync_scheduled_at",
193
+ "last_indexed_document_count",
194
+ "last_seen",
195
+ "last_sync_error",
196
+ "last_sync_scheduled_at",
197
+ "last_sync_status",
198
+ "last_synced",
199
+ "sync_cursor",
200
+ ),
201
+ )
202
+ @_stability_warning(Stability.EXPERIMENTAL)
203
+ async def last_sync(
204
+ self,
205
+ *,
206
+ connector_id: str,
207
+ error_trace: t.Optional[bool] = None,
208
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
209
+ human: t.Optional[bool] = None,
210
+ last_access_control_sync_error: t.Optional[str] = None,
211
+ last_access_control_sync_scheduled_at: t.Optional[t.Union[str, t.Any]] = None,
212
+ last_access_control_sync_status: t.Optional[
213
+ t.Union[
214
+ str,
215
+ t.Literal[
216
+ "canceled",
217
+ "canceling",
218
+ "completed",
219
+ "error",
220
+ "in_progress",
221
+ "pending",
222
+ "suspended",
223
+ ],
224
+ ]
225
+ ] = None,
226
+ last_deleted_document_count: t.Optional[int] = None,
227
+ last_incremental_sync_scheduled_at: t.Optional[t.Union[str, t.Any]] = None,
228
+ last_indexed_document_count: t.Optional[int] = None,
229
+ last_seen: t.Optional[t.Union[str, t.Any]] = None,
230
+ last_sync_error: t.Optional[str] = None,
231
+ last_sync_scheduled_at: t.Optional[t.Union[str, t.Any]] = None,
232
+ last_sync_status: t.Optional[
233
+ t.Union[
234
+ str,
235
+ t.Literal[
236
+ "canceled",
237
+ "canceling",
238
+ "completed",
239
+ "error",
240
+ "in_progress",
241
+ "pending",
242
+ "suspended",
243
+ ],
244
+ ]
245
+ ] = None,
246
+ last_synced: t.Optional[t.Union[str, t.Any]] = None,
247
+ pretty: t.Optional[bool] = None,
248
+ sync_cursor: t.Optional[t.Any] = None,
249
+ body: t.Optional[t.Dict[str, t.Any]] = None,
250
+ ) -> ObjectApiResponse[t.Any]:
251
+ """
252
+ .. raw:: html
253
+
254
+ <p>Update the connector last sync stats.</p>
255
+ <p>Update the fields related to the last sync of a connector.
256
+ This action is used for analytics and monitoring.</p>
257
+
258
+
259
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-last-sync>`_
260
+
261
+ :param connector_id: The unique identifier of the connector to be updated
262
+ :param last_access_control_sync_error:
263
+ :param last_access_control_sync_scheduled_at:
264
+ :param last_access_control_sync_status:
265
+ :param last_deleted_document_count:
266
+ :param last_incremental_sync_scheduled_at:
267
+ :param last_indexed_document_count:
268
+ :param last_seen:
269
+ :param last_sync_error:
270
+ :param last_sync_scheduled_at:
271
+ :param last_sync_status:
272
+ :param last_synced:
273
+ :param sync_cursor:
274
+ """
275
+ if connector_id in SKIP_IN_PATH:
276
+ raise ValueError("Empty value passed for parameter 'connector_id'")
277
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
278
+ __path = f'/_connector/{__path_parts["connector_id"]}/_last_sync'
279
+ __query: t.Dict[str, t.Any] = {}
280
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
281
+ if error_trace is not None:
282
+ __query["error_trace"] = error_trace
283
+ if filter_path is not None:
284
+ __query["filter_path"] = filter_path
285
+ if human is not None:
286
+ __query["human"] = human
287
+ if pretty is not None:
288
+ __query["pretty"] = pretty
289
+ if not __body:
290
+ if last_access_control_sync_error is not None:
291
+ __body["last_access_control_sync_error"] = (
292
+ last_access_control_sync_error
293
+ )
294
+ if last_access_control_sync_scheduled_at is not None:
295
+ __body["last_access_control_sync_scheduled_at"] = (
296
+ last_access_control_sync_scheduled_at
297
+ )
298
+ if last_access_control_sync_status is not None:
299
+ __body["last_access_control_sync_status"] = (
300
+ last_access_control_sync_status
301
+ )
302
+ if last_deleted_document_count is not None:
303
+ __body["last_deleted_document_count"] = last_deleted_document_count
304
+ if last_incremental_sync_scheduled_at is not None:
305
+ __body["last_incremental_sync_scheduled_at"] = (
306
+ last_incremental_sync_scheduled_at
307
+ )
308
+ if last_indexed_document_count is not None:
309
+ __body["last_indexed_document_count"] = last_indexed_document_count
310
+ if last_seen is not None:
311
+ __body["last_seen"] = last_seen
312
+ if last_sync_error is not None:
313
+ __body["last_sync_error"] = last_sync_error
314
+ if last_sync_scheduled_at is not None:
315
+ __body["last_sync_scheduled_at"] = last_sync_scheduled_at
316
+ if last_sync_status is not None:
317
+ __body["last_sync_status"] = last_sync_status
318
+ if last_synced is not None:
319
+ __body["last_synced"] = last_synced
320
+ if sync_cursor is not None:
321
+ __body["sync_cursor"] = sync_cursor
322
+ __headers = {"accept": "application/json", "content-type": "application/json"}
323
+ return await self.perform_request( # type: ignore[return-value]
324
+ "PUT",
325
+ __path,
326
+ params=__query,
327
+ headers=__headers,
328
+ body=__body,
329
+ endpoint_id="connector.last_sync",
330
+ path_parts=__path_parts,
331
+ )
332
+
333
+ @_rewrite_parameters(
334
+ parameter_aliases={"from": "from_"},
335
+ )
336
+ @_stability_warning(Stability.BETA)
337
+ async def list(
338
+ self,
339
+ *,
340
+ connector_name: t.Optional[t.Union[str, t.Sequence[str]]] = None,
341
+ error_trace: t.Optional[bool] = None,
342
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
343
+ from_: t.Optional[int] = None,
344
+ human: t.Optional[bool] = None,
345
+ include_deleted: t.Optional[bool] = None,
346
+ index_name: t.Optional[t.Union[str, t.Sequence[str]]] = None,
347
+ pretty: t.Optional[bool] = None,
348
+ query: t.Optional[str] = None,
349
+ service_type: t.Optional[t.Union[str, t.Sequence[str]]] = None,
350
+ size: t.Optional[int] = None,
351
+ ) -> ObjectApiResponse[t.Any]:
352
+ """
353
+ .. raw:: html
354
+
355
+ <p>Get all connectors.</p>
356
+ <p>Get information about all connectors.</p>
357
+
358
+
359
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-list>`_
360
+
361
+ :param connector_name: A comma-separated list of connector names to fetch connector
362
+ documents for
363
+ :param from_: Starting offset (default: 0)
364
+ :param include_deleted: A flag to indicate if the desired connector should be
365
+ fetched, even if it was soft-deleted.
366
+ :param index_name: A comma-separated list of connector index names to fetch connector
367
+ documents for
368
+ :param query: A wildcard query string that filters connectors with matching name,
369
+ description or index name
370
+ :param service_type: A comma-separated list of connector service types to fetch
371
+ connector documents for
372
+ :param size: Specifies a max number of results to get
373
+ """
374
+ __path_parts: t.Dict[str, str] = {}
375
+ __path = "/_connector"
376
+ __query: t.Dict[str, t.Any] = {}
377
+ if connector_name is not None:
378
+ __query["connector_name"] = connector_name
379
+ if error_trace is not None:
380
+ __query["error_trace"] = error_trace
381
+ if filter_path is not None:
382
+ __query["filter_path"] = filter_path
383
+ if from_ is not None:
384
+ __query["from"] = from_
385
+ if human is not None:
386
+ __query["human"] = human
387
+ if include_deleted is not None:
388
+ __query["include_deleted"] = include_deleted
389
+ if index_name is not None:
390
+ __query["index_name"] = index_name
391
+ if pretty is not None:
392
+ __query["pretty"] = pretty
393
+ if query is not None:
394
+ __query["query"] = query
395
+ if service_type is not None:
396
+ __query["service_type"] = service_type
397
+ if size is not None:
398
+ __query["size"] = size
399
+ __headers = {"accept": "application/json"}
400
+ return await self.perform_request( # type: ignore[return-value]
401
+ "GET",
402
+ __path,
403
+ params=__query,
404
+ headers=__headers,
405
+ endpoint_id="connector.list",
406
+ path_parts=__path_parts,
407
+ )
408
+
409
+ @_rewrite_parameters(
410
+ body_fields=(
411
+ "description",
412
+ "index_name",
413
+ "is_native",
414
+ "language",
415
+ "name",
416
+ "service_type",
417
+ ),
418
+ )
419
+ @_stability_warning(Stability.BETA)
420
+ async def post(
421
+ self,
422
+ *,
423
+ description: t.Optional[str] = None,
424
+ error_trace: t.Optional[bool] = None,
425
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
426
+ human: t.Optional[bool] = None,
427
+ index_name: t.Optional[str] = None,
428
+ is_native: t.Optional[bool] = None,
429
+ language: t.Optional[str] = None,
430
+ name: t.Optional[str] = None,
431
+ pretty: t.Optional[bool] = None,
432
+ service_type: t.Optional[str] = None,
433
+ body: t.Optional[t.Dict[str, t.Any]] = None,
434
+ ) -> ObjectApiResponse[t.Any]:
435
+ """
436
+ .. raw:: html
437
+
438
+ <p>Create a connector.</p>
439
+ <p>Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure.
440
+ Elastic managed connectors (Native connectors) are a managed service on Elastic Cloud.
441
+ Self-managed connectors (Connector clients) are self-managed on your infrastructure.</p>
442
+
443
+
444
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-put>`_
445
+
446
+ :param description:
447
+ :param index_name:
448
+ :param is_native:
449
+ :param language:
450
+ :param name:
451
+ :param service_type:
452
+ """
453
+ __path_parts: t.Dict[str, str] = {}
454
+ __path = "/_connector"
455
+ __query: t.Dict[str, t.Any] = {}
456
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
457
+ if error_trace is not None:
458
+ __query["error_trace"] = error_trace
459
+ if filter_path is not None:
460
+ __query["filter_path"] = filter_path
461
+ if human is not None:
462
+ __query["human"] = human
463
+ if pretty is not None:
464
+ __query["pretty"] = pretty
465
+ if not __body:
466
+ if description is not None:
467
+ __body["description"] = description
468
+ if index_name is not None:
469
+ __body["index_name"] = index_name
470
+ if is_native is not None:
471
+ __body["is_native"] = is_native
472
+ if language is not None:
473
+ __body["language"] = language
474
+ if name is not None:
475
+ __body["name"] = name
476
+ if service_type is not None:
477
+ __body["service_type"] = service_type
478
+ if not __body:
479
+ __body = None # type: ignore[assignment]
480
+ __headers = {"accept": "application/json"}
481
+ if __body is not None:
482
+ __headers["content-type"] = "application/json"
483
+ return await self.perform_request( # type: ignore[return-value]
484
+ "POST",
485
+ __path,
486
+ params=__query,
487
+ headers=__headers,
488
+ body=__body,
489
+ endpoint_id="connector.post",
490
+ path_parts=__path_parts,
491
+ )
492
+
493
+ @_rewrite_parameters(
494
+ body_fields=(
495
+ "description",
496
+ "index_name",
497
+ "is_native",
498
+ "language",
499
+ "name",
500
+ "service_type",
501
+ ),
502
+ )
503
+ @_stability_warning(Stability.BETA)
504
+ async def put(
505
+ self,
506
+ *,
507
+ connector_id: t.Optional[str] = None,
508
+ description: t.Optional[str] = None,
509
+ error_trace: t.Optional[bool] = None,
510
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
511
+ human: t.Optional[bool] = None,
512
+ index_name: t.Optional[str] = None,
513
+ is_native: t.Optional[bool] = None,
514
+ language: t.Optional[str] = None,
515
+ name: t.Optional[str] = None,
516
+ pretty: t.Optional[bool] = None,
517
+ service_type: t.Optional[str] = None,
518
+ body: t.Optional[t.Dict[str, t.Any]] = None,
519
+ ) -> ObjectApiResponse[t.Any]:
520
+ """
521
+ .. raw:: html
522
+
523
+ <p>Create or update a connector.</p>
524
+
525
+
526
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-put>`_
527
+
528
+ :param connector_id: The unique identifier of the connector to be created or
529
+ updated. ID is auto-generated if not provided.
530
+ :param description:
531
+ :param index_name:
532
+ :param is_native:
533
+ :param language:
534
+ :param name:
535
+ :param service_type:
536
+ """
537
+ __path_parts: t.Dict[str, str]
538
+ if connector_id not in SKIP_IN_PATH:
539
+ __path_parts = {"connector_id": _quote(connector_id)}
540
+ __path = f'/_connector/{__path_parts["connector_id"]}'
541
+ else:
542
+ __path_parts = {}
543
+ __path = "/_connector"
544
+ __query: t.Dict[str, t.Any] = {}
545
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
546
+ if error_trace is not None:
547
+ __query["error_trace"] = error_trace
548
+ if filter_path is not None:
549
+ __query["filter_path"] = filter_path
550
+ if human is not None:
551
+ __query["human"] = human
552
+ if pretty is not None:
553
+ __query["pretty"] = pretty
554
+ if not __body:
555
+ if description is not None:
556
+ __body["description"] = description
557
+ if index_name is not None:
558
+ __body["index_name"] = index_name
559
+ if is_native is not None:
560
+ __body["is_native"] = is_native
561
+ if language is not None:
562
+ __body["language"] = language
563
+ if name is not None:
564
+ __body["name"] = name
565
+ if service_type is not None:
566
+ __body["service_type"] = service_type
567
+ if not __body:
568
+ __body = None # type: ignore[assignment]
569
+ __headers = {"accept": "application/json"}
570
+ if __body is not None:
571
+ __headers["content-type"] = "application/json"
572
+ return await self.perform_request( # type: ignore[return-value]
573
+ "PUT",
574
+ __path,
575
+ params=__query,
576
+ headers=__headers,
577
+ body=__body,
578
+ endpoint_id="connector.put",
579
+ path_parts=__path_parts,
580
+ )
581
+
582
+ @_rewrite_parameters()
583
+ @_stability_warning(Stability.BETA)
584
+ async def sync_job_cancel(
585
+ self,
586
+ *,
587
+ connector_sync_job_id: str,
588
+ error_trace: t.Optional[bool] = None,
589
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
590
+ human: t.Optional[bool] = None,
591
+ pretty: t.Optional[bool] = None,
592
+ ) -> ObjectApiResponse[t.Any]:
593
+ """
594
+ .. raw:: html
595
+
596
+ <p>Cancel a connector sync job.</p>
597
+ <p>Cancel a connector sync job, which sets the status to cancelling and updates <code>cancellation_requested_at</code> to the current time.
598
+ The connector service is then responsible for setting the status of connector sync jobs to cancelled.</p>
599
+
600
+
601
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-cancel>`_
602
+
603
+ :param connector_sync_job_id: The unique identifier of the connector sync job
604
+ """
605
+ if connector_sync_job_id in SKIP_IN_PATH:
606
+ raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
607
+ __path_parts: t.Dict[str, str] = {
608
+ "connector_sync_job_id": _quote(connector_sync_job_id)
609
+ }
610
+ __path = (
611
+ f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_cancel'
612
+ )
613
+ __query: t.Dict[str, t.Any] = {}
614
+ if error_trace is not None:
615
+ __query["error_trace"] = error_trace
616
+ if filter_path is not None:
617
+ __query["filter_path"] = filter_path
618
+ if human is not None:
619
+ __query["human"] = human
620
+ if pretty is not None:
621
+ __query["pretty"] = pretty
622
+ __headers = {"accept": "application/json"}
623
+ return await self.perform_request( # type: ignore[return-value]
624
+ "PUT",
625
+ __path,
626
+ params=__query,
627
+ headers=__headers,
628
+ endpoint_id="connector.sync_job_cancel",
629
+ path_parts=__path_parts,
630
+ )
631
+
632
+ @_rewrite_parameters()
633
+ @_stability_warning(Stability.EXPERIMENTAL)
634
+ async def sync_job_check_in(
635
+ self,
636
+ *,
637
+ connector_sync_job_id: str,
638
+ error_trace: t.Optional[bool] = None,
639
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
640
+ human: t.Optional[bool] = None,
641
+ pretty: t.Optional[bool] = None,
642
+ ) -> ObjectApiResponse[t.Any]:
643
+ """
644
+ .. raw:: html
645
+
646
+ <p>Check in a connector sync job.
647
+ Check in a connector sync job and set the <code>last_seen</code> field to the current time before updating it in the internal index.</p>
648
+ <p>To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
649
+ This service runs automatically on Elastic Cloud for Elastic managed connectors.</p>
650
+
651
+
652
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-check-in>`_
653
+
654
+ :param connector_sync_job_id: The unique identifier of the connector sync job
655
+ to be checked in.
656
+ """
657
+ if connector_sync_job_id in SKIP_IN_PATH:
658
+ raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
659
+ __path_parts: t.Dict[str, str] = {
660
+ "connector_sync_job_id": _quote(connector_sync_job_id)
661
+ }
662
+ __path = (
663
+ f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_check_in'
664
+ )
665
+ __query: t.Dict[str, t.Any] = {}
666
+ if error_trace is not None:
667
+ __query["error_trace"] = error_trace
668
+ if filter_path is not None:
669
+ __query["filter_path"] = filter_path
670
+ if human is not None:
671
+ __query["human"] = human
672
+ if pretty is not None:
673
+ __query["pretty"] = pretty
674
+ __headers = {"accept": "application/json"}
675
+ return await self.perform_request( # type: ignore[return-value]
676
+ "PUT",
677
+ __path,
678
+ params=__query,
679
+ headers=__headers,
680
+ endpoint_id="connector.sync_job_check_in",
681
+ path_parts=__path_parts,
682
+ )
683
+
684
+ @_rewrite_parameters(
685
+ body_fields=("worker_hostname", "sync_cursor"),
686
+ )
687
+ @_stability_warning(Stability.EXPERIMENTAL)
688
+ async def sync_job_claim(
689
+ self,
690
+ *,
691
+ connector_sync_job_id: str,
692
+ worker_hostname: t.Optional[str] = None,
693
+ error_trace: t.Optional[bool] = None,
694
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
695
+ human: t.Optional[bool] = None,
696
+ pretty: t.Optional[bool] = None,
697
+ sync_cursor: t.Optional[t.Any] = None,
698
+ body: t.Optional[t.Dict[str, t.Any]] = None,
699
+ ) -> ObjectApiResponse[t.Any]:
700
+ """
701
+ .. raw:: html
702
+
703
+ <p>Claim a connector sync job.
704
+ This action updates the job status to <code>in_progress</code> and sets the <code>last_seen</code> and <code>started_at</code> timestamps to the current time.
705
+ Additionally, it can set the <code>sync_cursor</code> property for the sync job.</p>
706
+ <p>This API is not intended for direct connector management by users.
707
+ It supports the implementation of services that utilize the connector protocol to communicate with Elasticsearch.</p>
708
+ <p>To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
709
+ This service runs automatically on Elastic Cloud for Elastic managed connectors.</p>
710
+
711
+
712
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-claim>`_
713
+
714
+ :param connector_sync_job_id: The unique identifier of the connector sync job.
715
+ :param worker_hostname: The host name of the current system that will run the
716
+ job.
717
+ :param sync_cursor: The cursor object from the last incremental sync job. This
718
+ should reference the `sync_cursor` field in the connector state for which
719
+ the job runs.
720
+ """
721
+ if connector_sync_job_id in SKIP_IN_PATH:
722
+ raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
723
+ if worker_hostname is None and body is None:
724
+ raise ValueError("Empty value passed for parameter 'worker_hostname'")
725
+ __path_parts: t.Dict[str, str] = {
726
+ "connector_sync_job_id": _quote(connector_sync_job_id)
727
+ }
728
+ __path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_claim'
729
+ __query: t.Dict[str, t.Any] = {}
730
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
731
+ if error_trace is not None:
732
+ __query["error_trace"] = error_trace
733
+ if filter_path is not None:
734
+ __query["filter_path"] = filter_path
735
+ if human is not None:
736
+ __query["human"] = human
737
+ if pretty is not None:
738
+ __query["pretty"] = pretty
739
+ if not __body:
740
+ if worker_hostname is not None:
741
+ __body["worker_hostname"] = worker_hostname
742
+ if sync_cursor is not None:
743
+ __body["sync_cursor"] = sync_cursor
744
+ __headers = {"accept": "application/json", "content-type": "application/json"}
745
+ return await self.perform_request( # type: ignore[return-value]
746
+ "PUT",
747
+ __path,
748
+ params=__query,
749
+ headers=__headers,
750
+ body=__body,
751
+ endpoint_id="connector.sync_job_claim",
752
+ path_parts=__path_parts,
753
+ )
754
+
755
+ @_rewrite_parameters()
756
+ @_stability_warning(Stability.BETA)
757
+ async def sync_job_delete(
758
+ self,
759
+ *,
760
+ connector_sync_job_id: str,
761
+ error_trace: t.Optional[bool] = None,
762
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
763
+ human: t.Optional[bool] = None,
764
+ pretty: t.Optional[bool] = None,
765
+ ) -> ObjectApiResponse[t.Any]:
766
+ """
767
+ .. raw:: html
768
+
769
+ <p>Delete a connector sync job.</p>
770
+ <p>Remove a connector sync job and its associated data.
771
+ This is a destructive action that is not recoverable.</p>
772
+
773
+
774
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-delete>`_
775
+
776
+ :param connector_sync_job_id: The unique identifier of the connector sync job
777
+ to be deleted
778
+ """
779
+ if connector_sync_job_id in SKIP_IN_PATH:
780
+ raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
781
+ __path_parts: t.Dict[str, str] = {
782
+ "connector_sync_job_id": _quote(connector_sync_job_id)
783
+ }
784
+ __path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}'
785
+ __query: t.Dict[str, t.Any] = {}
786
+ if error_trace is not None:
787
+ __query["error_trace"] = error_trace
788
+ if filter_path is not None:
789
+ __query["filter_path"] = filter_path
790
+ if human is not None:
791
+ __query["human"] = human
792
+ if pretty is not None:
793
+ __query["pretty"] = pretty
794
+ __headers = {"accept": "application/json"}
795
+ return await self.perform_request( # type: ignore[return-value]
796
+ "DELETE",
797
+ __path,
798
+ params=__query,
799
+ headers=__headers,
800
+ endpoint_id="connector.sync_job_delete",
801
+ path_parts=__path_parts,
802
+ )
803
+
804
+ @_rewrite_parameters(
805
+ body_fields=("error",),
806
+ )
807
+ @_stability_warning(Stability.EXPERIMENTAL)
808
+ async def sync_job_error(
809
+ self,
810
+ *,
811
+ connector_sync_job_id: str,
812
+ error: t.Optional[str] = None,
813
+ error_trace: t.Optional[bool] = None,
814
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
815
+ human: t.Optional[bool] = None,
816
+ pretty: t.Optional[bool] = None,
817
+ body: t.Optional[t.Dict[str, t.Any]] = None,
818
+ ) -> ObjectApiResponse[t.Any]:
819
+ """
820
+ .. raw:: html
821
+
822
+ <p>Set a connector sync job error.
823
+ Set the <code>error</code> field for a connector sync job and set its <code>status</code> to <code>error</code>.</p>
824
+ <p>To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
825
+ This service runs automatically on Elastic Cloud for Elastic managed connectors.</p>
826
+
827
+
828
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-error>`_
829
+
830
+ :param connector_sync_job_id: The unique identifier for the connector sync job.
831
+ :param error: The error for the connector sync job error field.
832
+ """
833
+ if connector_sync_job_id in SKIP_IN_PATH:
834
+ raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
835
+ if error is None and body is None:
836
+ raise ValueError("Empty value passed for parameter 'error'")
837
+ __path_parts: t.Dict[str, str] = {
838
+ "connector_sync_job_id": _quote(connector_sync_job_id)
839
+ }
840
+ __path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_error'
841
+ __query: t.Dict[str, t.Any] = {}
842
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
843
+ if error_trace is not None:
844
+ __query["error_trace"] = error_trace
845
+ if filter_path is not None:
846
+ __query["filter_path"] = filter_path
847
+ if human is not None:
848
+ __query["human"] = human
849
+ if pretty is not None:
850
+ __query["pretty"] = pretty
851
+ if not __body:
852
+ if error is not None:
853
+ __body["error"] = error
854
+ __headers = {"accept": "application/json", "content-type": "application/json"}
855
+ return await self.perform_request( # type: ignore[return-value]
856
+ "PUT",
857
+ __path,
858
+ params=__query,
859
+ headers=__headers,
860
+ body=__body,
861
+ endpoint_id="connector.sync_job_error",
862
+ path_parts=__path_parts,
863
+ )
864
+
865
+ @_rewrite_parameters()
866
+ @_stability_warning(Stability.BETA)
867
+ async def sync_job_get(
868
+ self,
869
+ *,
870
+ connector_sync_job_id: str,
871
+ error_trace: t.Optional[bool] = None,
872
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
873
+ human: t.Optional[bool] = None,
874
+ pretty: t.Optional[bool] = None,
875
+ ) -> ObjectApiResponse[t.Any]:
876
+ """
877
+ .. raw:: html
878
+
879
+ <p>Get a connector sync job.</p>
880
+
881
+
882
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-get>`_
883
+
884
+ :param connector_sync_job_id: The unique identifier of the connector sync job
885
+ """
886
+ if connector_sync_job_id in SKIP_IN_PATH:
887
+ raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
888
+ __path_parts: t.Dict[str, str] = {
889
+ "connector_sync_job_id": _quote(connector_sync_job_id)
890
+ }
891
+ __path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}'
892
+ __query: t.Dict[str, t.Any] = {}
893
+ if error_trace is not None:
894
+ __query["error_trace"] = error_trace
895
+ if filter_path is not None:
896
+ __query["filter_path"] = filter_path
897
+ if human is not None:
898
+ __query["human"] = human
899
+ if pretty is not None:
900
+ __query["pretty"] = pretty
901
+ __headers = {"accept": "application/json"}
902
+ return await self.perform_request( # type: ignore[return-value]
903
+ "GET",
904
+ __path,
905
+ params=__query,
906
+ headers=__headers,
907
+ endpoint_id="connector.sync_job_get",
908
+ path_parts=__path_parts,
909
+ )
910
+
911
+ @_rewrite_parameters(
912
+ parameter_aliases={"from": "from_"},
913
+ )
914
+ @_stability_warning(Stability.BETA)
915
+ async def sync_job_list(
916
+ self,
917
+ *,
918
+ connector_id: t.Optional[str] = None,
919
+ error_trace: t.Optional[bool] = None,
920
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
921
+ from_: t.Optional[int] = None,
922
+ human: t.Optional[bool] = None,
923
+ job_type: t.Optional[
924
+ t.Union[
925
+ t.Sequence[
926
+ t.Union[str, t.Literal["access_control", "full", "incremental"]]
927
+ ],
928
+ t.Union[str, t.Literal["access_control", "full", "incremental"]],
929
+ ]
930
+ ] = None,
931
+ pretty: t.Optional[bool] = None,
932
+ size: t.Optional[int] = None,
933
+ status: t.Optional[
934
+ t.Union[
935
+ str,
936
+ t.Literal[
937
+ "canceled",
938
+ "canceling",
939
+ "completed",
940
+ "error",
941
+ "in_progress",
942
+ "pending",
943
+ "suspended",
944
+ ],
945
+ ]
946
+ ] = None,
947
+ ) -> ObjectApiResponse[t.Any]:
948
+ """
949
+ .. raw:: html
950
+
951
+ <p>Get all connector sync jobs.</p>
952
+ <p>Get information about all stored connector sync jobs listed by their creation date in ascending order.</p>
953
+
954
+
955
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-list>`_
956
+
957
+ :param connector_id: A connector id to fetch connector sync jobs for
958
+ :param from_: Starting offset (default: 0)
959
+ :param job_type: A comma-separated list of job types to fetch the sync jobs for
960
+ :param size: Specifies a max number of results to get
961
+ :param status: A sync job status to fetch connector sync jobs for
962
+ """
963
+ __path_parts: t.Dict[str, str] = {}
964
+ __path = "/_connector/_sync_job"
965
+ __query: t.Dict[str, t.Any] = {}
966
+ if connector_id is not None:
967
+ __query["connector_id"] = connector_id
968
+ if error_trace is not None:
969
+ __query["error_trace"] = error_trace
970
+ if filter_path is not None:
971
+ __query["filter_path"] = filter_path
972
+ if from_ is not None:
973
+ __query["from"] = from_
974
+ if human is not None:
975
+ __query["human"] = human
976
+ if job_type is not None:
977
+ __query["job_type"] = job_type
978
+ if pretty is not None:
979
+ __query["pretty"] = pretty
980
+ if size is not None:
981
+ __query["size"] = size
982
+ if status is not None:
983
+ __query["status"] = status
984
+ __headers = {"accept": "application/json"}
985
+ return await self.perform_request( # type: ignore[return-value]
986
+ "GET",
987
+ __path,
988
+ params=__query,
989
+ headers=__headers,
990
+ endpoint_id="connector.sync_job_list",
991
+ path_parts=__path_parts,
992
+ )
993
+
994
+ @_rewrite_parameters(
995
+ body_fields=("id", "job_type", "trigger_method"),
996
+ )
997
+ @_stability_warning(Stability.BETA)
998
+ async def sync_job_post(
999
+ self,
1000
+ *,
1001
+ id: t.Optional[str] = None,
1002
+ error_trace: t.Optional[bool] = None,
1003
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1004
+ human: t.Optional[bool] = None,
1005
+ job_type: t.Optional[
1006
+ t.Union[str, t.Literal["access_control", "full", "incremental"]]
1007
+ ] = None,
1008
+ pretty: t.Optional[bool] = None,
1009
+ trigger_method: t.Optional[
1010
+ t.Union[str, t.Literal["on_demand", "scheduled"]]
1011
+ ] = None,
1012
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1013
+ ) -> ObjectApiResponse[t.Any]:
1014
+ """
1015
+ .. raw:: html
1016
+
1017
+ <p>Create a connector sync job.</p>
1018
+ <p>Create a connector sync job document in the internal index and initialize its counters and timestamps with default values.</p>
1019
+
1020
+
1021
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-post>`_
1022
+
1023
+ :param id: The id of the associated connector
1024
+ :param job_type:
1025
+ :param trigger_method:
1026
+ """
1027
+ if id is None and body is None:
1028
+ raise ValueError("Empty value passed for parameter 'id'")
1029
+ __path_parts: t.Dict[str, str] = {}
1030
+ __path = "/_connector/_sync_job"
1031
+ __query: t.Dict[str, t.Any] = {}
1032
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1033
+ if error_trace is not None:
1034
+ __query["error_trace"] = error_trace
1035
+ if filter_path is not None:
1036
+ __query["filter_path"] = filter_path
1037
+ if human is not None:
1038
+ __query["human"] = human
1039
+ if pretty is not None:
1040
+ __query["pretty"] = pretty
1041
+ if not __body:
1042
+ if id is not None:
1043
+ __body["id"] = id
1044
+ if job_type is not None:
1045
+ __body["job_type"] = job_type
1046
+ if trigger_method is not None:
1047
+ __body["trigger_method"] = trigger_method
1048
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1049
+ return await self.perform_request( # type: ignore[return-value]
1050
+ "POST",
1051
+ __path,
1052
+ params=__query,
1053
+ headers=__headers,
1054
+ body=__body,
1055
+ endpoint_id="connector.sync_job_post",
1056
+ path_parts=__path_parts,
1057
+ )
1058
+
1059
+ @_rewrite_parameters(
1060
+ body_fields=(
1061
+ "deleted_document_count",
1062
+ "indexed_document_count",
1063
+ "indexed_document_volume",
1064
+ "last_seen",
1065
+ "metadata",
1066
+ "total_document_count",
1067
+ ),
1068
+ )
1069
+ @_stability_warning(Stability.EXPERIMENTAL)
1070
+ async def sync_job_update_stats(
1071
+ self,
1072
+ *,
1073
+ connector_sync_job_id: str,
1074
+ deleted_document_count: t.Optional[int] = None,
1075
+ indexed_document_count: t.Optional[int] = None,
1076
+ indexed_document_volume: t.Optional[int] = None,
1077
+ error_trace: t.Optional[bool] = None,
1078
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1079
+ human: t.Optional[bool] = None,
1080
+ last_seen: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1081
+ metadata: t.Optional[t.Mapping[str, t.Any]] = None,
1082
+ pretty: t.Optional[bool] = None,
1083
+ total_document_count: t.Optional[int] = None,
1084
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1085
+ ) -> ObjectApiResponse[t.Any]:
1086
+ """
1087
+ .. raw:: html
1088
+
1089
+ <p>Set the connector sync job stats.
1090
+ Stats include: <code>deleted_document_count</code>, <code>indexed_document_count</code>, <code>indexed_document_volume</code>, and <code>total_document_count</code>.
1091
+ You can also update <code>last_seen</code>.
1092
+ This API is mainly used by the connector service for updating sync job information.</p>
1093
+ <p>To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
1094
+ This service runs automatically on Elastic Cloud for Elastic managed connectors.</p>
1095
+
1096
+
1097
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-sync-job-update-stats>`_
1098
+
1099
+ :param connector_sync_job_id: The unique identifier of the connector sync job.
1100
+ :param deleted_document_count: The number of documents the sync job deleted.
1101
+ :param indexed_document_count: The number of documents the sync job indexed.
1102
+ :param indexed_document_volume: The total size of the data (in MiB) the sync
1103
+ job indexed.
1104
+ :param last_seen: The timestamp to use in the `last_seen` property for the connector
1105
+ sync job.
1106
+ :param metadata: The connector-specific metadata.
1107
+ :param total_document_count: The total number of documents in the target index
1108
+ after the sync job finished.
1109
+ """
1110
+ if connector_sync_job_id in SKIP_IN_PATH:
1111
+ raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
1112
+ if deleted_document_count is None and body is None:
1113
+ raise ValueError(
1114
+ "Empty value passed for parameter 'deleted_document_count'"
1115
+ )
1116
+ if indexed_document_count is None and body is None:
1117
+ raise ValueError(
1118
+ "Empty value passed for parameter 'indexed_document_count'"
1119
+ )
1120
+ if indexed_document_volume is None and body is None:
1121
+ raise ValueError(
1122
+ "Empty value passed for parameter 'indexed_document_volume'"
1123
+ )
1124
+ __path_parts: t.Dict[str, str] = {
1125
+ "connector_sync_job_id": _quote(connector_sync_job_id)
1126
+ }
1127
+ __path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_stats'
1128
+ __query: t.Dict[str, t.Any] = {}
1129
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1130
+ if error_trace is not None:
1131
+ __query["error_trace"] = error_trace
1132
+ if filter_path is not None:
1133
+ __query["filter_path"] = filter_path
1134
+ if human is not None:
1135
+ __query["human"] = human
1136
+ if pretty is not None:
1137
+ __query["pretty"] = pretty
1138
+ if not __body:
1139
+ if deleted_document_count is not None:
1140
+ __body["deleted_document_count"] = deleted_document_count
1141
+ if indexed_document_count is not None:
1142
+ __body["indexed_document_count"] = indexed_document_count
1143
+ if indexed_document_volume is not None:
1144
+ __body["indexed_document_volume"] = indexed_document_volume
1145
+ if last_seen is not None:
1146
+ __body["last_seen"] = last_seen
1147
+ if metadata is not None:
1148
+ __body["metadata"] = metadata
1149
+ if total_document_count is not None:
1150
+ __body["total_document_count"] = total_document_count
1151
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1152
+ return await self.perform_request( # type: ignore[return-value]
1153
+ "PUT",
1154
+ __path,
1155
+ params=__query,
1156
+ headers=__headers,
1157
+ body=__body,
1158
+ endpoint_id="connector.sync_job_update_stats",
1159
+ path_parts=__path_parts,
1160
+ )
1161
+
1162
+ @_rewrite_parameters()
1163
+ @_stability_warning(Stability.EXPERIMENTAL)
1164
+ async def update_active_filtering(
1165
+ self,
1166
+ *,
1167
+ connector_id: str,
1168
+ error_trace: t.Optional[bool] = None,
1169
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1170
+ human: t.Optional[bool] = None,
1171
+ pretty: t.Optional[bool] = None,
1172
+ ) -> ObjectApiResponse[t.Any]:
1173
+ """
1174
+ .. raw:: html
1175
+
1176
+ <p>Activate the connector draft filter.</p>
1177
+ <p>Activates the valid draft filtering for a connector.</p>
1178
+
1179
+
1180
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-filtering>`_
1181
+
1182
+ :param connector_id: The unique identifier of the connector to be updated
1183
+ """
1184
+ if connector_id in SKIP_IN_PATH:
1185
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1186
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1187
+ __path = f'/_connector/{__path_parts["connector_id"]}/_filtering/_activate'
1188
+ __query: t.Dict[str, t.Any] = {}
1189
+ if error_trace is not None:
1190
+ __query["error_trace"] = error_trace
1191
+ if filter_path is not None:
1192
+ __query["filter_path"] = filter_path
1193
+ if human is not None:
1194
+ __query["human"] = human
1195
+ if pretty is not None:
1196
+ __query["pretty"] = pretty
1197
+ __headers = {"accept": "application/json"}
1198
+ return await self.perform_request( # type: ignore[return-value]
1199
+ "PUT",
1200
+ __path,
1201
+ params=__query,
1202
+ headers=__headers,
1203
+ endpoint_id="connector.update_active_filtering",
1204
+ path_parts=__path_parts,
1205
+ )
1206
+
1207
+ @_rewrite_parameters(
1208
+ body_fields=("api_key_id", "api_key_secret_id"),
1209
+ )
1210
+ @_stability_warning(Stability.BETA)
1211
+ async def update_api_key_id(
1212
+ self,
1213
+ *,
1214
+ connector_id: str,
1215
+ api_key_id: t.Optional[str] = None,
1216
+ api_key_secret_id: t.Optional[str] = None,
1217
+ error_trace: t.Optional[bool] = None,
1218
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1219
+ human: t.Optional[bool] = None,
1220
+ pretty: t.Optional[bool] = None,
1221
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1222
+ ) -> ObjectApiResponse[t.Any]:
1223
+ """
1224
+ .. raw:: html
1225
+
1226
+ <p>Update the connector API key ID.</p>
1227
+ <p>Update the <code>api_key_id</code> and <code>api_key_secret_id</code> fields of a connector.
1228
+ You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored.
1229
+ The connector secret ID is required only for Elastic managed (native) connectors.
1230
+ Self-managed connectors (connector clients) do not use this field.</p>
1231
+
1232
+
1233
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-api-key-id>`_
1234
+
1235
+ :param connector_id: The unique identifier of the connector to be updated
1236
+ :param api_key_id:
1237
+ :param api_key_secret_id:
1238
+ """
1239
+ if connector_id in SKIP_IN_PATH:
1240
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1241
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1242
+ __path = f'/_connector/{__path_parts["connector_id"]}/_api_key_id'
1243
+ __query: t.Dict[str, t.Any] = {}
1244
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1245
+ if error_trace is not None:
1246
+ __query["error_trace"] = error_trace
1247
+ if filter_path is not None:
1248
+ __query["filter_path"] = filter_path
1249
+ if human is not None:
1250
+ __query["human"] = human
1251
+ if pretty is not None:
1252
+ __query["pretty"] = pretty
1253
+ if not __body:
1254
+ if api_key_id is not None:
1255
+ __body["api_key_id"] = api_key_id
1256
+ if api_key_secret_id is not None:
1257
+ __body["api_key_secret_id"] = api_key_secret_id
1258
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1259
+ return await self.perform_request( # type: ignore[return-value]
1260
+ "PUT",
1261
+ __path,
1262
+ params=__query,
1263
+ headers=__headers,
1264
+ body=__body,
1265
+ endpoint_id="connector.update_api_key_id",
1266
+ path_parts=__path_parts,
1267
+ )
1268
+
1269
+ @_rewrite_parameters(
1270
+ body_fields=("configuration", "values"),
1271
+ )
1272
+ @_stability_warning(Stability.BETA)
1273
+ async def update_configuration(
1274
+ self,
1275
+ *,
1276
+ connector_id: str,
1277
+ configuration: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
1278
+ error_trace: t.Optional[bool] = None,
1279
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1280
+ human: t.Optional[bool] = None,
1281
+ pretty: t.Optional[bool] = None,
1282
+ values: t.Optional[t.Mapping[str, t.Any]] = None,
1283
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1284
+ ) -> ObjectApiResponse[t.Any]:
1285
+ """
1286
+ .. raw:: html
1287
+
1288
+ <p>Update the connector configuration.</p>
1289
+ <p>Update the configuration field in the connector document.</p>
1290
+
1291
+
1292
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-configuration>`_
1293
+
1294
+ :param connector_id: The unique identifier of the connector to be updated
1295
+ :param configuration:
1296
+ :param values:
1297
+ """
1298
+ if connector_id in SKIP_IN_PATH:
1299
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1300
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1301
+ __path = f'/_connector/{__path_parts["connector_id"]}/_configuration'
1302
+ __query: t.Dict[str, t.Any] = {}
1303
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1304
+ if error_trace is not None:
1305
+ __query["error_trace"] = error_trace
1306
+ if filter_path is not None:
1307
+ __query["filter_path"] = filter_path
1308
+ if human is not None:
1309
+ __query["human"] = human
1310
+ if pretty is not None:
1311
+ __query["pretty"] = pretty
1312
+ if not __body:
1313
+ if configuration is not None:
1314
+ __body["configuration"] = configuration
1315
+ if values is not None:
1316
+ __body["values"] = values
1317
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1318
+ return await self.perform_request( # type: ignore[return-value]
1319
+ "PUT",
1320
+ __path,
1321
+ params=__query,
1322
+ headers=__headers,
1323
+ body=__body,
1324
+ endpoint_id="connector.update_configuration",
1325
+ path_parts=__path_parts,
1326
+ )
1327
+
1328
+ @_rewrite_parameters(
1329
+ body_fields=("error",),
1330
+ )
1331
+ @_stability_warning(Stability.EXPERIMENTAL)
1332
+ async def update_error(
1333
+ self,
1334
+ *,
1335
+ connector_id: str,
1336
+ error: t.Optional[t.Union[None, t.Any]] = None,
1337
+ error_trace: t.Optional[bool] = None,
1338
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1339
+ human: t.Optional[bool] = None,
1340
+ pretty: t.Optional[bool] = None,
1341
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1342
+ ) -> ObjectApiResponse[t.Any]:
1343
+ """
1344
+ .. raw:: html
1345
+
1346
+ <p>Update the connector error field.</p>
1347
+ <p>Set the error field for the connector.
1348
+ If the error provided in the request body is non-null, the connector’s status is updated to error.
1349
+ Otherwise, if the error is reset to null, the connector status is updated to connected.</p>
1350
+
1351
+
1352
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-error>`_
1353
+
1354
+ :param connector_id: The unique identifier of the connector to be updated
1355
+ :param error:
1356
+ """
1357
+ if connector_id in SKIP_IN_PATH:
1358
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1359
+ if error is None and body is None:
1360
+ raise ValueError("Empty value passed for parameter 'error'")
1361
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1362
+ __path = f'/_connector/{__path_parts["connector_id"]}/_error'
1363
+ __query: t.Dict[str, t.Any] = {}
1364
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1365
+ if error_trace is not None:
1366
+ __query["error_trace"] = error_trace
1367
+ if filter_path is not None:
1368
+ __query["filter_path"] = filter_path
1369
+ if human is not None:
1370
+ __query["human"] = human
1371
+ if pretty is not None:
1372
+ __query["pretty"] = pretty
1373
+ if not __body:
1374
+ if error is not None:
1375
+ __body["error"] = error
1376
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1377
+ return await self.perform_request( # type: ignore[return-value]
1378
+ "PUT",
1379
+ __path,
1380
+ params=__query,
1381
+ headers=__headers,
1382
+ body=__body,
1383
+ endpoint_id="connector.update_error",
1384
+ path_parts=__path_parts,
1385
+ )
1386
+
1387
+ @_rewrite_parameters(
1388
+ body_fields=("features",),
1389
+ )
1390
+ @_stability_warning(Stability.EXPERIMENTAL)
1391
+ async def update_features(
1392
+ self,
1393
+ *,
1394
+ connector_id: str,
1395
+ features: t.Optional[t.Mapping[str, t.Any]] = None,
1396
+ error_trace: t.Optional[bool] = None,
1397
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1398
+ human: t.Optional[bool] = None,
1399
+ pretty: t.Optional[bool] = None,
1400
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1401
+ ) -> ObjectApiResponse[t.Any]:
1402
+ """
1403
+ .. raw:: html
1404
+
1405
+ <p>Update the connector features.
1406
+ Update the connector features in the connector document.
1407
+ This API can be used to control the following aspects of a connector:</p>
1408
+ <ul>
1409
+ <li>document-level security</li>
1410
+ <li>incremental syncs</li>
1411
+ <li>advanced sync rules</li>
1412
+ <li>basic sync rules</li>
1413
+ </ul>
1414
+ <p>Normally, the running connector service automatically manages these features.
1415
+ However, you can use this API to override the default behavior.</p>
1416
+ <p>To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.
1417
+ This service runs automatically on Elastic Cloud for Elastic managed connectors.</p>
1418
+
1419
+
1420
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-features>`_
1421
+
1422
+ :param connector_id: The unique identifier of the connector to be updated.
1423
+ :param features:
1424
+ """
1425
+ if connector_id in SKIP_IN_PATH:
1426
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1427
+ if features is None and body is None:
1428
+ raise ValueError("Empty value passed for parameter 'features'")
1429
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1430
+ __path = f'/_connector/{__path_parts["connector_id"]}/_features'
1431
+ __query: t.Dict[str, t.Any] = {}
1432
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1433
+ if error_trace is not None:
1434
+ __query["error_trace"] = error_trace
1435
+ if filter_path is not None:
1436
+ __query["filter_path"] = filter_path
1437
+ if human is not None:
1438
+ __query["human"] = human
1439
+ if pretty is not None:
1440
+ __query["pretty"] = pretty
1441
+ if not __body:
1442
+ if features is not None:
1443
+ __body["features"] = features
1444
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1445
+ return await self.perform_request( # type: ignore[return-value]
1446
+ "PUT",
1447
+ __path,
1448
+ params=__query,
1449
+ headers=__headers,
1450
+ body=__body,
1451
+ endpoint_id="connector.update_features",
1452
+ path_parts=__path_parts,
1453
+ )
1454
+
1455
+ @_rewrite_parameters(
1456
+ body_fields=("advanced_snippet", "filtering", "rules"),
1457
+ )
1458
+ @_stability_warning(Stability.BETA)
1459
+ async def update_filtering(
1460
+ self,
1461
+ *,
1462
+ connector_id: str,
1463
+ advanced_snippet: t.Optional[t.Mapping[str, t.Any]] = None,
1464
+ error_trace: t.Optional[bool] = None,
1465
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1466
+ filtering: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
1467
+ human: t.Optional[bool] = None,
1468
+ pretty: t.Optional[bool] = None,
1469
+ rules: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None,
1470
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1471
+ ) -> ObjectApiResponse[t.Any]:
1472
+ """
1473
+ .. raw:: html
1474
+
1475
+ <p>Update the connector filtering.</p>
1476
+ <p>Update the draft filtering configuration of a connector and marks the draft validation state as edited.
1477
+ The filtering draft is activated once validated by the running Elastic connector service.
1478
+ The filtering property is used to configure sync rules (both basic and advanced) for a connector.</p>
1479
+
1480
+
1481
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-filtering>`_
1482
+
1483
+ :param connector_id: The unique identifier of the connector to be updated
1484
+ :param advanced_snippet:
1485
+ :param filtering:
1486
+ :param rules:
1487
+ """
1488
+ if connector_id in SKIP_IN_PATH:
1489
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1490
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1491
+ __path = f'/_connector/{__path_parts["connector_id"]}/_filtering'
1492
+ __query: t.Dict[str, t.Any] = {}
1493
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1494
+ if error_trace is not None:
1495
+ __query["error_trace"] = error_trace
1496
+ if filter_path is not None:
1497
+ __query["filter_path"] = filter_path
1498
+ if human is not None:
1499
+ __query["human"] = human
1500
+ if pretty is not None:
1501
+ __query["pretty"] = pretty
1502
+ if not __body:
1503
+ if advanced_snippet is not None:
1504
+ __body["advanced_snippet"] = advanced_snippet
1505
+ if filtering is not None:
1506
+ __body["filtering"] = filtering
1507
+ if rules is not None:
1508
+ __body["rules"] = rules
1509
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1510
+ return await self.perform_request( # type: ignore[return-value]
1511
+ "PUT",
1512
+ __path,
1513
+ params=__query,
1514
+ headers=__headers,
1515
+ body=__body,
1516
+ endpoint_id="connector.update_filtering",
1517
+ path_parts=__path_parts,
1518
+ )
1519
+
1520
+ @_rewrite_parameters(
1521
+ body_fields=("validation",),
1522
+ )
1523
+ @_stability_warning(Stability.EXPERIMENTAL)
1524
+ async def update_filtering_validation(
1525
+ self,
1526
+ *,
1527
+ connector_id: str,
1528
+ validation: t.Optional[t.Mapping[str, t.Any]] = None,
1529
+ error_trace: t.Optional[bool] = None,
1530
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1531
+ human: t.Optional[bool] = None,
1532
+ pretty: t.Optional[bool] = None,
1533
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1534
+ ) -> ObjectApiResponse[t.Any]:
1535
+ """
1536
+ .. raw:: html
1537
+
1538
+ <p>Update the connector draft filtering validation.</p>
1539
+ <p>Update the draft filtering validation info for a connector.</p>
1540
+
1541
+
1542
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-filtering-validation>`_
1543
+
1544
+ :param connector_id: The unique identifier of the connector to be updated
1545
+ :param validation:
1546
+ """
1547
+ if connector_id in SKIP_IN_PATH:
1548
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1549
+ if validation is None and body is None:
1550
+ raise ValueError("Empty value passed for parameter 'validation'")
1551
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1552
+ __path = f'/_connector/{__path_parts["connector_id"]}/_filtering/_validation'
1553
+ __query: t.Dict[str, t.Any] = {}
1554
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1555
+ if error_trace is not None:
1556
+ __query["error_trace"] = error_trace
1557
+ if filter_path is not None:
1558
+ __query["filter_path"] = filter_path
1559
+ if human is not None:
1560
+ __query["human"] = human
1561
+ if pretty is not None:
1562
+ __query["pretty"] = pretty
1563
+ if not __body:
1564
+ if validation is not None:
1565
+ __body["validation"] = validation
1566
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1567
+ return await self.perform_request( # type: ignore[return-value]
1568
+ "PUT",
1569
+ __path,
1570
+ params=__query,
1571
+ headers=__headers,
1572
+ body=__body,
1573
+ endpoint_id="connector.update_filtering_validation",
1574
+ path_parts=__path_parts,
1575
+ )
1576
+
1577
+ @_rewrite_parameters(
1578
+ body_fields=("index_name",),
1579
+ )
1580
+ @_stability_warning(Stability.BETA)
1581
+ async def update_index_name(
1582
+ self,
1583
+ *,
1584
+ connector_id: str,
1585
+ index_name: t.Optional[t.Union[None, t.Any]] = None,
1586
+ error_trace: t.Optional[bool] = None,
1587
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1588
+ human: t.Optional[bool] = None,
1589
+ pretty: t.Optional[bool] = None,
1590
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1591
+ ) -> ObjectApiResponse[t.Any]:
1592
+ """
1593
+ .. raw:: html
1594
+
1595
+ <p>Update the connector index name.</p>
1596
+ <p>Update the <code>index_name</code> field of a connector, specifying the index where the data ingested by the connector is stored.</p>
1597
+
1598
+
1599
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-index-name>`_
1600
+
1601
+ :param connector_id: The unique identifier of the connector to be updated
1602
+ :param index_name:
1603
+ """
1604
+ if connector_id in SKIP_IN_PATH:
1605
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1606
+ if index_name is None and body is None:
1607
+ raise ValueError("Empty value passed for parameter 'index_name'")
1608
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1609
+ __path = f'/_connector/{__path_parts["connector_id"]}/_index_name'
1610
+ __query: t.Dict[str, t.Any] = {}
1611
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1612
+ if error_trace is not None:
1613
+ __query["error_trace"] = error_trace
1614
+ if filter_path is not None:
1615
+ __query["filter_path"] = filter_path
1616
+ if human is not None:
1617
+ __query["human"] = human
1618
+ if pretty is not None:
1619
+ __query["pretty"] = pretty
1620
+ if not __body:
1621
+ if index_name is not None:
1622
+ __body["index_name"] = index_name
1623
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1624
+ return await self.perform_request( # type: ignore[return-value]
1625
+ "PUT",
1626
+ __path,
1627
+ params=__query,
1628
+ headers=__headers,
1629
+ body=__body,
1630
+ endpoint_id="connector.update_index_name",
1631
+ path_parts=__path_parts,
1632
+ )
1633
+
1634
+ @_rewrite_parameters(
1635
+ body_fields=("description", "name"),
1636
+ )
1637
+ @_stability_warning(Stability.BETA)
1638
+ async def update_name(
1639
+ self,
1640
+ *,
1641
+ connector_id: str,
1642
+ description: t.Optional[str] = None,
1643
+ error_trace: t.Optional[bool] = None,
1644
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1645
+ human: t.Optional[bool] = None,
1646
+ name: t.Optional[str] = None,
1647
+ pretty: t.Optional[bool] = None,
1648
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1649
+ ) -> ObjectApiResponse[t.Any]:
1650
+ """
1651
+ .. raw:: html
1652
+
1653
+ <p>Update the connector name and description.</p>
1654
+
1655
+
1656
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-name>`_
1657
+
1658
+ :param connector_id: The unique identifier of the connector to be updated
1659
+ :param description:
1660
+ :param name:
1661
+ """
1662
+ if connector_id in SKIP_IN_PATH:
1663
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1664
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1665
+ __path = f'/_connector/{__path_parts["connector_id"]}/_name'
1666
+ __query: t.Dict[str, t.Any] = {}
1667
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1668
+ if error_trace is not None:
1669
+ __query["error_trace"] = error_trace
1670
+ if filter_path is not None:
1671
+ __query["filter_path"] = filter_path
1672
+ if human is not None:
1673
+ __query["human"] = human
1674
+ if pretty is not None:
1675
+ __query["pretty"] = pretty
1676
+ if not __body:
1677
+ if description is not None:
1678
+ __body["description"] = description
1679
+ if name is not None:
1680
+ __body["name"] = name
1681
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1682
+ return await self.perform_request( # type: ignore[return-value]
1683
+ "PUT",
1684
+ __path,
1685
+ params=__query,
1686
+ headers=__headers,
1687
+ body=__body,
1688
+ endpoint_id="connector.update_name",
1689
+ path_parts=__path_parts,
1690
+ )
1691
+
1692
+ @_rewrite_parameters(
1693
+ body_fields=("is_native",),
1694
+ )
1695
+ @_stability_warning(Stability.BETA)
1696
+ async def update_native(
1697
+ self,
1698
+ *,
1699
+ connector_id: str,
1700
+ is_native: t.Optional[bool] = None,
1701
+ error_trace: t.Optional[bool] = None,
1702
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1703
+ human: t.Optional[bool] = None,
1704
+ pretty: t.Optional[bool] = None,
1705
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1706
+ ) -> ObjectApiResponse[t.Any]:
1707
+ """
1708
+ .. raw:: html
1709
+
1710
+ <p>Update the connector is_native flag.</p>
1711
+
1712
+
1713
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-native>`_
1714
+
1715
+ :param connector_id: The unique identifier of the connector to be updated
1716
+ :param is_native:
1717
+ """
1718
+ if connector_id in SKIP_IN_PATH:
1719
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1720
+ if is_native is None and body is None:
1721
+ raise ValueError("Empty value passed for parameter 'is_native'")
1722
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1723
+ __path = f'/_connector/{__path_parts["connector_id"]}/_native'
1724
+ __query: t.Dict[str, t.Any] = {}
1725
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1726
+ if error_trace is not None:
1727
+ __query["error_trace"] = error_trace
1728
+ if filter_path is not None:
1729
+ __query["filter_path"] = filter_path
1730
+ if human is not None:
1731
+ __query["human"] = human
1732
+ if pretty is not None:
1733
+ __query["pretty"] = pretty
1734
+ if not __body:
1735
+ if is_native is not None:
1736
+ __body["is_native"] = is_native
1737
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1738
+ return await self.perform_request( # type: ignore[return-value]
1739
+ "PUT",
1740
+ __path,
1741
+ params=__query,
1742
+ headers=__headers,
1743
+ body=__body,
1744
+ endpoint_id="connector.update_native",
1745
+ path_parts=__path_parts,
1746
+ )
1747
+
1748
+ @_rewrite_parameters(
1749
+ body_fields=("pipeline",),
1750
+ )
1751
+ @_stability_warning(Stability.BETA)
1752
+ async def update_pipeline(
1753
+ self,
1754
+ *,
1755
+ connector_id: str,
1756
+ pipeline: t.Optional[t.Mapping[str, t.Any]] = None,
1757
+ error_trace: t.Optional[bool] = None,
1758
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1759
+ human: t.Optional[bool] = None,
1760
+ pretty: t.Optional[bool] = None,
1761
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1762
+ ) -> ObjectApiResponse[t.Any]:
1763
+ """
1764
+ .. raw:: html
1765
+
1766
+ <p>Update the connector pipeline.</p>
1767
+ <p>When you create a new connector, the configuration of an ingest pipeline is populated with default settings.</p>
1768
+
1769
+
1770
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-pipeline>`_
1771
+
1772
+ :param connector_id: The unique identifier of the connector to be updated
1773
+ :param pipeline:
1774
+ """
1775
+ if connector_id in SKIP_IN_PATH:
1776
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1777
+ if pipeline is None and body is None:
1778
+ raise ValueError("Empty value passed for parameter 'pipeline'")
1779
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1780
+ __path = f'/_connector/{__path_parts["connector_id"]}/_pipeline'
1781
+ __query: t.Dict[str, t.Any] = {}
1782
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1783
+ if error_trace is not None:
1784
+ __query["error_trace"] = error_trace
1785
+ if filter_path is not None:
1786
+ __query["filter_path"] = filter_path
1787
+ if human is not None:
1788
+ __query["human"] = human
1789
+ if pretty is not None:
1790
+ __query["pretty"] = pretty
1791
+ if not __body:
1792
+ if pipeline is not None:
1793
+ __body["pipeline"] = pipeline
1794
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1795
+ return await self.perform_request( # type: ignore[return-value]
1796
+ "PUT",
1797
+ __path,
1798
+ params=__query,
1799
+ headers=__headers,
1800
+ body=__body,
1801
+ endpoint_id="connector.update_pipeline",
1802
+ path_parts=__path_parts,
1803
+ )
1804
+
1805
+ @_rewrite_parameters(
1806
+ body_fields=("scheduling",),
1807
+ )
1808
+ @_stability_warning(Stability.BETA)
1809
+ async def update_scheduling(
1810
+ self,
1811
+ *,
1812
+ connector_id: str,
1813
+ scheduling: t.Optional[t.Mapping[str, t.Any]] = None,
1814
+ error_trace: t.Optional[bool] = None,
1815
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1816
+ human: t.Optional[bool] = None,
1817
+ pretty: t.Optional[bool] = None,
1818
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1819
+ ) -> ObjectApiResponse[t.Any]:
1820
+ """
1821
+ .. raw:: html
1822
+
1823
+ <p>Update the connector scheduling.</p>
1824
+
1825
+
1826
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-scheduling>`_
1827
+
1828
+ :param connector_id: The unique identifier of the connector to be updated
1829
+ :param scheduling:
1830
+ """
1831
+ if connector_id in SKIP_IN_PATH:
1832
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1833
+ if scheduling is None and body is None:
1834
+ raise ValueError("Empty value passed for parameter 'scheduling'")
1835
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1836
+ __path = f'/_connector/{__path_parts["connector_id"]}/_scheduling'
1837
+ __query: t.Dict[str, t.Any] = {}
1838
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1839
+ if error_trace is not None:
1840
+ __query["error_trace"] = error_trace
1841
+ if filter_path is not None:
1842
+ __query["filter_path"] = filter_path
1843
+ if human is not None:
1844
+ __query["human"] = human
1845
+ if pretty is not None:
1846
+ __query["pretty"] = pretty
1847
+ if not __body:
1848
+ if scheduling is not None:
1849
+ __body["scheduling"] = scheduling
1850
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1851
+ return await self.perform_request( # type: ignore[return-value]
1852
+ "PUT",
1853
+ __path,
1854
+ params=__query,
1855
+ headers=__headers,
1856
+ body=__body,
1857
+ endpoint_id="connector.update_scheduling",
1858
+ path_parts=__path_parts,
1859
+ )
1860
+
1861
+ @_rewrite_parameters(
1862
+ body_fields=("service_type",),
1863
+ )
1864
+ @_stability_warning(Stability.BETA)
1865
+ async def update_service_type(
1866
+ self,
1867
+ *,
1868
+ connector_id: str,
1869
+ service_type: t.Optional[str] = None,
1870
+ error_trace: t.Optional[bool] = None,
1871
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1872
+ human: t.Optional[bool] = None,
1873
+ pretty: t.Optional[bool] = None,
1874
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1875
+ ) -> ObjectApiResponse[t.Any]:
1876
+ """
1877
+ .. raw:: html
1878
+
1879
+ <p>Update the connector service type.</p>
1880
+
1881
+
1882
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-service-type>`_
1883
+
1884
+ :param connector_id: The unique identifier of the connector to be updated
1885
+ :param service_type:
1886
+ """
1887
+ if connector_id in SKIP_IN_PATH:
1888
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1889
+ if service_type is None and body is None:
1890
+ raise ValueError("Empty value passed for parameter 'service_type'")
1891
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1892
+ __path = f'/_connector/{__path_parts["connector_id"]}/_service_type'
1893
+ __query: t.Dict[str, t.Any] = {}
1894
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1895
+ if error_trace is not None:
1896
+ __query["error_trace"] = error_trace
1897
+ if filter_path is not None:
1898
+ __query["filter_path"] = filter_path
1899
+ if human is not None:
1900
+ __query["human"] = human
1901
+ if pretty is not None:
1902
+ __query["pretty"] = pretty
1903
+ if not __body:
1904
+ if service_type is not None:
1905
+ __body["service_type"] = service_type
1906
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1907
+ return await self.perform_request( # type: ignore[return-value]
1908
+ "PUT",
1909
+ __path,
1910
+ params=__query,
1911
+ headers=__headers,
1912
+ body=__body,
1913
+ endpoint_id="connector.update_service_type",
1914
+ path_parts=__path_parts,
1915
+ )
1916
+
1917
+ @_rewrite_parameters(
1918
+ body_fields=("status",),
1919
+ )
1920
+ @_stability_warning(Stability.EXPERIMENTAL)
1921
+ async def update_status(
1922
+ self,
1923
+ *,
1924
+ connector_id: str,
1925
+ status: t.Optional[
1926
+ t.Union[
1927
+ str,
1928
+ t.Literal[
1929
+ "configured", "connected", "created", "error", "needs_configuration"
1930
+ ],
1931
+ ]
1932
+ ] = None,
1933
+ error_trace: t.Optional[bool] = None,
1934
+ filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1935
+ human: t.Optional[bool] = None,
1936
+ pretty: t.Optional[bool] = None,
1937
+ body: t.Optional[t.Dict[str, t.Any]] = None,
1938
+ ) -> ObjectApiResponse[t.Any]:
1939
+ """
1940
+ .. raw:: html
1941
+
1942
+ <p>Update the connector status.</p>
1943
+
1944
+
1945
+ `<https://www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-connector-update-status>`_
1946
+
1947
+ :param connector_id: The unique identifier of the connector to be updated
1948
+ :param status:
1949
+ """
1950
+ if connector_id in SKIP_IN_PATH:
1951
+ raise ValueError("Empty value passed for parameter 'connector_id'")
1952
+ if status is None and body is None:
1953
+ raise ValueError("Empty value passed for parameter 'status'")
1954
+ __path_parts: t.Dict[str, str] = {"connector_id": _quote(connector_id)}
1955
+ __path = f'/_connector/{__path_parts["connector_id"]}/_status'
1956
+ __query: t.Dict[str, t.Any] = {}
1957
+ __body: t.Dict[str, t.Any] = body if body is not None else {}
1958
+ if error_trace is not None:
1959
+ __query["error_trace"] = error_trace
1960
+ if filter_path is not None:
1961
+ __query["filter_path"] = filter_path
1962
+ if human is not None:
1963
+ __query["human"] = human
1964
+ if pretty is not None:
1965
+ __query["pretty"] = pretty
1966
+ if not __body:
1967
+ if status is not None:
1968
+ __body["status"] = status
1969
+ __headers = {"accept": "application/json", "content-type": "application/json"}
1970
+ return await self.perform_request( # type: ignore[return-value]
1971
+ "PUT",
1972
+ __path,
1973
+ params=__query,
1974
+ headers=__headers,
1975
+ body=__body,
1976
+ endpoint_id="connector.update_status",
1977
+ path_parts=__path_parts,
1978
+ )