Skip to content

Commit 275d9c3

Browse files
authored
Regenerate API from latest spec (#14)
1 parent 215b54e commit 275d9c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4446
-3308
lines changed

elasticsearch_serverless/_async/client/__init__.py

Lines changed: 859 additions & 386 deletions
Large diffs are not rendered by default.

elasticsearch_serverless/_async/client/async_search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def delete(
4040
Deletes an async search by ID. If the search is still running, the search request
4141
will be cancelled. Otherwise, the saved search results are deleted.
4242
43-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/async-search.html>`_
43+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
4444
4545
:param id: A unique identifier for the async search.
4646
"""
@@ -82,7 +82,7 @@ async def get(
8282
Retrieves the results of a previously submitted async search request given its
8383
ID.
8484
85-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/async-search.html>`_
85+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
8686
8787
:param id: A unique identifier for the async search.
8888
:param keep_alive: Specifies how long the async search should be available in
@@ -139,7 +139,7 @@ async def status(
139139
Retrieves the status of a previously submitted async search request given its
140140
ID.
141141
142-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/async-search.html>`_
142+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
143143
144144
:param id: A unique identifier for the async search.
145145
"""
@@ -310,7 +310,7 @@ async def submit(
310310
"""
311311
Executes a search request asynchronously.
312312
313-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/async-search.html>`_
313+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/async-search.html>`_
314314
315315
:param index: A comma-separated list of index names to search; use `_all` or
316316
empty string to perform the operation on all indices

elasticsearch_serverless/_async/client/cat.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def aliases(
6767
Shows information about currently configured aliases to indices including filter
6868
and routing infos.
6969
70-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-alias.html>`_
70+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html>`_
7171
7272
:param name: A comma-separated list of aliases to retrieve. Supports wildcards
7373
(`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`.
@@ -146,7 +146,7 @@ async def component_templates(
146146
"""
147147
Returns information about existing component_templates templates.
148148
149-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-component-templates.html>`_
149+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-component-templates.html>`_
150150
151151
:param name: The name of the component template. Accepts wildcard expressions.
152152
If omitted, all component templates are returned.
@@ -222,7 +222,7 @@ async def count(
222222
Provides quick access to the document count of the entire cluster, or individual
223223
indices.
224224
225-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-count.html>`_
225+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html>`_
226226
227227
:param index: Comma-separated list of data streams, indices, and aliases used
228228
to limit the request. Supports wildcards (`*`). To target all data streams
@@ -297,7 +297,7 @@ async def help(
297297
"""
298298
Returns help for the Cat APIs.
299299
300-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat.html>`_
300+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html>`_
301301
302302
:param format: Specifies the format to return the columnar data in, can be set
303303
to `text`, `json`, `cbor`, `yaml`, or `smile`.
@@ -395,7 +395,7 @@ async def indices(
395395
Returns information about indices: number of primaries and replicas, document
396396
counts, disk size, ...
397397
398-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-indices.html>`_
398+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html>`_
399399
400400
:param index: Comma-separated list of data streams, indices, and aliases used
401401
to limit the request. Supports wildcards (`*`). To target all data streams
@@ -540,7 +540,7 @@ async def ml_data_frame_analytics(
540540
"""
541541
Gets configuration and usage information about data frame analytics jobs.
542542
543-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-dfanalytics.html>`_
543+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-dfanalytics.html>`_
544544
545545
:param id: The ID of the data frame analytics to fetch
546546
:param allow_no_match: Whether to ignore if a wildcard expression matches no
@@ -671,7 +671,7 @@ async def ml_datafeeds(
671671
"""
672672
Gets configuration and usage information about datafeeds.
673673
674-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-datafeeds.html>`_
674+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-datafeeds.html>`_
675675
676676
:param datafeed_id: A numerical character string that uniquely identifies the
677677
datafeed.
@@ -808,7 +808,7 @@ async def ml_jobs(
808808
"""
809809
Gets configuration and usage information about anomaly detection jobs.
810810
811-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-anomaly-detectors.html>`_
811+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-anomaly-detectors.html>`_
812812
813813
:param job_id: Identifier for the anomaly detection job.
814814
:param allow_no_match: Specifies what to do when the request: * Contains wildcard
@@ -948,7 +948,7 @@ async def ml_trained_models(
948948
"""
949949
Gets configuration and usage information about inference trained models.
950950
951-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-trained-model.html>`_
951+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-trained-model.html>`_
952952
953953
:param model_id: A unique identifier for the trained model.
954954
:param allow_no_match: Specifies what to do when the request: contains wildcard
@@ -1091,7 +1091,7 @@ async def transforms(
10911091
"""
10921092
Gets configuration and usage information about transforms.
10931093
1094-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cat-transforms.html>`_
1094+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-transforms.html>`_
10951095
10961096
:param transform_id: A transform identifier or a wildcard expression. If you
10971097
do not specify one of these options, the API returns information for all

elasticsearch_serverless/_async/client/cluster.py

Lines changed: 5 additions & 213 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def delete_component_template(
4343
"""
4444
Deletes a component template
4545
46-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/indices-component-template.html>`_
46+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
4747
4848
:param name: Comma-separated list or wildcard expression of component template
4949
names used to limit the request.
@@ -93,7 +93,7 @@ async def exists_component_template(
9393
"""
9494
Returns information about whether a particular component template exist
9595
96-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/indices-component-template.html>`_
96+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
9797
9898
:param name: Comma-separated list of component template names used to limit the
9999
request. Wildcard (*) expressions are supported.
@@ -146,7 +146,7 @@ async def get_component_template(
146146
"""
147147
Returns one or more component templates
148148
149-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/indices-component-template.html>`_
149+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
150150
151151
:param name: Comma-separated list of component template names used to limit the
152152
request. Wildcard (`*`) expressions are supported.
@@ -185,60 +185,6 @@ async def get_component_template(
185185
"GET", __path, params=__query, headers=__headers
186186
)
187187

188-
@_rewrite_parameters()
189-
async def get_settings(
190-
self,
191-
*,
192-
error_trace: t.Optional[bool] = None,
193-
filter_path: t.Optional[
194-
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
195-
] = None,
196-
flat_settings: t.Optional[bool] = None,
197-
human: t.Optional[bool] = None,
198-
include_defaults: t.Optional[bool] = None,
199-
master_timeout: t.Optional[
200-
t.Union["t.Literal[-1]", "t.Literal[0]", str]
201-
] = None,
202-
pretty: t.Optional[bool] = None,
203-
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
204-
) -> ObjectApiResponse[t.Any]:
205-
"""
206-
Returns cluster settings.
207-
208-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cluster-get-settings.html>`_
209-
210-
:param flat_settings: If `true`, returns settings in flat format.
211-
:param include_defaults: If `true`, returns default cluster settings from the
212-
local node.
213-
:param master_timeout: Period to wait for a connection to the master node. If
214-
no response is received before the timeout expires, the request fails and
215-
returns an error.
216-
:param timeout: Period to wait for a response. If no response is received before
217-
the timeout expires, the request fails and returns an error.
218-
"""
219-
__path = "/_cluster/settings"
220-
__query: t.Dict[str, t.Any] = {}
221-
if error_trace is not None:
222-
__query["error_trace"] = error_trace
223-
if filter_path is not None:
224-
__query["filter_path"] = filter_path
225-
if flat_settings is not None:
226-
__query["flat_settings"] = flat_settings
227-
if human is not None:
228-
__query["human"] = human
229-
if include_defaults is not None:
230-
__query["include_defaults"] = include_defaults
231-
if master_timeout is not None:
232-
__query["master_timeout"] = master_timeout
233-
if pretty is not None:
234-
__query["pretty"] = pretty
235-
if timeout is not None:
236-
__query["timeout"] = timeout
237-
__headers = {"accept": "application/json"}
238-
return await self.perform_request( # type: ignore[return-value]
239-
"GET", __path, params=__query, headers=__headers
240-
)
241-
242188
@_rewrite_parameters()
243189
async def info(
244190
self,
@@ -273,7 +219,7 @@ async def info(
273219
"""
274220
Returns different information about the cluster.
275221
276-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cluster-info.html>`_
222+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html>`_
277223
278224
:param target: Limits the information returned to the specific target. Supports
279225
a comma-separated list, such as http,ingest.
@@ -295,52 +241,6 @@ async def info(
295241
"GET", __path, params=__query, headers=__headers
296242
)
297243

298-
@_rewrite_parameters()
299-
async def pending_tasks(
300-
self,
301-
*,
302-
error_trace: t.Optional[bool] = None,
303-
filter_path: t.Optional[
304-
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
305-
] = None,
306-
human: t.Optional[bool] = None,
307-
local: t.Optional[bool] = None,
308-
master_timeout: t.Optional[
309-
t.Union["t.Literal[-1]", "t.Literal[0]", str]
310-
] = None,
311-
pretty: t.Optional[bool] = None,
312-
) -> ObjectApiResponse[t.Any]:
313-
"""
314-
Returns a list of any cluster-level changes (e.g. create index, update mapping,
315-
allocate or fail shard) which have not yet been executed.
316-
317-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cluster-pending.html>`_
318-
319-
:param local: If `true`, the request retrieves information from the local node
320-
only. If `false`, information is retrieved from the master node.
321-
:param master_timeout: Period to wait for a connection to the master node. If
322-
no response is received before the timeout expires, the request fails and
323-
returns an error.
324-
"""
325-
__path = "/_cluster/pending_tasks"
326-
__query: t.Dict[str, t.Any] = {}
327-
if error_trace is not None:
328-
__query["error_trace"] = error_trace
329-
if filter_path is not None:
330-
__query["filter_path"] = filter_path
331-
if human is not None:
332-
__query["human"] = human
333-
if local is not None:
334-
__query["local"] = local
335-
if master_timeout is not None:
336-
__query["master_timeout"] = master_timeout
337-
if pretty is not None:
338-
__query["pretty"] = pretty
339-
__headers = {"accept": "application/json"}
340-
return await self.perform_request( # type: ignore[return-value]
341-
"GET", __path, params=__query, headers=__headers
342-
)
343-
344244
@_rewrite_parameters(
345245
body_fields=True,
346246
parameter_aliases={"_meta": "meta"},
@@ -367,7 +267,7 @@ async def put_component_template(
367267
"""
368268
Creates or updates a component template
369269
370-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/indices-component-template.html>`_
270+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
371271
372272
:param name: Name of the component template to create. Elasticsearch includes
373273
the following built-in component templates: `logs-mappings`; 'logs-settings`;
@@ -429,111 +329,3 @@ async def put_component_template(
429329
return await self.perform_request( # type: ignore[return-value]
430330
"PUT", __path, params=__query, headers=__headers, body=__body
431331
)
432-
433-
@_rewrite_parameters(
434-
body_fields=True,
435-
)
436-
async def put_settings(
437-
self,
438-
*,
439-
error_trace: t.Optional[bool] = None,
440-
filter_path: t.Optional[
441-
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
442-
] = None,
443-
flat_settings: t.Optional[bool] = None,
444-
human: t.Optional[bool] = None,
445-
master_timeout: t.Optional[
446-
t.Union["t.Literal[-1]", "t.Literal[0]", str]
447-
] = None,
448-
persistent: t.Optional[t.Mapping[str, t.Any]] = None,
449-
pretty: t.Optional[bool] = None,
450-
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
451-
transient: t.Optional[t.Mapping[str, t.Any]] = None,
452-
) -> ObjectApiResponse[t.Any]:
453-
"""
454-
Updates the cluster settings.
455-
456-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cluster-update-settings.html>`_
457-
458-
:param flat_settings: Return settings in flat format (default: false)
459-
:param master_timeout: Explicit operation timeout for connection to master node
460-
:param persistent:
461-
:param timeout: Explicit operation timeout
462-
:param transient:
463-
"""
464-
__path = "/_cluster/settings"
465-
__query: t.Dict[str, t.Any] = {}
466-
__body: t.Dict[str, t.Any] = {}
467-
if error_trace is not None:
468-
__query["error_trace"] = error_trace
469-
if filter_path is not None:
470-
__query["filter_path"] = filter_path
471-
if flat_settings is not None:
472-
__query["flat_settings"] = flat_settings
473-
if human is not None:
474-
__query["human"] = human
475-
if master_timeout is not None:
476-
__query["master_timeout"] = master_timeout
477-
if persistent is not None:
478-
__body["persistent"] = persistent
479-
if pretty is not None:
480-
__query["pretty"] = pretty
481-
if timeout is not None:
482-
__query["timeout"] = timeout
483-
if transient is not None:
484-
__body["transient"] = transient
485-
__headers = {"accept": "application/json", "content-type": "application/json"}
486-
return await self.perform_request( # type: ignore[return-value]
487-
"PUT", __path, params=__query, headers=__headers, body=__body
488-
)
489-
490-
@_rewrite_parameters()
491-
async def stats(
492-
self,
493-
*,
494-
node_id: t.Optional[
495-
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
496-
] = None,
497-
error_trace: t.Optional[bool] = None,
498-
filter_path: t.Optional[
499-
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
500-
] = None,
501-
flat_settings: t.Optional[bool] = None,
502-
human: t.Optional[bool] = None,
503-
pretty: t.Optional[bool] = None,
504-
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
505-
) -> ObjectApiResponse[t.Any]:
506-
"""
507-
Returns high-level overview of cluster statistics.
508-
509-
`<https://www.elastic.co/guide/en/elasticsearch/reference/generated/cluster-stats.html>`_
510-
511-
:param node_id: Comma-separated list of node filters used to limit returned information.
512-
Defaults to all nodes in the cluster.
513-
:param flat_settings: If `true`, returns settings in flat format.
514-
:param timeout: Period to wait for each node to respond. If a node does not respond
515-
before its timeout expires, the response does not include its stats. However,
516-
timed out nodes are included in the response’s `_nodes.failed` property.
517-
Defaults to no timeout.
518-
"""
519-
if node_id not in SKIP_IN_PATH:
520-
__path = f"/_cluster/stats/nodes/{_quote(node_id)}"
521-
else:
522-
__path = "/_cluster/stats"
523-
__query: t.Dict[str, t.Any] = {}
524-
if error_trace is not None:
525-
__query["error_trace"] = error_trace
526-
if filter_path is not None:
527-
__query["filter_path"] = filter_path
528-
if flat_settings is not None:
529-
__query["flat_settings"] = flat_settings
530-
if human is not None:
531-
__query["human"] = human
532-
if pretty is not None:
533-
__query["pretty"] = pretty
534-
if timeout is not None:
535-
__query["timeout"] = timeout
536-
__headers = {"accept": "application/json"}
537-
return await self.perform_request( # type: ignore[return-value]
538-
"GET", __path, params=__query, headers=__headers
539-
)

0 commit comments

Comments
 (0)