Skip to content

Commit 14f22ae

Browse files
authored
Auto-generated code for main (#2746)
1 parent 1f66af5 commit 14f22ae

Some content is hidden

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

62 files changed

+5600
-1310
lines changed

elasticsearch/_async/client/__init__.py

+155-51
Large diffs are not rendered by default.

elasticsearch/_async/client/ccr.py

+60
Large diffs are not rendered by default.

elasticsearch/_async/client/cluster.py

+31-19
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ async def allocation_explain(
3838
include_disk_info: t.Optional[bool] = None,
3939
include_yes_decisions: t.Optional[bool] = None,
4040
index: t.Optional[str] = None,
41+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
4142
pretty: t.Optional[bool] = None,
4243
primary: t.Optional[bool] = None,
4344
shard: t.Optional[int] = None,
@@ -61,6 +62,7 @@ async def allocation_explain(
6162
:param include_yes_decisions: If true, returns YES decisions in explanation.
6263
:param index: Specifies the name of the index that you would like an explanation
6364
for.
65+
:param master_timeout: Period to wait for a connection to the master node.
6466
:param primary: If true, returns explanation for the primary shard for the given
6567
shard ID.
6668
:param shard: Specifies the ID of the shard that you would like an explanation
@@ -80,6 +82,8 @@ async def allocation_explain(
8082
__query["include_disk_info"] = include_disk_info
8183
if include_yes_decisions is not None:
8284
__query["include_yes_decisions"] = include_yes_decisions
85+
if master_timeout is not None:
86+
__query["master_timeout"] = master_timeout
8387
if pretty is not None:
8488
__query["pretty"] = pretty
8589
if not __body:
@@ -119,9 +123,8 @@ async def delete_component_template(
119123
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
120124
) -> ObjectApiResponse[t.Any]:
121125
"""
122-
Delete component templates. Deletes component templates. Component templates
123-
are building blocks for constructing index templates that specify index mappings,
124-
settings, and aliases.
126+
Delete component templates. Component templates are building blocks for constructing
127+
index templates that specify index mappings, settings, and aliases.
125128
126129
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
127130
@@ -167,6 +170,7 @@ async def delete_voting_config_exclusions(
167170
error_trace: t.Optional[bool] = None,
168171
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
169172
human: t.Optional[bool] = None,
173+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
170174
pretty: t.Optional[bool] = None,
171175
wait_for_removal: t.Optional[bool] = None,
172176
) -> ObjectApiResponse[t.Any]:
@@ -176,6 +180,7 @@ async def delete_voting_config_exclusions(
176180
177181
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html>`_
178182
183+
:param master_timeout: Period to wait for a connection to the master node.
179184
:param wait_for_removal: Specifies whether to wait for all excluded nodes to
180185
be removed from the cluster before clearing the voting configuration exclusions
181186
list. Defaults to true, meaning that all excluded nodes must be removed from
@@ -192,6 +197,8 @@ async def delete_voting_config_exclusions(
192197
__query["filter_path"] = filter_path
193198
if human is not None:
194199
__query["human"] = human
200+
if master_timeout is not None:
201+
__query["master_timeout"] = master_timeout
195202
if pretty is not None:
196203
__query["pretty"] = pretty
197204
if wait_for_removal is not None:
@@ -275,7 +282,7 @@ async def get_component_template(
275282
pretty: t.Optional[bool] = None,
276283
) -> ObjectApiResponse[t.Any]:
277284
"""
278-
Get component templates. Retrieves information about component templates.
285+
Get component templates. Get information about component templates.
279286
280287
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
281288
@@ -625,6 +632,7 @@ async def post_voting_config_exclusions(
625632
error_trace: t.Optional[bool] = None,
626633
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
627634
human: t.Optional[bool] = None,
635+
master_timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
628636
node_ids: t.Optional[t.Union[str, t.Sequence[str]]] = None,
629637
node_names: t.Optional[t.Union[str, t.Sequence[str]]] = None,
630638
pretty: t.Optional[bool] = None,
@@ -661,6 +669,7 @@ async def post_voting_config_exclusions(
661669
662670
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html>`_
663671
672+
:param master_timeout: Period to wait for a connection to the master node.
664673
:param node_ids: A comma-separated list of the persistent ids of the nodes to
665674
exclude from the voting configuration. If specified, you may not also specify
666675
node_names.
@@ -680,6 +689,8 @@ async def post_voting_config_exclusions(
680689
__query["filter_path"] = filter_path
681690
if human is not None:
682691
__query["human"] = human
692+
if master_timeout is not None:
693+
__query["master_timeout"] = master_timeout
683694
if node_ids is not None:
684695
__query["node_ids"] = node_ids
685696
if node_names is not None:
@@ -719,20 +730,21 @@ async def put_component_template(
719730
body: t.Optional[t.Dict[str, t.Any]] = None,
720731
) -> ObjectApiResponse[t.Any]:
721732
"""
722-
Create or update a component template. Creates or updates a component template.
723-
Component templates are building blocks for constructing index templates that
724-
specify index mappings, settings, and aliases. An index template can be composed
725-
of multiple component templates. To use a component template, specify it in an
726-
index template’s `composed_of` list. Component templates are only applied to
727-
new data streams and indices as part of a matching index template. Settings and
728-
mappings specified directly in the index template or the create index request
729-
override any settings or mappings specified in a component template. Component
730-
templates are only used during index creation. For data streams, this includes
731-
data stream creation and the creation of a stream’s backing indices. Changes
732-
to component templates do not affect existing indices, including a stream’s backing
733-
indices. You can use C-style `/* *\\/` block comments in component templates.
733+
Create or update a component template. Component templates are building blocks
734+
for constructing index templates that specify index mappings, settings, and aliases.
735+
An index template can be composed of multiple component templates. To use a component
736+
template, specify it in an index template’s `composed_of` list. Component templates
737+
are only applied to new data streams and indices as part of a matching index
738+
template. Settings and mappings specified directly in the index template or the
739+
create index request override any settings or mappings specified in a component
740+
template. Component templates are only used during index creation. For data streams,
741+
this includes data stream creation and the creation of a stream’s backing indices.
742+
Changes to component templates do not affect existing indices, including a stream’s
743+
backing indices. You can use C-style `/* *\\/` block comments in component templates.
734744
You can include comments anywhere in the request body except before the opening
735-
curly bracket.
745+
curly bracket. **Applying component templates** You cannot directly apply a component
746+
template to a data stream or index. To be applied, a component template must
747+
be included in an index template's `composed_of` list.
736748
737749
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html>`_
738750
@@ -755,8 +767,8 @@ async def put_component_template(
755767
:param master_timeout: Period to wait for a connection to the master node. If
756768
no response is received before the timeout expires, the request fails and
757769
returns an error.
758-
:param meta: Optional user metadata about the component template. May have any
759-
contents. This map is not automatically generated by Elasticsearch. This
770+
:param meta: Optional user metadata about the component template. It may have
771+
any contents. This map is not automatically generated by Elasticsearch. This
760772
information is stored in the cluster state, so keeping it short is preferable.
761773
To unset `_meta`, replace the template without specifying this information.
762774
:param version: Version number used to manage component templates externally.

elasticsearch/_async/client/connector.py

+100
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,106 @@ async def sync_job_post(
996996
path_parts=__path_parts,
997997
)
998998

999+
@_rewrite_parameters(
1000+
body_fields=(
1001+
"deleted_document_count",
1002+
"indexed_document_count",
1003+
"indexed_document_volume",
1004+
"last_seen",
1005+
"metadata",
1006+
"total_document_count",
1007+
),
1008+
)
1009+
@_stability_warning(Stability.EXPERIMENTAL)
1010+
async def sync_job_update_stats(
1011+
self,
1012+
*,
1013+
connector_sync_job_id: str,
1014+
deleted_document_count: t.Optional[int] = None,
1015+
indexed_document_count: t.Optional[int] = None,
1016+
indexed_document_volume: t.Optional[int] = None,
1017+
error_trace: t.Optional[bool] = None,
1018+
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
1019+
human: t.Optional[bool] = None,
1020+
last_seen: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
1021+
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
1022+
pretty: t.Optional[bool] = None,
1023+
total_document_count: t.Optional[int] = None,
1024+
body: t.Optional[t.Dict[str, t.Any]] = None,
1025+
) -> ObjectApiResponse[t.Any]:
1026+
"""
1027+
Set the connector sync job stats. Stats include: `deleted_document_count`, `indexed_document_count`,
1028+
`indexed_document_volume`, and `total_document_count`. You can also update `last_seen`.
1029+
This API is mainly used by the connector service for updating sync job information.
1030+
To sync data using self-managed connectors, you need to deploy the Elastic connector
1031+
service on your own infrastructure. This service runs automatically on Elastic
1032+
Cloud for Elastic managed connectors.
1033+
1034+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-stats-api.html>`_
1035+
1036+
:param connector_sync_job_id: The unique identifier of the connector sync job.
1037+
:param deleted_document_count: The number of documents the sync job deleted.
1038+
:param indexed_document_count: The number of documents the sync job indexed.
1039+
:param indexed_document_volume: The total size of the data (in MiB) the sync
1040+
job indexed.
1041+
:param last_seen: The timestamp to use in the `last_seen` property for the connector
1042+
sync job.
1043+
:param metadata: The connector-specific metadata.
1044+
:param total_document_count: The total number of documents in the target index
1045+
after the sync job finished.
1046+
"""
1047+
if connector_sync_job_id in SKIP_IN_PATH:
1048+
raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
1049+
if deleted_document_count is None and body is None:
1050+
raise ValueError(
1051+
"Empty value passed for parameter 'deleted_document_count'"
1052+
)
1053+
if indexed_document_count is None and body is None:
1054+
raise ValueError(
1055+
"Empty value passed for parameter 'indexed_document_count'"
1056+
)
1057+
if indexed_document_volume is None and body is None:
1058+
raise ValueError(
1059+
"Empty value passed for parameter 'indexed_document_volume'"
1060+
)
1061+
__path_parts: t.Dict[str, str] = {
1062+
"connector_sync_job_id": _quote(connector_sync_job_id)
1063+
}
1064+
__path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_stats'
1065+
__query: t.Dict[str, t.Any] = {}
1066+
__body: t.Dict[str, t.Any] = body if body is not None else {}
1067+
if error_trace is not None:
1068+
__query["error_trace"] = error_trace
1069+
if filter_path is not None:
1070+
__query["filter_path"] = filter_path
1071+
if human is not None:
1072+
__query["human"] = human
1073+
if pretty is not None:
1074+
__query["pretty"] = pretty
1075+
if not __body:
1076+
if deleted_document_count is not None:
1077+
__body["deleted_document_count"] = deleted_document_count
1078+
if indexed_document_count is not None:
1079+
__body["indexed_document_count"] = indexed_document_count
1080+
if indexed_document_volume is not None:
1081+
__body["indexed_document_volume"] = indexed_document_volume
1082+
if last_seen is not None:
1083+
__body["last_seen"] = last_seen
1084+
if metadata is not None:
1085+
__body["metadata"] = metadata
1086+
if total_document_count is not None:
1087+
__body["total_document_count"] = total_document_count
1088+
__headers = {"accept": "application/json", "content-type": "application/json"}
1089+
return await self.perform_request( # type: ignore[return-value]
1090+
"PUT",
1091+
__path,
1092+
params=__query,
1093+
headers=__headers,
1094+
body=__body,
1095+
endpoint_id="connector.sync_job_update_stats",
1096+
path_parts=__path_parts,
1097+
)
1098+
9991099
@_rewrite_parameters()
10001100
@_stability_warning(Stability.EXPERIMENTAL)
10011101
async def update_active_filtering(

elasticsearch/_async/client/dangling_indices.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def delete_dangling_index(
4444
For example, this can happen if you delete more than `cluster.indices.tombstones.size`
4545
indices while an Elasticsearch node is offline.
4646
47-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html>`_
47+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/dangling-index-delete.html>`_
4848
4949
:param index_uuid: The UUID of the index to delete. Use the get dangling indices
5050
API to find the UUID.
@@ -103,7 +103,7 @@ async def import_dangling_index(
103103
For example, this can happen if you delete more than `cluster.indices.tombstones.size`
104104
indices while an Elasticsearch node is offline.
105105
106-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html>`_
106+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/dangling-index-import.html>`_
107107
108108
:param index_uuid: The UUID of the index to import. Use the get dangling indices
109109
API to locate the UUID.
@@ -162,7 +162,7 @@ async def list_dangling_indices(
162162
indices while an Elasticsearch node is offline. Use this API to list dangling
163163
indices, which you can then import or delete.
164164
165-
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-gateway-dangling-indices.html>`_
165+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/dangling-indices-list.html>`_
166166
"""
167167
__path_parts: t.Dict[str, str] = {}
168168
__path = "/_dangling"

0 commit comments

Comments
 (0)