Skip to content

Commit b21cb51

Browse files
Auto-generated API code
1 parent ff117d8 commit b21cb51

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

elasticsearch/_async/client/cluster.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,62 @@ async def health(
470470
"GET", __path, params=__query, headers=__headers
471471
)
472472

473+
@_rewrite_parameters()
474+
async def info(
475+
self,
476+
*,
477+
target: t.Union[
478+
t.Union[
479+
"t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str
480+
],
481+
t.Union[
482+
t.List[
483+
t.Union[
484+
"t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']",
485+
str,
486+
]
487+
],
488+
t.Tuple[
489+
t.Union[
490+
"t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']",
491+
str,
492+
],
493+
...,
494+
],
495+
],
496+
],
497+
error_trace: t.Optional[bool] = None,
498+
filter_path: t.Optional[
499+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
500+
] = None,
501+
human: t.Optional[bool] = None,
502+
pretty: t.Optional[bool] = None,
503+
) -> ObjectApiResponse[t.Any]:
504+
"""
505+
Returns different information about the cluster.
506+
507+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html>`_
508+
509+
:param target: Limits the information returned to the specific target. Supports
510+
a comma-separated list, such as http,ingest.
511+
"""
512+
if target in SKIP_IN_PATH:
513+
raise ValueError("Empty value passed for parameter 'target'")
514+
__path = f"/_info/{_quote(target)}"
515+
__query: t.Dict[str, t.Any] = {}
516+
if error_trace is not None:
517+
__query["error_trace"] = error_trace
518+
if filter_path is not None:
519+
__query["filter_path"] = filter_path
520+
if human is not None:
521+
__query["human"] = human
522+
if pretty is not None:
523+
__query["pretty"] = pretty
524+
__headers = {"accept": "application/json"}
525+
return await self.perform_request( # type: ignore[return-value]
526+
"GET", __path, params=__query, headers=__headers
527+
)
528+
473529
@_rewrite_parameters()
474530
async def pending_tasks(
475531
self,

elasticsearch/_sync/client/cluster.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,62 @@ def health(
470470
"GET", __path, params=__query, headers=__headers
471471
)
472472

473+
@_rewrite_parameters()
474+
def info(
475+
self,
476+
*,
477+
target: t.Union[
478+
t.Union[
479+
"t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str
480+
],
481+
t.Union[
482+
t.List[
483+
t.Union[
484+
"t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']",
485+
str,
486+
]
487+
],
488+
t.Tuple[
489+
t.Union[
490+
"t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']",
491+
str,
492+
],
493+
...,
494+
],
495+
],
496+
],
497+
error_trace: t.Optional[bool] = None,
498+
filter_path: t.Optional[
499+
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
500+
] = None,
501+
human: t.Optional[bool] = None,
502+
pretty: t.Optional[bool] = None,
503+
) -> ObjectApiResponse[t.Any]:
504+
"""
505+
Returns different information about the cluster.
506+
507+
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-info.html>`_
508+
509+
:param target: Limits the information returned to the specific target. Supports
510+
a comma-separated list, such as http,ingest.
511+
"""
512+
if target in SKIP_IN_PATH:
513+
raise ValueError("Empty value passed for parameter 'target'")
514+
__path = f"/_info/{_quote(target)}"
515+
__query: t.Dict[str, t.Any] = {}
516+
if error_trace is not None:
517+
__query["error_trace"] = error_trace
518+
if filter_path is not None:
519+
__query["filter_path"] = filter_path
520+
if human is not None:
521+
__query["human"] = human
522+
if pretty is not None:
523+
__query["pretty"] = pretty
524+
__headers = {"accept": "application/json"}
525+
return self.perform_request( # type: ignore[return-value]
526+
"GET", __path, params=__query, headers=__headers
527+
)
528+
473529
@_rewrite_parameters()
474530
def pending_tasks(
475531
self,

0 commit comments

Comments
 (0)