Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Apr 6, 2023
1 parent d9f5b63 commit 710ff7e
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 2 deletions.
52 changes: 52 additions & 0 deletions elasticsearch/_async/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,58 @@ async def get_source(
"GET", __path, params=__query, headers=__headers
)

@_rewrite_parameters()
async def health_report(
self,
*,
feature: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
size: t.Optional[int] = None,
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
verbose: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns the health of the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.7/health-api.html>`_
:param feature: A feature of the cluster, as returned by the top-level health
report API.
:param size: Limit the number of affected resources the health report API returns.
:param timeout: Explicit operation timeout.
:param verbose: Opt-in for more information about the health of the system.
"""
if feature not in SKIP_IN_PATH:
__path = f"/_health_report/{_quote(feature)}"
else:
__path = "/_health_report"
__query: t.Dict[str, t.Any] = {}
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 size is not None:
__query["size"] = size
if timeout is not None:
__query["timeout"] = timeout
if verbose is not None:
__query["verbose"] = verbose
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"GET", __path, params=__query, headers=__headers
)

@_rewrite_parameters(
body_name="document",
)
Expand Down
5 changes: 4 additions & 1 deletion elasticsearch/_async/client/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ async def get_pipeline(
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'id'")
__path = f"/_logstash/pipeline/{_quote(id)}"
if id not in SKIP_IN_PATH:
__path = f"/_logstash/pipeline/{_quote(id)}"
else:
__path = "/_logstash/pipeline"
__query: t.Dict[str, t.Any] = {}
if error_trace is not None:
__query["error_trace"] = error_trace
Expand Down
40 changes: 40 additions & 0 deletions elasticsearch/_async/client/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,46 @@ async def reset_transform(
"POST", __path, params=__query, headers=__headers
)

@_rewrite_parameters()
async def schedule_now_transform(
self,
*,
transform_id: str,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Schedules now a transform.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.7/schedule-now-transform.html>`_
:param transform_id: Identifier for the transform.
:param timeout: Controls the time to wait for the scheduling to take place
"""
if transform_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'transform_id'")
__path = f"/_transform/{_quote(transform_id)}/_schedule_now"
__query: t.Dict[str, t.Any] = {}
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 timeout is not None:
__query["timeout"] = timeout
__headers = {"accept": "application/json"}
return await self.perform_request( # type: ignore[return-value]
"POST", __path, params=__query, headers=__headers
)

@_rewrite_parameters()
async def start_transform(
self,
Expand Down
52 changes: 52 additions & 0 deletions elasticsearch/_sync/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,58 @@ def get_source(
"GET", __path, params=__query, headers=__headers
)

@_rewrite_parameters()
def health_report(
self,
*,
feature: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
size: t.Optional[int] = None,
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
verbose: t.Optional[bool] = None,
) -> ObjectApiResponse[t.Any]:
"""
Returns the health of the cluster.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.7/health-api.html>`_
:param feature: A feature of the cluster, as returned by the top-level health
report API.
:param size: Limit the number of affected resources the health report API returns.
:param timeout: Explicit operation timeout.
:param verbose: Opt-in for more information about the health of the system.
"""
if feature not in SKIP_IN_PATH:
__path = f"/_health_report/{_quote(feature)}"
else:
__path = "/_health_report"
__query: t.Dict[str, t.Any] = {}
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 size is not None:
__query["size"] = size
if timeout is not None:
__query["timeout"] = timeout
if verbose is not None:
__query["verbose"] = verbose
__headers = {"accept": "application/json"}
return self.perform_request( # type: ignore[return-value]
"GET", __path, params=__query, headers=__headers
)

@_rewrite_parameters(
body_name="document",
)
Expand Down
5 changes: 4 additions & 1 deletion elasticsearch/_sync/client/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def get_pipeline(
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'id'")
__path = f"/_logstash/pipeline/{_quote(id)}"
if id not in SKIP_IN_PATH:
__path = f"/_logstash/pipeline/{_quote(id)}"
else:
__path = "/_logstash/pipeline"
__query: t.Dict[str, t.Any] = {}
if error_trace is not None:
__query["error_trace"] = error_trace
Expand Down
40 changes: 40 additions & 0 deletions elasticsearch/_sync/client/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,46 @@ def reset_transform(
"POST", __path, params=__query, headers=__headers
)

@_rewrite_parameters()
def schedule_now_transform(
self,
*,
transform_id: str,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
human: t.Optional[bool] = None,
pretty: t.Optional[bool] = None,
timeout: t.Optional[t.Union["t.Literal[-1]", "t.Literal[0]", str]] = None,
) -> ObjectApiResponse[t.Any]:
"""
Schedules now a transform.
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.7/schedule-now-transform.html>`_
:param transform_id: Identifier for the transform.
:param timeout: Controls the time to wait for the scheduling to take place
"""
if transform_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'transform_id'")
__path = f"/_transform/{_quote(transform_id)}/_schedule_now"
__query: t.Dict[str, t.Any] = {}
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 timeout is not None:
__query["timeout"] = timeout
__headers = {"accept": "application/json"}
return self.perform_request( # type: ignore[return-value]
"POST", __path, params=__query, headers=__headers
)

@_rewrite_parameters()
def start_transform(
self,
Expand Down

0 comments on commit 710ff7e

Please sign in to comment.