Skip to content

Commit 0573a5a

Browse files
authored
Added missing 8.7 endpoints
1 parent ac094c0 commit 0573a5a

File tree

6 files changed

+208
-0
lines changed

6 files changed

+208
-0
lines changed

elasticsearch/_async/client/__init__.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,6 +2154,58 @@ async def get_source(
21542154
"GET", __path, params=__query, headers=__headers
21552155
)
21562156

2157+
@_rewrite_parameters()
2158+
async def health_report(
2159+
self,
2160+
*,
2161+
feature: t.Optional[
2162+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
2163+
] = None,
2164+
error_trace: t.Optional[bool] = None,
2165+
filter_path: t.Optional[
2166+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
2167+
] = None,
2168+
human: t.Optional[bool] = None,
2169+
pretty: t.Optional[bool] = None,
2170+
size: t.Optional[int] = None,
2171+
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2172+
verbose: t.Optional[bool] = None,
2173+
) -> ObjectApiResponse[t.Any]:
2174+
"""
2175+
Returns the health of the cluster.
2176+
2177+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/health-api.html>`_
2178+
2179+
:param feature: A feature of the cluster, as returned by the top-level health
2180+
report API.
2181+
:param size: Limit the number of affected resources the health report API returns.
2182+
:param timeout: Explicit operation timeout.
2183+
:param verbose: Opt-in for more information about the health of the system.
2184+
"""
2185+
if feature not in SKIP_IN_PATH:
2186+
__path = f"/_health_report/{_quote(feature)}"
2187+
else:
2188+
__path = "/_health_report"
2189+
__query: t.Dict[str, t.Any] = {}
2190+
if error_trace is not None:
2191+
__query["error_trace"] = error_trace
2192+
if filter_path is not None:
2193+
__query["filter_path"] = filter_path
2194+
if human is not None:
2195+
__query["human"] = human
2196+
if pretty is not None:
2197+
__query["pretty"] = pretty
2198+
if size is not None:
2199+
__query["size"] = size
2200+
if timeout is not None:
2201+
__query["timeout"] = timeout
2202+
if verbose is not None:
2203+
__query["verbose"] = verbose
2204+
__headers = {"accept": "application/json"}
2205+
return await self.perform_request( # type: ignore[return-value]
2206+
"GET", __path, params=__query, headers=__headers
2207+
)
2208+
21572209
@_rewrite_parameters(
21582210
body_name="document",
21592211
)

elasticsearch/_async/client/snapshot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ async def restore(
579579
repository: str,
580580
snapshot: str,
581581
error_trace: t.Optional[bool] = None,
582+
feature_states: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None,
582583
filter_path: t.Optional[
583584
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
584585
] = None,
@@ -609,6 +610,7 @@ async def restore(
609610
610611
:param repository: A repository name
611612
:param snapshot: A snapshot name
613+
:param feature_states:
612614
:param ignore_index_settings:
613615
:param ignore_unavailable:
614616
:param include_aliases:
@@ -631,6 +633,8 @@ async def restore(
631633
__body: t.Dict[str, t.Any] = {}
632634
if error_trace is not None:
633635
__query["error_trace"] = error_trace
636+
if feature_states is not None:
637+
__body["feature_states"] = feature_states
634638
if filter_path is not None:
635639
__query["filter_path"] = filter_path
636640
if human is not None:

elasticsearch/_async/client/transform.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,48 @@ async def reset_transform(
443443
)
444444

445445
@_rewrite_parameters()
446+
async def schedule_now_transform(
447+
self,
448+
*,
449+
transform_id: str,
450+
error_trace: t.Optional[bool] = None,
451+
filter_path: t.Optional[
452+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
453+
] = None,
454+
human: t.Optional[bool] = None,
455+
pretty: t.Optional[bool] = None,
456+
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
457+
) -> ObjectApiResponse[t.Any]:
458+
"""
459+
Schedules now a transform.
460+
461+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/schedule-now-transform.html>`_
462+
463+
:param transform_id: Identifier for the transform.
464+
:param timeout: Controls the time to wait for the scheduling to take place
465+
"""
466+
if transform_id in SKIP_IN_PATH:
467+
raise ValueError("Empty value passed for parameter 'transform_id'")
468+
__path = f"/_transform/{_quote(transform_id)}/_schedule_now"
469+
__query: t.Dict[str, t.Any] = {}
470+
if error_trace is not None:
471+
__query["error_trace"] = error_trace
472+
if filter_path is not None:
473+
__query["filter_path"] = filter_path
474+
if human is not None:
475+
__query["human"] = human
476+
if pretty is not None:
477+
__query["pretty"] = pretty
478+
if timeout is not None:
479+
__query["timeout"] = timeout
480+
__headers = {"accept": "application/json"}
481+
return await self.perform_request( # type: ignore[return-value]
482+
"POST", __path, params=__query, headers=__headers
483+
)
484+
485+
@_rewrite_parameters(
486+
parameter_aliases={"from": "from_"},
487+
)
446488
async def start_transform(
447489
self,
448490
*,
@@ -451,6 +493,7 @@ async def start_transform(
451493
filter_path: t.Optional[
452494
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
453495
] = None,
496+
from_: t.Optional[str] = None,
454497
human: t.Optional[bool] = None,
455498
pretty: t.Optional[bool] = None,
456499
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
@@ -461,6 +504,9 @@ async def start_transform(
461504
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/start-transform.html>`_
462505
463506
:param transform_id: Identifier for the transform.
507+
:param from_: Restricts the set of transformed entities to those changed after
508+
this time. Relative times like now-30d are supported. Only applicable for
509+
continuous transforms.
464510
:param timeout: Period to wait for a response. If no response is received before
465511
the timeout expires, the request fails and returns an error.
466512
"""
@@ -472,6 +518,8 @@ async def start_transform(
472518
__query["error_trace"] = error_trace
473519
if filter_path is not None:
474520
__query["filter_path"] = filter_path
521+
if from_ is not None:
522+
__query["from"] = from_
475523
if human is not None:
476524
__query["human"] = human
477525
if pretty is not None:

elasticsearch/_sync/client/__init__.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,6 +2152,58 @@ def get_source(
21522152
"GET", __path, params=__query, headers=__headers
21532153
)
21542154

2155+
@_rewrite_parameters()
2156+
def health_report(
2157+
self,
2158+
*,
2159+
feature: t.Optional[
2160+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
2161+
] = None,
2162+
error_trace: t.Optional[bool] = None,
2163+
filter_path: t.Optional[
2164+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
2165+
] = None,
2166+
human: t.Optional[bool] = None,
2167+
pretty: t.Optional[bool] = None,
2168+
size: t.Optional[int] = None,
2169+
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
2170+
verbose: t.Optional[bool] = None,
2171+
) -> ObjectApiResponse[t.Any]:
2172+
"""
2173+
Returns the health of the cluster.
2174+
2175+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/health-api.html>`_
2176+
2177+
:param feature: A feature of the cluster, as returned by the top-level health
2178+
report API.
2179+
:param size: Limit the number of affected resources the health report API returns.
2180+
:param timeout: Explicit operation timeout.
2181+
:param verbose: Opt-in for more information about the health of the system.
2182+
"""
2183+
if feature not in SKIP_IN_PATH:
2184+
__path = f"/_health_report/{_quote(feature)}"
2185+
else:
2186+
__path = "/_health_report"
2187+
__query: t.Dict[str, t.Any] = {}
2188+
if error_trace is not None:
2189+
__query["error_trace"] = error_trace
2190+
if filter_path is not None:
2191+
__query["filter_path"] = filter_path
2192+
if human is not None:
2193+
__query["human"] = human
2194+
if pretty is not None:
2195+
__query["pretty"] = pretty
2196+
if size is not None:
2197+
__query["size"] = size
2198+
if timeout is not None:
2199+
__query["timeout"] = timeout
2200+
if verbose is not None:
2201+
__query["verbose"] = verbose
2202+
__headers = {"accept": "application/json"}
2203+
return self.perform_request( # type: ignore[return-value]
2204+
"GET", __path, params=__query, headers=__headers
2205+
)
2206+
21552207
@_rewrite_parameters(
21562208
body_name="document",
21572209
)

elasticsearch/_sync/client/snapshot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ def restore(
579579
repository: str,
580580
snapshot: str,
581581
error_trace: t.Optional[bool] = None,
582+
feature_states: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None,
582583
filter_path: t.Optional[
583584
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
584585
] = None,
@@ -609,6 +610,7 @@ def restore(
609610
610611
:param repository: A repository name
611612
:param snapshot: A snapshot name
613+
:param feature_states:
612614
:param ignore_index_settings:
613615
:param ignore_unavailable:
614616
:param include_aliases:
@@ -631,6 +633,8 @@ def restore(
631633
__body: t.Dict[str, t.Any] = {}
632634
if error_trace is not None:
633635
__query["error_trace"] = error_trace
636+
if feature_states is not None:
637+
__body["feature_states"] = feature_states
634638
if filter_path is not None:
635639
__query["filter_path"] = filter_path
636640
if human is not None:

elasticsearch/_sync/client/transform.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,48 @@ def reset_transform(
443443
)
444444

445445
@_rewrite_parameters()
446+
def schedule_now_transform(
447+
self,
448+
*,
449+
transform_id: str,
450+
error_trace: t.Optional[bool] = None,
451+
filter_path: t.Optional[
452+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
453+
] = None,
454+
human: t.Optional[bool] = None,
455+
pretty: t.Optional[bool] = None,
456+
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
457+
) -> ObjectApiResponse[t.Any]:
458+
"""
459+
Schedules now a transform.
460+
461+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/schedule-now-transform.html>`_
462+
463+
:param transform_id: Identifier for the transform.
464+
:param timeout: Controls the time to wait for the scheduling to take place
465+
"""
466+
if transform_id in SKIP_IN_PATH:
467+
raise ValueError("Empty value passed for parameter 'transform_id'")
468+
__path = f"/_transform/{_quote(transform_id)}/_schedule_now"
469+
__query: t.Dict[str, t.Any] = {}
470+
if error_trace is not None:
471+
__query["error_trace"] = error_trace
472+
if filter_path is not None:
473+
__query["filter_path"] = filter_path
474+
if human is not None:
475+
__query["human"] = human
476+
if pretty is not None:
477+
__query["pretty"] = pretty
478+
if timeout is not None:
479+
__query["timeout"] = timeout
480+
__headers = {"accept": "application/json"}
481+
return self.perform_request( # type: ignore[return-value]
482+
"POST", __path, params=__query, headers=__headers
483+
)
484+
485+
@_rewrite_parameters(
486+
parameter_aliases={"from": "from_"},
487+
)
446488
def start_transform(
447489
self,
448490
*,
@@ -451,6 +493,7 @@ def start_transform(
451493
filter_path: t.Optional[
452494
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
453495
] = None,
496+
from_: t.Optional[str] = None,
454497
human: t.Optional[bool] = None,
455498
pretty: t.Optional[bool] = None,
456499
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
@@ -461,6 +504,9 @@ def start_transform(
461504
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/start-transform.html>`_
462505
463506
:param transform_id: Identifier for the transform.
507+
:param from_: Restricts the set of transformed entities to those changed after
508+
this time. Relative times like now-30d are supported. Only applicable for
509+
continuous transforms.
464510
:param timeout: Period to wait for a response. If no response is received before
465511
the timeout expires, the request fails and returns an error.
466512
"""
@@ -472,6 +518,8 @@ def start_transform(
472518
__query["error_trace"] = error_trace
473519
if filter_path is not None:
474520
__query["filter_path"] = filter_path
521+
if from_ is not None:
522+
__query["from"] = from_
475523
if human is not None:
476524
__query["human"] = human
477525
if pretty is not None:

0 commit comments

Comments
 (0)