Skip to content

Commit

Permalink
Update APIs to 7.x-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed May 3, 2021
1 parent 2c5f1d1 commit eba1c0d
Show file tree
Hide file tree
Showing 20 changed files with 614 additions and 178 deletions.
9 changes: 3 additions & 6 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,7 @@ async def msearch(self, body, index=None, doc_type=None, params=None, headers=No
:arg rest_total_hits_as_int: Indicates whether hits.total should
be rendered as an integer or an object in the rest search response
:arg search_type: Search operation type Valid choices:
query_then_fetch, query_and_fetch, dfs_query_then_fetch,
dfs_query_and_fetch
query_then_fetch, dfs_query_then_fetch
:arg typed_keys: Specify whether aggregation and suggester names
should be prefixed by their respective types in the response
"""
Expand Down Expand Up @@ -1236,8 +1235,7 @@ async def msearch_template(
:arg rest_total_hits_as_int: Indicates whether hits.total should
be rendered as an integer or an object in the rest search response
:arg search_type: Search operation type Valid choices:
query_then_fetch, query_and_fetch, dfs_query_then_fetch,
dfs_query_and_fetch
query_then_fetch, dfs_query_then_fetch
:arg typed_keys: Specify whether aggregation and suggester names
should be prefixed by their respective types in the response
"""
Expand Down Expand Up @@ -1774,8 +1772,7 @@ async def search_template(
:arg scroll: Specify how long a consistent view of the index
should be maintained for scrolled search
:arg search_type: Search operation type Valid choices:
query_then_fetch, query_and_fetch, dfs_query_then_fetch,
dfs_query_and_fetch
query_then_fetch, dfs_query_then_fetch
:arg typed_keys: Specify whether aggregation and suggester names
should be prefixed by their respective types in the response
"""
Expand Down
4 changes: 3 additions & 1 deletion elasticsearch/_async/client/fleet.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


class FleetClient(NamespacedClient):
@query_params("checkpoints", "timeout", "wait_for_advance")
@query_params("checkpoints", "timeout", "wait_for_advance", "wait_for_index")
async def global_checkpoints(self, index, params=None, headers=None):
"""
Returns the current global checkpoints for an index. This API is design for
Expand All @@ -36,6 +36,8 @@ async def global_checkpoints(self, index, params=None, headers=None):
Default: 30s
:arg wait_for_advance: Whether to wait for the global checkpoint
to advance past the specified current checkpoints Default: false
:arg wait_for_index: Whether to wait for the target index to
exist and all primary shards be active Default: false
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/_async/client/fleet.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class FleetClient(NamespacedClient):
checkpoints: Optional[Any] = ...,
timeout: Optional[Any] = ...,
wait_for_advance: Optional[Any] = ...,
wait_for_index: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
Expand Down
80 changes: 0 additions & 80 deletions elasticsearch/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,11 +1234,6 @@ async def delete_data_frame_analytics(self, id, params=None, headers=None):
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg id: The ID of the data frame analytics to delete
:arg force: True if the job should be forcefully deleted
:arg timeout: Controls the time to wait until a job is deleted.
Expand All @@ -1261,11 +1256,6 @@ async def evaluate_data_frame(self, body, params=None, headers=None):
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/evaluate-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg body: The evaluation definition
"""
if body in SKIP_IN_PATH:
Expand All @@ -1286,11 +1276,6 @@ async def get_data_frame_analytics(self, id=None, params=None, headers=None):
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg id: The ID of the data frame analytics to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
matches no data frame analytics. (This includes `_all` string or when no
Expand Down Expand Up @@ -1319,11 +1304,6 @@ async def get_data_frame_analytics_stats(self, id=None, params=None, headers=Non
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-dfanalytics-stats.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg id: The ID of the data frame analytics stats to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
matches no data frame analytics. (This includes `_all` string or when no
Expand Down Expand Up @@ -1351,11 +1331,6 @@ async def put_data_frame_analytics(self, id, body, params=None, headers=None):
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg id: The ID of the data frame analytics to create
:arg body: The data frame analytics configuration
"""
Expand All @@ -1380,11 +1355,6 @@ async def start_data_frame_analytics(
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/start-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg id: The ID of the data frame analytics to start
:arg body: The start data frame analytics parameters
:arg timeout: Controls the time to wait until the task has
Expand All @@ -1408,11 +1378,6 @@ async def stop_data_frame_analytics(self, id, body=None, params=None, headers=No
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/stop-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg id: The ID of the data frame analytics to stop
:arg body: The stop data frame analytics parameters
:arg allow_no_match: Whether to ignore if a wildcard expression
Expand Down Expand Up @@ -1442,11 +1407,6 @@ async def delete_trained_model(self, model_id, params=None, headers=None):
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-trained-models.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg model_id: The ID of the trained model to delete
"""
if model_id in SKIP_IN_PATH:
Expand All @@ -1468,11 +1428,6 @@ async def explain_data_frame_analytics(
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/explain-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg body: The data frame analytics config to explain
:arg id: The ID of the data frame analytics to explain
"""
Expand Down Expand Up @@ -1500,11 +1455,6 @@ async def get_trained_models(self, model_id=None, params=None, headers=None):
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-trained-models.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg model_id: The ID of the trained models to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
matches no trained models. (This includes `_all` string or when no
Expand Down Expand Up @@ -1544,11 +1494,6 @@ async def get_trained_models_stats(self, model_id=None, params=None, headers=Non
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/get-trained-models-stats.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg model_id: The ID of the trained models stats to fetch
:arg allow_no_match: Whether to ignore if a wildcard expression
matches no trained models. (This includes `_all` string or when no
Expand All @@ -1575,11 +1520,6 @@ async def put_trained_model(self, model_id, body, params=None, headers=None):
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-trained-models.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg model_id: The ID of the trained models to store
:arg body: The trained model configuration
"""
Expand Down Expand Up @@ -1623,11 +1563,6 @@ async def update_data_frame_analytics(self, id, body, params=None, headers=None)
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/update-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg id: The ID of the data frame analytics to update
:arg body: The data frame analytics settings to update
"""
Expand Down Expand Up @@ -1686,11 +1621,6 @@ async def delete_trained_model_alias(
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/delete-trained-models-aliases.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg model_id: The trained model where the model alias is
assigned
:arg model_alias: The trained model alias to delete
Expand All @@ -1715,11 +1645,6 @@ async def preview_data_frame_analytics(
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/preview-dfanalytics.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg body: The data frame analytics config to preview
:arg id: The ID of the data frame analytics to preview
"""
Expand All @@ -1741,11 +1666,6 @@ async def put_trained_model_alias(
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/put-trained-models-aliases.html>`_
.. warning::
This API is **beta** so may include breaking changes
or be removed in a future version
:arg model_id: The trained model where the model alias should be
assigned
:arg model_alias: The trained model alias to update
Expand Down
26 changes: 25 additions & 1 deletion elasticsearch/_async/client/searchable_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async def repository_stats(self, repository, params=None, headers=None):
@query_params("level")
async def stats(self, index=None, params=None, headers=None):
"""
Retrieve various statistics about searchable snapshots.
Retrieve shard-level statistics about searchable snapshots.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
Expand All @@ -131,3 +131,27 @@ async def stats(self, index=None, params=None, headers=None):
params=params,
headers=headers,
)

@query_params()
async def cache_stats(self, node_id=None, params=None, headers=None):
"""
Retrieve node-level cache statistics about searchable snapshots.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/searchable-snapshots-apis.html>`_
.. warning::
This API is **experimental** so may include breaking changes
or be removed in a future version
:arg node_id: A comma-separated list of node IDs or names to
limit the returned information; use `_local` to return information from
the node you're connecting to, leave empty to get information from all
nodes
"""
return await self.transport.perform_request(
"GET",
_make_path("_searchable_snapshots", node_id, "cache", "stats"),
params=params,
headers=headers,
)
17 changes: 17 additions & 0 deletions elasticsearch/_async/client/searchable_snapshots.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,20 @@ class SearchableSnapshotsClient(NamespacedClient):
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...
async def cache_stats(
self,
*,
node_id: Optional[Any] = ...,
pretty: Optional[bool] = ...,
human: Optional[bool] = ...,
error_trace: Optional[bool] = ...,
format: Optional[str] = ...,
filter_path: Optional[Union[str, Collection[str]]] = ...,
request_timeout: Optional[Union[int, float]] = ...,
ignore: Optional[Union[int, Collection[int]]] = ...,
opaque_id: Optional[str] = ...,
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
params: Optional[MutableMapping[str, Any]] = ...,
headers: Optional[MutableMapping[str, str]] = ...,
) -> Any: ...

0 comments on commit eba1c0d

Please sign in to comment.