Skip to content

Commit 18bde03

Browse files
authored
Auto-generated code for 8.17 (#2748)
1 parent 2aaacf5 commit 18bde03

Some content is hidden

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

54 files changed

+4822
-996
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 151 additions & 51 deletions
Large diffs are not rendered by default.

elasticsearch/_async/client/cluster.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ async def delete_component_template(
119119
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
120120
) -> ObjectApiResponse[t.Any]:
121121
"""
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.
122+
Delete component templates. Component templates are building blocks for constructing
123+
index templates that specify index mappings, settings, and aliases.
125124
126125
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
127126
@@ -275,7 +274,7 @@ async def get_component_template(
275274
pretty: t.Optional[bool] = None,
276275
) -> ObjectApiResponse[t.Any]:
277276
"""
278-
Get component templates. Retrieves information about component templates.
277+
Get component templates. Get information about component templates.
279278
280279
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
281280
@@ -719,20 +718,21 @@ async def put_component_template(
719718
body: t.Optional[t.Dict[str, t.Any]] = None,
720719
) -> ObjectApiResponse[t.Any]:
721720
"""
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.
721+
Create or update a component template. Component templates are building blocks
722+
for constructing index templates that specify index mappings, settings, and aliases.
723+
An index template can be composed of multiple component templates. To use a component
724+
template, specify it in an index template’s `composed_of` list. Component templates
725+
are only applied to new data streams and indices as part of a matching index
726+
template. Settings and mappings specified directly in the index template or the
727+
create index request override any settings or mappings specified in a component
728+
template. Component templates are only used during index creation. For data streams,
729+
this includes data stream creation and the creation of a stream’s backing indices.
730+
Changes to component templates do not affect existing indices, including a stream’s
731+
backing indices. You can use C-style `/* *\\/` block comments in component templates.
734732
You can include comments anywhere in the request body except before the opening
735-
curly bracket.
733+
curly bracket. **Applying component templates** You cannot directly apply a component
734+
template to a data stream or index. To be applied, a component template must
735+
be included in an index template's `composed_of` list.
736736
737737
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
738738
@@ -755,8 +755,8 @@ async def put_component_template(
755755
:param master_timeout: Period to wait for a connection to the master node. If
756756
no response is received before the timeout expires, the request fails and
757757
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
758+
:param meta: Optional user metadata about the component template. It may have
759+
any contents. This map is not automatically generated by Elasticsearch. This
760760
information is stored in the cluster state, so keeping it short is preferable.
761761
To unset `_meta`, replace the template without specifying this information.
762762
:param version: Version number used to manage component templates externally.

elasticsearch/_async/client/connector.py

Lines changed: 100 additions & 0 deletions
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/8.17/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

Lines changed: 3 additions & 3 deletions
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/8.17/modules-gateway-dangling-indices.html>`_
47+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/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/8.17/modules-gateway-dangling-indices.html>`_
106+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/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/8.17/modules-gateway-dangling-indices.html>`_
165+
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/dangling-indices-list.html>`_
166166
"""
167167
__path_parts: t.Dict[str, str] = {}
168168
__path = "/_dangling"

elasticsearch/_async/client/ilm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ async def move_to_step(
341341
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-move-to-step.html>`_
342342
343343
:param index: The name of the index whose lifecycle step is to change
344-
:param current_step:
345-
:param next_step:
344+
:param current_step: The step that the index is expected to be in.
345+
:param next_step: The step that you want to run.
346346
"""
347347
if index in SKIP_IN_PATH:
348348
raise ValueError("Empty value passed for parameter 'index'")
@@ -552,8 +552,8 @@ async def start(
552552
553553
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-start.html>`_
554554
555-
:param master_timeout:
556-
:param timeout:
555+
:param master_timeout: Explicit operation timeout for connection to master node
556+
:param timeout: Explicit operation timeout
557557
"""
558558
__path_parts: t.Dict[str, str] = {}
559559
__path = "/_ilm/start"
@@ -601,8 +601,8 @@ async def stop(
601601
602602
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-stop.html>`_
603603
604-
:param master_timeout:
605-
:param timeout:
604+
:param master_timeout: Explicit operation timeout for connection to master node
605+
:param timeout: Explicit operation timeout
606606
"""
607607
__path_parts: t.Dict[str, str] = {}
608608
__path = "/_ilm/stop"

0 commit comments

Comments
 (0)