2023-10-26 13:34:34 -04:00
|
|
|
# -*- coding: utf-8 -*-
|
2021-08-06 12:59:39 +05:30
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
#
|
|
|
|
|
# The OpenSearch Contributors require contributions made to
|
|
|
|
|
# this file be licensed under the Apache-2.0 license or a
|
|
|
|
|
# compatible open source license.
|
|
|
|
|
#
|
|
|
|
|
# Modifications Copyright OpenSearch Contributors. See
|
|
|
|
|
# GitHub history for details.
|
|
|
|
|
#
|
2020-07-02 13:15:25 -05:00
|
|
|
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
|
|
|
# license agreements. See the NOTICE file distributed with
|
|
|
|
|
# this work for additional information regarding copyright
|
|
|
|
|
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
|
|
|
# the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
|
# not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
|
# under the License.
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2022-10-04 00:15:18 +05:30
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
# ----------------------------------------------------
|
|
|
|
|
# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST.
|
|
|
|
|
#
|
|
|
|
|
# To contribute, kindly make essential modifications through either the "opensearch-py client generator":
|
|
|
|
|
# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py
|
|
|
|
|
# or the "OpenSearch API specification" available at:
|
|
|
|
|
# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json
|
|
|
|
|
# -----------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
from typing import Any
|
|
|
|
|
|
2021-01-13 14:21:04 -06:00
|
|
|
from .utils import NamespacedClient, _make_path, query_params
|
2020-05-15 09:36:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class CatClient(NamespacedClient):
|
|
|
|
|
@query_params("expand_wildcards", "format", "h", "help", "local", "s", "v")
|
2023-11-06 13:08:19 -05:00
|
|
|
async def aliases(
|
|
|
|
|
self,
|
|
|
|
|
name: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Shows information about currently configured aliases to indices including
|
|
|
|
|
filter and routing infos.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg name: Comma-separated list of alias names.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
2023-10-26 07:58:33 -07:00
|
|
|
concrete indices that are open, closed or both. Valid choices are all,
|
|
|
|
|
open, closed, hidden, none.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", _make_path("_cat", "aliases", name), params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
@query_params()
|
|
|
|
|
async def all_pit_segments(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
|
|
|
|
"""
|
|
|
|
|
Lists all active point-in-time segments.
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
return await self.transport.perform_request(
|
|
|
|
|
"GET", "/_cat/pit_segments/_all", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-28 14:29:37 -08:00
|
|
|
@query_params(
|
|
|
|
|
"bytes",
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def allocation(
|
|
|
|
|
self,
|
|
|
|
|
node_id: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Provides a snapshot of how many shards are allocated to each data node and how
|
|
|
|
|
much disk space they are using.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg node_id: Comma-separated list of node IDs or names to limit
|
|
|
|
|
the returned information.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET",
|
|
|
|
|
_make_path("_cat", "allocation", node_id),
|
|
|
|
|
params=params,
|
|
|
|
|
headers=headers,
|
|
|
|
|
)
|
|
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
@query_params(
|
|
|
|
|
"cluster_manager_timeout",
|
|
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
|
|
|
|
async def cluster_manager(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
|
|
|
|
"""
|
|
|
|
|
Returns information about the cluster-manager node.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
|
|
|
|
:arg help: Return help information. Default is false.
|
|
|
|
|
:arg local: Return local information, do not retrieve the state
|
|
|
|
|
from cluster-manager node. Default is false.
|
|
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
|
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
|
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
|
|
|
|
to sort by.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
|
|
|
|
"""
|
|
|
|
|
return await self.transport.perform_request(
|
|
|
|
|
"GET", "/_cat/cluster_manager", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
@query_params("format", "h", "help", "s", "v")
|
2023-11-06 13:08:19 -05:00
|
|
|
async def count(
|
|
|
|
|
self,
|
|
|
|
|
index: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Provides quick access to the document count of the entire cluster, or
|
|
|
|
|
individual indices.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg index: Comma-separated list of indices to limit the
|
|
|
|
|
returned information.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", _make_path("_cat", "count", index), params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
@query_params("bytes", "format", "h", "help", "s", "v")
|
|
|
|
|
async def fielddata(
|
|
|
|
|
self,
|
|
|
|
|
fields: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
|
|
|
|
"""
|
|
|
|
|
Shows how much heap memory is currently being used by fielddata on every data
|
|
|
|
|
node in the cluster.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:arg fields: Comma-separated list of fields to return in the
|
|
|
|
|
output.
|
|
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
|
|
|
|
:arg help: Return help information. Default is false.
|
|
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
|
|
|
|
to sort by.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
|
|
|
|
"""
|
|
|
|
|
return await self.transport.perform_request(
|
|
|
|
|
"GET",
|
|
|
|
|
_make_path("_cat", "fielddata", fields),
|
|
|
|
|
params=params,
|
|
|
|
|
headers=headers,
|
|
|
|
|
)
|
|
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
@query_params("format", "h", "help", "s", "time", "ts", "v")
|
2023-11-06 13:08:19 -05:00
|
|
|
async def health(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Returns a concise representation of the cluster health.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
|
|
|
|
:arg ts: Set to false to disable timestamping. Default is True.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", "/_cat/health", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@query_params("help", "s")
|
2023-11-06 13:08:19 -05:00
|
|
|
async def help(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Returns help for the Cat APIs.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", "/_cat", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@query_params(
|
|
|
|
|
"bytes",
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2020-05-15 09:36:47 -05:00
|
|
|
"expand_wildcards",
|
|
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"health",
|
|
|
|
|
"help",
|
|
|
|
|
"include_unloaded_segments",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"pri",
|
|
|
|
|
"s",
|
|
|
|
|
"time",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def indices(
|
|
|
|
|
self,
|
|
|
|
|
index: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Returns information about indices: number of primaries and replicas, document
|
|
|
|
|
counts, disk size, ...
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg index: Comma-separated list of indices to limit the
|
|
|
|
|
returned information.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
2023-10-26 07:58:33 -07:00
|
|
|
concrete indices that are open, closed or both. Valid choices are all,
|
|
|
|
|
open, closed, hidden, none.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
|
|
|
|
:arg health: Health status ('green', 'yellow', or 'red') to
|
2023-10-26 07:58:33 -07:00
|
|
|
filter only indices matching the specified health status. Valid choices
|
|
|
|
|
are green, yellow, red.
|
|
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg include_unloaded_segments: If set to true segment stats
|
|
|
|
|
will include stats for segments that are not currently loaded into
|
2023-10-26 07:58:33 -07:00
|
|
|
memory. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg pri: Set to true to return stats only for primary shards.
|
2023-10-26 07:58:33 -07:00
|
|
|
Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", _make_path("_cat", "indices", index), params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-28 14:29:37 -08:00
|
|
|
@query_params(
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def master(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-10-09 14:55:51 -07:00
|
|
|
Returns information about the cluster-manager node.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2022-11-28 14:29:37 -08:00
|
|
|
from warnings import warn
|
|
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
warn(
|
|
|
|
|
"Deprecated: To promote inclusive language, please use '/_cat/cluster_manager' instead."
|
|
|
|
|
)
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", "/_cat/master", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
@query_params(
|
|
|
|
|
"cluster_manager_timeout",
|
|
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def nodeattrs(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2022-11-28 14:29:37 -08:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Returns information about custom node attributes.
|
2022-11-28 14:29:37 -08:00
|
|
|
|
|
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2022-11-28 14:29:37 -08:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2022-11-28 14:29:37 -08:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2022-11-28 14:29:37 -08:00
|
|
|
"""
|
|
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET", "/_cat/nodeattrs", params=params, headers=headers
|
2022-11-28 14:29:37 -08:00
|
|
|
)
|
|
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
@query_params(
|
2020-05-20 12:34:29 -05:00
|
|
|
"bytes",
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2020-05-20 12:34:29 -05:00
|
|
|
"format",
|
|
|
|
|
"full_id",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"time",
|
|
|
|
|
"v",
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def nodes(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Returns basic statistics about performance of cluster nodes.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg full_id: Return the full node ID instead of the shortened
|
2023-10-26 07:58:33 -07:00
|
|
|
version. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg local (Deprecated: This parameter does not cause this API
|
2023-10-26 07:58:33 -07:00
|
|
|
to act locally.): Return local information, do not retrieve the state
|
|
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", "/_cat/nodes", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@query_params(
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"time",
|
|
|
|
|
"v",
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def pending_tasks(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Returns a concise representation of the cluster pending tasks.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET", "/_cat/pending_tasks", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@query_params()
|
|
|
|
|
async def pit_segments(
|
|
|
|
|
self,
|
|
|
|
|
body: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
|
|
|
|
"""
|
|
|
|
|
List segments for one or several PITs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
return await self.transport.perform_request(
|
|
|
|
|
"GET", "/_cat/pit_segments", params=params, headers=headers, body=body
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
|
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
@query_params(
|
|
|
|
|
"cluster_manager_timeout",
|
|
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
2023-11-06 13:08:19 -05:00
|
|
|
"local",
|
2023-10-09 14:55:51 -07:00
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def plugins(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Returns information about installed plugins across nodes node.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
|
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET", "/_cat/plugins", params=params, headers=headers
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
|
|
|
|
|
2022-11-28 14:29:37 -08:00
|
|
|
@query_params(
|
2023-11-06 13:08:19 -05:00
|
|
|
"active_only", "bytes", "detailed", "format", "h", "help", "s", "time", "v"
|
2022-11-28 14:29:37 -08:00
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def recovery(
|
|
|
|
|
self,
|
|
|
|
|
index: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Returns information about index shard recoveries, both on-going completed.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg index: Comma-separated list or wildcard expression of index
|
|
|
|
|
names to limit the returned information.
|
|
|
|
|
:arg active_only: If `true`, the response only includes ongoing
|
|
|
|
|
shard recoveries. Default is false.
|
|
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
|
|
|
|
:arg detailed: If `true`, the response includes detailed
|
|
|
|
|
information about shard recoveries. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET", _make_path("_cat", "recovery", index), params=params, headers=headers
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
|
|
|
|
|
2022-11-28 14:29:37 -08:00
|
|
|
@query_params(
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def repositories(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Returns information about snapshot repositories registered in the cluster.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET", "/_cat/repositories", params=params, headers=headers
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
|
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
@query_params(
|
|
|
|
|
"active_only",
|
|
|
|
|
"bytes",
|
|
|
|
|
"completed_only",
|
|
|
|
|
"detailed",
|
|
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"s",
|
|
|
|
|
"shards",
|
|
|
|
|
"time",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
|
|
|
|
async def segment_replication(
|
|
|
|
|
self,
|
|
|
|
|
index: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Returns information about both on-going and latest completed Segment
|
|
|
|
|
Replication events.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg index: Comma-separated list or wildcard expression of index
|
|
|
|
|
names to limit the returned information.
|
|
|
|
|
:arg active_only: If `true`, the response only includes ongoing
|
|
|
|
|
segment replication events. Default is false.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg completed_only: If `true`, the response only includes
|
|
|
|
|
latest completed segment replication events. Default is false.
|
|
|
|
|
:arg detailed: If `true`, the response includes detailed
|
|
|
|
|
information about segment replications. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg shards: Comma-separated list of shards to display.
|
|
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET",
|
2023-11-06 13:08:19 -05:00
|
|
|
_make_path("_cat", "segment_replication", index),
|
2020-05-15 09:36:47 -05:00
|
|
|
params=params,
|
|
|
|
|
headers=headers,
|
|
|
|
|
)
|
|
|
|
|
|
2021-01-13 14:21:04 -06:00
|
|
|
@query_params(
|
2023-11-06 13:08:19 -05:00
|
|
|
"bytes",
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
2021-01-13 14:21:04 -06:00
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def segments(
|
|
|
|
|
self,
|
|
|
|
|
index: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Provides low-level information about the segments in the shards of an index.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg index: Comma-separated list of indices to limit the
|
|
|
|
|
returned information.
|
|
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET", _make_path("_cat", "segments", index), params=params, headers=headers
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
|
|
|
|
|
2022-11-28 14:29:37 -08:00
|
|
|
@query_params(
|
2023-11-06 13:08:19 -05:00
|
|
|
"bytes",
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
2023-11-06 13:08:19 -05:00
|
|
|
"time",
|
2022-11-28 14:29:37 -08:00
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def shards(
|
|
|
|
|
self,
|
|
|
|
|
index: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Provides a detailed view of shard allocation on nodes.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg index: Comma-separated list of indices to limit the
|
|
|
|
|
returned information.
|
|
|
|
|
:arg bytes: The unit in which to display byte values. Valid
|
|
|
|
|
choices are b, k, kb, m, mb, g, gb, t, tb, p, pb.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET", _make_path("_cat", "shards", index), params=params, headers=headers
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
|
|
|
|
|
2022-11-28 14:29:37 -08:00
|
|
|
@query_params(
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
2023-11-06 13:08:19 -05:00
|
|
|
"size",
|
2022-11-28 14:29:37 -08:00
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def thread_pool(
|
|
|
|
|
self,
|
|
|
|
|
thread_pool_patterns: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2023-11-06 13:08:19 -05:00
|
|
|
Returns cluster-wide thread pool statistics per node. By default the active,
|
|
|
|
|
queue and rejected statistics are returned for all thread pools.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg thread_pool_patterns: Comma-separated list of regular-
|
|
|
|
|
expressions to filter the thread pools in the output.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-11-06 13:08:19 -05:00
|
|
|
:arg size: The multiplier in which to display values.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2023-11-06 13:08:19 -05:00
|
|
|
"GET",
|
|
|
|
|
_make_path("_cat", "thread_pool", thread_pool_patterns),
|
|
|
|
|
params=params,
|
|
|
|
|
headers=headers,
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@query_params(
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"ignore_unavailable",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"time",
|
|
|
|
|
"v",
|
2020-05-15 09:36:47 -05:00
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def snapshots(
|
|
|
|
|
self,
|
|
|
|
|
repository: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Returns all snapshots in a specific repository.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg repository: Comma-separated list of repository names.
|
|
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg ignore_unavailable: Whether specified concrete indices
|
2023-10-26 07:58:33 -07:00
|
|
|
should be ignored when unavailable (missing or closed). Default is
|
|
|
|
|
false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET",
|
|
|
|
|
_make_path("_cat", "snapshots", repository),
|
|
|
|
|
params=params,
|
|
|
|
|
headers=headers,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@query_params(
|
|
|
|
|
"actions",
|
|
|
|
|
"detailed",
|
|
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
2021-01-13 14:21:04 -06:00
|
|
|
"nodes",
|
|
|
|
|
"parent_task_id",
|
2020-05-15 09:36:47 -05:00
|
|
|
"s",
|
|
|
|
|
"time",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def tasks(
|
|
|
|
|
self,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Returns information about the tasks currently executing on one or more nodes in
|
|
|
|
|
the cluster.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg actions: Comma-separated list of actions that should be
|
2020-05-15 09:36:47 -05:00
|
|
|
returned. Leave empty to return all.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg detailed: Return detailed task information. Default is
|
|
|
|
|
false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg nodes: Comma-separated list of node IDs or names to limit
|
2021-01-13 14:21:04 -06:00
|
|
|
the returned information; use `_local` to return information from the
|
2023-10-09 14:55:51 -07:00
|
|
|
node you're connecting to, leave empty to get information from all
|
|
|
|
|
nodes.
|
2021-01-13 14:21:04 -06:00
|
|
|
:arg parent_task_id: Return tasks with specified parent task id
|
|
|
|
|
(node_id:task_number). Set to -1 to return all.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg time: The unit in which to display time values. Valid
|
|
|
|
|
choices are d, h, m, s, ms, micros, nanos.
|
|
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", "/_cat/tasks", params=params, headers=headers
|
|
|
|
|
)
|
|
|
|
|
|
2022-11-28 14:29:37 -08:00
|
|
|
@query_params(
|
2023-10-09 14:55:51 -07:00
|
|
|
"cluster_manager_timeout",
|
2022-11-28 14:29:37 -08:00
|
|
|
"format",
|
|
|
|
|
"h",
|
|
|
|
|
"help",
|
|
|
|
|
"local",
|
|
|
|
|
"master_timeout",
|
|
|
|
|
"s",
|
|
|
|
|
"v",
|
|
|
|
|
)
|
2023-11-06 13:08:19 -05:00
|
|
|
async def templates(
|
|
|
|
|
self,
|
|
|
|
|
name: Any = None,
|
|
|
|
|
params: Any = None,
|
|
|
|
|
headers: Any = None,
|
|
|
|
|
) -> Any:
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
|
|
|
|
Returns information about existing templates.
|
2020-10-20 13:02:15 -05:00
|
|
|
|
2020-05-15 09:36:47 -05:00
|
|
|
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg name: The name of the template.
|
|
|
|
|
:arg cluster_manager_timeout: Operation timeout for connection
|
|
|
|
|
to cluster-manager node.
|
|
|
|
|
:arg format: A short version of the Accept header, e.g. json,
|
|
|
|
|
yaml.
|
|
|
|
|
:arg h: Comma-separated list of column names to display.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg help: Return help information. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg local: Return local information, do not retrieve the state
|
2023-10-26 07:58:33 -07:00
|
|
|
from cluster-manager node. Default is false.
|
2023-10-09 14:55:51 -07:00
|
|
|
:arg master_timeout (Deprecated: To promote inclusive language,
|
2023-10-26 07:58:33 -07:00
|
|
|
use 'cluster_manager_timeout' instead.): Operation timeout for
|
|
|
|
|
connection to master node.
|
2020-05-15 09:36:47 -05:00
|
|
|
:arg s: Comma-separated list of column names or column aliases
|
2023-10-09 14:55:51 -07:00
|
|
|
to sort by.
|
2023-10-26 07:58:33 -07:00
|
|
|
:arg v: Verbose mode. Display column headers. Default is false.
|
2020-05-15 09:36:47 -05:00
|
|
|
"""
|
2020-05-20 12:34:29 -05:00
|
|
|
return await self.transport.perform_request(
|
2020-05-15 09:36:47 -05:00
|
|
|
"GET", _make_path("_cat", "templates", name), params=params, headers=headers
|
|
|
|
|
)
|