Skip to content

Commit

Permalink
Auto-generated code for 8.17 (#2748)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin authored Jan 16, 2025
1 parent 2aaacf5 commit 18bde03
Show file tree
Hide file tree
Showing 54 changed files with 4,822 additions and 996 deletions.
202 changes: 151 additions & 51 deletions elasticsearch/_async/client/__init__.py

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ async def delete_component_template(
timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Delete component templates. Deletes component templates. Component templates
are building blocks for constructing index templates that specify index mappings,
settings, and aliases.
Delete component templates. Component templates are building blocks for constructing
index templates that specify index mappings, settings, and aliases.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
Expand Down Expand Up @@ -275,7 +274,7 @@ async def get_component_template(
pretty: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Get component templates. Retrieves information about component templates.
Get component templates. Get information about component templates.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
Expand Down Expand Up @@ -719,20 +718,21 @@ async def put_component_template(
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Create or update a component template. Creates or updates a component template.
Component templates are building blocks for constructing index templates that
specify index mappings, settings, and aliases. An index template can be composed
of multiple component templates. To use a component template, specify it in an
index template’s `composed_of` list. Component templates are only applied to
new data streams and indices as part of a matching index template. Settings and
mappings specified directly in the index template or the create index request
override any settings or mappings specified in a component template. Component
templates are only used during index creation. For data streams, this includes
data stream creation and the creation of a stream’s backing indices. Changes
to component templates do not affect existing indices, including a stream’s backing
indices. You can use C-style `/* *\\/` block comments in component templates.
Create or update a component template. Component templates are building blocks
for constructing index templates that specify index mappings, settings, and aliases.
An index template can be composed of multiple component templates. To use a component
template, specify it in an index template’s `composed_of` list. Component templates
are only applied to new data streams and indices as part of a matching index
template. Settings and mappings specified directly in the index template or the
create index request override any settings or mappings specified in a component
template. Component templates are only used during index creation. For data streams,
this includes data stream creation and the creation of a stream’s backing indices.
Changes to component templates do not affect existing indices, including a stream’s
backing indices. You can use C-style `/* *\\/` block comments in component templates.
You can include comments anywhere in the request body except before the opening
curly bracket.
curly bracket. **Applying component templates** You cannot directly apply a component
template to a data stream or index. To be applied, a component template must
be included in an index template's `composed_of` list.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/indices-component-template.html>`_
Expand All @@ -755,8 +755,8 @@ async def put_component_template(
:param master_timeout: Period to wait for a connection to the master node. If
no response is received before the timeout expires, the request fails and
returns an error.
:param meta: Optional user metadata about the component template. May have any
contents. This map is not automatically generated by Elasticsearch. This
:param meta: Optional user metadata about the component template. It may have
any contents. This map is not automatically generated by Elasticsearch. This
information is stored in the cluster state, so keeping it short is preferable.
To unset `_meta`, replace the template without specifying this information.
:param version: Version number used to manage component templates externally.
Expand Down
100 changes: 100 additions & 0 deletions elasticsearch/_async/client/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,106 @@ async def sync_job_post(
path_parts=__path_parts,
)

@_rewrite_parameters(
body_fields=(
"deleted_document_count",
"indexed_document_count",
"indexed_document_volume",
"last_seen",
"metadata",
"total_document_count",
),
)
@_stability_warning(Stability.EXPERIMENTAL)
async def sync_job_update_stats(
self,
*,
connector_sync_job_id: str,
deleted_document_count: t.Optional[int] = None,
indexed_document_count: t.Optional[int] = None,
indexed_document_volume: t.Optional[int] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None,
human: t.Optional[bool] = None,
last_seen: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None,
metadata: t.Optional[t.Mapping[str, t.Any]] = None,
pretty: t.Optional[bool] = None,
total_document_count: t.Optional[int] = None,
body: t.Optional[t.Dict[str, t.Any]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Set the connector sync job stats. Stats include: `deleted_document_count`, `indexed_document_count`,
`indexed_document_volume`, and `total_document_count`. You can also update `last_seen`.
This API is mainly used by the connector service for updating sync job information.
To sync data using self-managed connectors, you need to deploy the Elastic connector
service on your own infrastructure. This service runs automatically on Elastic
Cloud for Elastic managed connectors.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/set-connector-sync-job-stats-api.html>`_
:param connector_sync_job_id: The unique identifier of the connector sync job.
:param deleted_document_count: The number of documents the sync job deleted.
:param indexed_document_count: The number of documents the sync job indexed.
:param indexed_document_volume: The total size of the data (in MiB) the sync
job indexed.
:param last_seen: The timestamp to use in the `last_seen` property for the connector
sync job.
:param metadata: The connector-specific metadata.
:param total_document_count: The total number of documents in the target index
after the sync job finished.
"""
if connector_sync_job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'connector_sync_job_id'")
if deleted_document_count is None and body is None:
raise ValueError(
"Empty value passed for parameter 'deleted_document_count'"
)
if indexed_document_count is None and body is None:
raise ValueError(
"Empty value passed for parameter 'indexed_document_count'"
)
if indexed_document_volume is None and body is None:
raise ValueError(
"Empty value passed for parameter 'indexed_document_volume'"
)
__path_parts: t.Dict[str, str] = {
"connector_sync_job_id": _quote(connector_sync_job_id)
}
__path = f'/_connector/_sync_job/{__path_parts["connector_sync_job_id"]}/_stats'
__query: t.Dict[str, t.Any] = {}
__body: t.Dict[str, t.Any] = body if body is not None else {}
if error_trace is not None:
__query["error_trace"] = error_trace
if filter_path is not None:
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if pretty is not None:
__query["pretty"] = pretty
if not __body:
if deleted_document_count is not None:
__body["deleted_document_count"] = deleted_document_count
if indexed_document_count is not None:
__body["indexed_document_count"] = indexed_document_count
if indexed_document_volume is not None:
__body["indexed_document_volume"] = indexed_document_volume
if last_seen is not None:
__body["last_seen"] = last_seen
if metadata is not None:
__body["metadata"] = metadata
if total_document_count is not None:
__body["total_document_count"] = total_document_count
__headers = {"accept": "application/json", "content-type": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"PUT",
__path,
params=__query,
headers=__headers,
body=__body,
endpoint_id="connector.sync_job_update_stats",
path_parts=__path_parts,
)

@_rewrite_parameters()
@_stability_warning(Stability.EXPERIMENTAL)
async def update_active_filtering(
Expand Down
6 changes: 3 additions & 3 deletions elasticsearch/_async/client/dangling_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def delete_dangling_index(
For example, this can happen if you delete more than `cluster.indices.tombstones.size`
indices while an Elasticsearch node is offline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-gateway-dangling-indices.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/dangling-index-delete.html>`_
:param index_uuid: The UUID of the index to delete. Use the get dangling indices
API to find the UUID.
Expand Down Expand Up @@ -103,7 +103,7 @@ async def import_dangling_index(
For example, this can happen if you delete more than `cluster.indices.tombstones.size`
indices while an Elasticsearch node is offline.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-gateway-dangling-indices.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/dangling-index-import.html>`_
:param index_uuid: The UUID of the index to import. Use the get dangling indices
API to locate the UUID.
Expand Down Expand Up @@ -162,7 +162,7 @@ async def list_dangling_indices(
indices while an Elasticsearch node is offline. Use this API to list dangling
indices, which you can then import or delete.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/modules-gateway-dangling-indices.html>`_
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/dangling-indices-list.html>`_
"""
__path_parts: t.Dict[str, str] = {}
__path = "/_dangling"
Expand Down
12 changes: 6 additions & 6 deletions elasticsearch/_async/client/ilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ async def move_to_step(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-move-to-step.html>`_
:param index: The name of the index whose lifecycle step is to change
:param current_step:
:param next_step:
:param current_step: The step that the index is expected to be in.
:param next_step: The step that you want to run.
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'index'")
Expand Down Expand Up @@ -552,8 +552,8 @@ async def start(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-start.html>`_
:param master_timeout:
:param timeout:
:param master_timeout: Explicit operation timeout for connection to master node
:param timeout: Explicit operation timeout
"""
__path_parts: t.Dict[str, str] = {}
__path = "/_ilm/start"
Expand Down Expand Up @@ -601,8 +601,8 @@ async def stop(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ilm-stop.html>`_
:param master_timeout:
:param timeout:
:param master_timeout: Explicit operation timeout for connection to master node
:param timeout: Explicit operation timeout
"""
__path_parts: t.Dict[str, str] = {}
__path = "/_ilm/stop"
Expand Down
Loading

0 comments on commit 18bde03

Please sign in to comment.