Skip to content

Commit 57210c6

Browse files
Auto-generated API code (#2525)
1 parent dd6c015 commit 57210c6

File tree

12 files changed

+818
-230
lines changed

12 files changed

+818
-230
lines changed

elasticsearch/_async/client/cluster.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -661,16 +661,17 @@ async def post_voting_config_exclusions(
661661
)
662662

663663
@_rewrite_parameters(
664-
body_fields=("template", "allow_auto_create", "meta", "version"),
664+
body_fields=("template", "deprecated", "meta", "version"),
665665
parameter_aliases={"_meta": "meta"},
666666
)
667667
async def put_component_template(
668668
self,
669669
*,
670670
name: str,
671671
template: t.Optional[t.Mapping[str, t.Any]] = None,
672-
allow_auto_create: t.Optional[bool] = None,
672+
cause: t.Optional[str] = None,
673673
create: t.Optional[bool] = None,
674+
deprecated: t.Optional[bool] = None,
674675
error_trace: t.Optional[bool] = None,
675676
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
676677
human: t.Optional[bool] = None,
@@ -698,13 +699,12 @@ async def put_component_template(
698699
update settings API.
699700
:param template: The template to be applied which includes mappings, settings,
700701
or aliases configuration.
701-
:param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
702-
cluster setting. If set to `true` in a template, then indices can be automatically
703-
created using that template even if auto-creation of indices is disabled
704-
via `actions.auto_create_index`. If set to `false` then data streams matching
705-
the template must always be explicitly created.
702+
:param cause:
706703
:param create: If `true`, this request cannot replace or update existing component
707704
templates.
705+
:param deprecated: Marks this index template as deprecated. When creating or
706+
updating a non-deprecated index template that uses deprecated components,
707+
Elasticsearch will emit a deprecation warning.
708708
:param master_timeout: Period to wait for a connection to the master node. If
709709
no response is received before the timeout expires, the request fails and
710710
returns an error.
@@ -724,6 +724,8 @@ async def put_component_template(
724724
__path = f'/_component_template/{__path_parts["name"]}'
725725
__query: t.Dict[str, t.Any] = {}
726726
__body: t.Dict[str, t.Any] = body if body is not None else {}
727+
if cause is not None:
728+
__query["cause"] = cause
727729
if create is not None:
728730
__query["create"] = create
729731
if error_trace is not None:
@@ -739,8 +741,8 @@ async def put_component_template(
739741
if not __body:
740742
if template is not None:
741743
__body["template"] = template
742-
if allow_auto_create is not None:
743-
__body["allow_auto_create"] = allow_auto_create
744+
if deprecated is not None:
745+
__body["deprecated"] = deprecated
744746
if meta is not None:
745747
__body["_meta"] = meta
746748
if version is not None:

elasticsearch/_async/client/connector.py

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,262 @@ async def put(
486486
path_parts=__path_parts,
487487
)
488488

489+
@_rewrite_parameters()
490+
async def sync_job_cancel(
491+
self,
492+
*,
493+
connector_sync_job_id: str,
494+
error_trace: t.Optional[bool] = None,
495+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
496+
human: t.Optional[bool] = None,
497+
pretty: t.Optional[bool] = None,
498+
) -> ObjectApiResponse[t.Any]:
499+
"""
500+
Cancels a connector sync job.
501+
502+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html>`_
503+
504+
:param connector_sync_job_id: The unique identifier of the connector sync job
505+
"""
506+
if connector_sync_job_id in SKIP_IN_PATH:
507+
raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
508+
__path_parts: t.Dict[str, str] = {
509+
"connector_sync_job_id": _quote(connector_sync_job_id)
510+
}
511+
__path = (
512+
f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_cancel'
513+
)
514+
__query: t.Dict[str, t.Any] = {}
515+
if error_trace is not None:
516+
__query["error_trace"] = error_trace
517+
if filter_path is not None:
518+
__query["filter_path"] = filter_path
519+
if human is not None:
520+
__query["human"] = human
521+
if pretty is not None:
522+
__query["pretty"] = pretty
523+
__headers = {"accept": "application/json"}
524+
return await self.perform_request( # type: ignore[return-value]
525+
"PUT",
526+
__path,
527+
params=__query,
528+
headers=__headers,
529+
endpoint_id="connector.sync_job_cancel",
530+
path_parts=__path_parts,
531+
)
532+
533+
@_rewrite_parameters()
534+
async def sync_job_delete(
535+
self,
536+
*,
537+
connector_sync_job_id: str,
538+
error_trace: t.Optional[bool] = None,
539+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
540+
human: t.Optional[bool] = None,
541+
pretty: t.Optional[bool] = None,
542+
) -> ObjectApiResponse[t.Any]:
543+
"""
544+
Deletes a connector sync job.
545+
546+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html>`_
547+
548+
:param connector_sync_job_id: The unique identifier of the connector sync job
549+
to be deleted
550+
"""
551+
if connector_sync_job_id in SKIP_IN_PATH:
552+
raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
553+
__path_parts: t.Dict[str, str] = {
554+
"connector_sync_job_id": _quote(connector_sync_job_id)
555+
}
556+
__path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}'
557+
__query: t.Dict[str, t.Any] = {}
558+
if error_trace is not None:
559+
__query["error_trace"] = error_trace
560+
if filter_path is not None:
561+
__query["filter_path"] = filter_path
562+
if human is not None:
563+
__query["human"] = human
564+
if pretty is not None:
565+
__query["pretty"] = pretty
566+
__headers = {"accept": "application/json"}
567+
return await self.perform_request( # type: ignore[return-value]
568+
"DELETE",
569+
__path,
570+
params=__query,
571+
headers=__headers,
572+
endpoint_id="connector.sync_job_delete",
573+
path_parts=__path_parts,
574+
)
575+
576+
@_rewrite_parameters()
577+
async def sync_job_get(
578+
self,
579+
*,
580+
connector_sync_job_id: str,
581+
error_trace: t.Optional[bool] = None,
582+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
583+
human: t.Optional[bool] = None,
584+
pretty: t.Optional[bool] = None,
585+
) -> ObjectApiResponse[t.Any]:
586+
"""
587+
Returns the details about a connector sync job.
588+
589+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html>`_
590+
591+
:param connector_sync_job_id: The unique identifier of the connector sync job
592+
"""
593+
if connector_sync_job_id in SKIP_IN_PATH:
594+
raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
595+
__path_parts: t.Dict[str, str] = {
596+
"connector_sync_job_id": _quote(connector_sync_job_id)
597+
}
598+
__path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}'
599+
__query: t.Dict[str, t.Any] = {}
600+
if error_trace is not None:
601+
__query["error_trace"] = error_trace
602+
if filter_path is not None:
603+
__query["filter_path"] = filter_path
604+
if human is not None:
605+
__query["human"] = human
606+
if pretty is not None:
607+
__query["pretty"] = pretty
608+
__headers = {"accept": "application/json"}
609+
return await self.perform_request( # type: ignore[return-value]
610+
"GET",
611+
__path,
612+
params=__query,
613+
headers=__headers,
614+
endpoint_id="connector.sync_job_get",
615+
path_parts=__path_parts,
616+
)
617+
618+
@_rewrite_parameters(
619+
parameter_aliases={"from": "from_"},
620+
)
621+
async def sync_job_list(
622+
self,
623+
*,
624+
connector_id: t.Optional[str] = None,
625+
error_trace: t.Optional[bool] = None,
626+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
627+
from_: t.Optional[int] = None,
628+
human: t.Optional[bool] = None,
629+
job_type: t.Optional[
630+
t.Sequence[
631+
t.Union["t.Literal['access_control', 'full', 'incremental']", str]
632+
]
633+
] = None,
634+
pretty: t.Optional[bool] = None,
635+
size: t.Optional[int] = None,
636+
status: t.Optional[
637+
t.Union[
638+
"t.Literal['canceled', 'canceling', 'completed', 'error', 'in_progress', 'pending', 'suspended']",
639+
str,
640+
]
641+
] = None,
642+
) -> ObjectApiResponse[t.Any]:
643+
"""
644+
Lists all connector sync jobs.
645+
646+
`<https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html>`_
647+
648+
:param connector_id: A connector id to fetch connector sync jobs for
649+
:param from_: Starting offset (default: 0)
650+
:param job_type: A comma-separated list of job types to fetch the sync jobs for
651+
:param size: Specifies a max number of results to get
652+
:param status: A sync job status to fetch connector sync jobs for
653+
"""
654+
__path_parts: t.Dict[str, str] = {}
655+
__path = "/_connector/_sync_job"
656+
__query: t.Dict[str, t.Any] = {}
657+
if connector_id is not None:
658+
__query["connector_id"] = connector_id
659+
if error_trace is not None:
660+
__query["error_trace"] = error_trace
661+
if filter_path is not None:
662+
__query["filter_path"] = filter_path
663+
if from_ is not None:
664+
__query["from"] = from_
665+
if human is not None:
666+
__query["human"] = human
667+
if job_type is not None:
668+
__query["job_type"] = job_type
669+
if pretty is not None:
670+
__query["pretty"] = pretty
671+
if size is not None:
672+
__query["size"] = size
673+
if status is not None:
674+
__query["status"] = status
675+
__headers = {"accept": "application/json"}
676+
return await self.perform_request( # type: ignore[return-value]
677+
"GET",
678+
__path,
679+
params=__query,
680+
headers=__headers,
681+
endpoint_id="connector.sync_job_list",
682+
path_parts=__path_parts,
683+
)
684+
685+
@_rewrite_parameters(
686+
body_fields=("id", "job_type", "trigger_method"),
687+
)
688+
async def sync_job_post(
689+
self,
690+
*,
691+
id: t.Optional[str] = None,
692+
error_trace: t.Optional[bool] = None,
693+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
694+
human: t.Optional[bool] = None,
695+
job_type: t.Optional[
696+
t.Union["t.Literal['access_control', 'full', 'incremental']", str]
697+
] = None,
698+
pretty: t.Optional[bool] = None,
699+
trigger_method: t.Optional[
700+
t.Union["t.Literal['on_demand', 'scheduled']", str]
701+
] = None,
702+
body: t.Optional[t.Dict[str, t.Any]] = None,
703+
) -> ObjectApiResponse[t.Any]:
704+
"""
705+
Creates a connector sync job.
706+
707+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html>`_
708+
709+
:param id: The id of the associated connector
710+
:param job_type:
711+
:param trigger_method:
712+
"""
713+
if id is None and body is None:
714+
raise ValueError("Empty value passed for parameter 'id'")
715+
__path_parts: t.Dict[str, str] = {}
716+
__path = "/_connector/_sync_job"
717+
__query: t.Dict[str, t.Any] = {}
718+
__body: t.Dict[str, t.Any] = body if body is not None else {}
719+
if error_trace is not None:
720+
__query["error_trace"] = error_trace
721+
if filter_path is not None:
722+
__query["filter_path"] = filter_path
723+
if human is not None:
724+
__query["human"] = human
725+
if pretty is not None:
726+
__query["pretty"] = pretty
727+
if not __body:
728+
if id is not None:
729+
__body["id"] = id
730+
if job_type is not None:
731+
__body["job_type"] = job_type
732+
if trigger_method is not None:
733+
__body["trigger_method"] = trigger_method
734+
__headers = {"accept": "application/json", "content-type": "application/json"}
735+
return await self.perform_request( # type: ignore[return-value]
736+
"POST",
737+
__path,
738+
params=__query,
739+
headers=__headers,
740+
body=__body,
741+
endpoint_id="connector.sync_job_post",
742+
path_parts=__path_parts,
743+
)
744+
489745
@_rewrite_parameters(
490746
body_fields=("api_key_id", "api_key_secret_id"),
491747
)

elasticsearch/_async/client/esql.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
class EsqlClient(NamespacedClient):
2727

2828
@_rewrite_parameters(
29-
body_fields=("query", "columnar", "filter", "locale", "params"),
29+
body_fields=("query", "version", "columnar", "filter", "locale", "params"),
3030
ignore_deprecated_options={"params"},
3131
)
3232
async def query(
3333
self,
3434
*,
3535
query: t.Optional[str] = None,
36+
version: t.Optional[t.Union["t.Literal['2024.04.01']", str]] = None,
3637
columnar: t.Optional[bool] = None,
3738
delimiter: t.Optional[str] = None,
3839
error_trace: t.Optional[bool] = None,
@@ -52,6 +53,8 @@ async def query(
5253
5354
:param query: The ES|QL query API accepts an ES|QL query string in the query
5455
parameter, runs it, and returns the results.
56+
:param version: The version of the ES|QL language in which the "query" field
57+
was written.
5558
:param columnar: By default, ES|QL returns results as rows. For example, FROM
5659
returns each individual document as one row. For the JSON, YAML, CBOR and
5760
smile formats, ES|QL can return the results in a columnar fashion where one
@@ -68,6 +71,8 @@ async def query(
6871
"""
6972
if query is None and body is None:
7073
raise ValueError("Empty value passed for parameter 'query'")
74+
if version is None and body is None:
75+
raise ValueError("Empty value passed for parameter 'version'")
7176
__path_parts: t.Dict[str, str] = {}
7277
__path = "/_query"
7378
__query: t.Dict[str, t.Any] = {}
@@ -87,6 +92,8 @@ async def query(
8792
if not __body:
8893
if query is not None:
8994
__body["query"] = query
95+
if version is not None:
96+
__body["version"] = version
9097
if columnar is not None:
9198
__body["columnar"] = columnar
9299
if filter is not None:

0 commit comments

Comments
 (0)