Cat
- class elasticsearch.client.CatClient
To use this client, access
client.cat
from anElasticsearch
client. For example:from elasticsearch import Elasticsearch # Create the client instance client = Elasticsearch(...) # Use the cat client client.cat.<method>(...)
- aliases(*, name=None, error_trace=None, expand_wildcards=None, filter_path=None, format=None, h=None, help=None, human=None, master_timeout=None, pretty=None, s=None, v=None)
获取别名。
获取集群的索引别名,包括过滤和路由信息。 此API不返回数据流别名。
重要提示:CAT API仅适用于通过命令行或Kibana控制台进行人工查阅,不适用于应用程序调用。如需应用程序调用,请使用别名API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-aliases
- Parameters:
name (str | Sequence[str] | None) – 要检索的别名列表(逗号分隔)。支持通配符 (*)。要检索所有别名,可省略此参数或使用`*`或`_all`。
expand_wildcards (Sequence[str | Literal['all', 'closed', 'hidden', 'none', 'open']] | str | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | None) – 通配符可匹配的索引类型。 如果请求可以针对数据流,此参数决定通配表达式是否匹配隐藏数据流。 支持逗号分隔值,如`open,hidden`。
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能 与其他查询字符串选项组合使用。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间。 如果在超时前主节点不可用,请求将失败并返回错误。 要表示请求永不超时,可设置为`-1`。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序 默认为升序,可通过在列名后添加`:asc`或`:desc` 来更改排序方式。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- allocation(*, node_id=None, bytes=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取分片分配信息。
获取分配给每个数据节点的分片数量及其磁盘空间的快照。
重要提示:CAT API仅适用于通过命令行或Kibana控制台进行人工查阅,不适用于应用程序调用。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-allocation
- Parameters:
node_id (str | Sequence[str] | None) – 用于限制返回信息的节点标识符或名称列表(逗号分隔)。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能 与其他查询字符串选项组合使用。
local (bool | None) – 如果为`true`,请求从本地集群状态计算选定节点列表。 如果为`false`,则从主节点的集群状态计算选定节点列表。 两种情况下协调节点都会向每个选定节点发送进一步信息的请求。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序 默认为升序,可通过在列名后添加`:asc`或`:desc` 来更改排序方式。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- component_templates(*, name=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取组件模板。
获取集群中组件模板的信息。 组件模板是构建索引模板的基础模块,用于指定索引映射、设置和别名。
重要提示:CAT API仅适用于通过命令行或Kibana控制台进行人工查阅。 不适用于应用程序调用。如需应用程序调用,请使用获取组件模板API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-component-templates
- Parameters:
name (str | None) – 组件模板名称。接受通配表达式。 如果省略,则返回所有组件模板。
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能 与其他查询字符串选项组合使用。
local (bool | None) – 如果为`true`,请求从本地集群状态计算选定节点列表。 如果为`false`,则从主节点的集群状态计算选定节点列表。 两种情况下协调节点都会向每个选定节点发送进一步信息的请求。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序 默认为升序,可通过在列名后添加`:asc`或`:desc` 来更改排序方式。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- count(*, index=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, pretty=None, s=None, v=None)
获取文档计数。
快速获取数据流、索引或整个集群的文档计数。 文档计数仅包括活动文档,不包括尚未被合并过程删除的已删除文档。
重要提示:CAT API仅适用于通过命令行或Kibana控制台进行人工查阅。 不适用于应用程序调用。如需应用程序调用,请使用计数API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-count
- Parameters:
index (str | Sequence[str] | None) – 用于限制请求的数据流、索引和别名列表(逗号分隔)。 支持通配符(*)。要针对所有数据流和索引,可省略此参数或使用`*`或`_all`。
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能 与其他查询字符串选项组合使用。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序 默认为升序,可通过在列名后添加`:asc`或`:desc` 来更改排序方式。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- fielddata(*, fields=None, bytes=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, pretty=None, s=None, v=None)
获取字段数据缓存信息。
获取集群中每个数据节点上字段数据缓存当前使用的堆内存量。
重要提示:cat API仅适用于通过命令行或Kibana控制台进行人工查阅。 不适用于应用程序调用。如需应用程序调用,请使用节点统计API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-fielddata
- Parameters:
fields (str | Sequence[str] | None) – 用于限制返回信息的字段列表(逗号分隔)。 要检索所有字段,可省略此参数。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能 与其他查询字符串选项组合使用。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序 默认为升序,可通过在列名后添加`:asc`或`:desc` 来更改排序方式。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- health(*, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, pretty=None, s=None, time=None, ts=None, v=None)
获取集群健康状态。
重要提示:CAT API 仅适用于通过命令行或 Kibana 控制台的人工使用场景, 不适用于应用程序调用。如需应用程序调用,请使用集群健康 API。 该 API 常用于检查故障集群。 为便于结合日志文件和告警系统追踪集群健康状况,API 返回两种格式的时间戳:
HH:MM:SS
(人类可读但不含日期信息);Unix 纪元时间
(机器可排序且包含日期信息)。 后者格式对于持续多天的集群恢复尤为有用。 您可以使用 cat health API 验证跨多节点的集群健康状况, 也可通过该 API 长期追踪大型集群的恢复进度。https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-health
- Parameters:
format (str | None) – 指定返回列式数据的格式,可选值为 text、json、cbor、yaml 或 smile。
help (bool | None) – 设为 true 时输出可用列名,此选项不可与其他查询参数组合使用。
s (str | Sequence[str] | None) – 指定表格排序方式的列名列表,默认升序排序, 可通过在列名后添加 :asc 或 :desc 后缀修改排序方式。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 时间值的显示单位。
ts (bool | None) – 为 true 时返回 HH:MM:SS 和 Unix 纪元时间戳。
v (bool | None) – 设为 true 时启用详细输出模式。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- help()
获取 CAT 帮助信息。
获取 CAT API 的使用帮助。
https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cat
- Return type:
- indices(*, index=None, bytes=None, error_trace=None, expand_wildcards=None, filter_path=None, format=None, h=None, health=None, help=None, human=None, include_unloaded_segments=None, master_timeout=None, pretty=None, pri=None, s=None, time=None, v=None)
获取索引信息。
获取集群中索引的高层信息,包括数据流的后备索引。
通过此请求可获取集群中每个索引的以下信息:
- 分片数量
- 文档数量
- 已删除文档数量
- 主分片存储大小
- 包含副本分片在内的总分片存储大小
这些指标直接从 Lucene 获取(Elasticsearch 内部使用 Lucene 实现索引和搜索功能), 因此所有文档计数均包含隐藏的嵌套文档。 如需获取精确的 Elasticsearch 文档计数,请使用 cat count 或 count API。
CAT API 仅适用于通过命令行或 Kibana 控制台的人工使用场景, 不适用于应用程序调用。如需应用程序调用,请使用索引端点。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-indices
- Parameters:
index (str | Sequence[str] | None) – 用于限制请求的数据流、索引和别名列表(逗号分隔), 支持通配符(*)。若要针对所有数据流和索引,可省略此参数或使用 * 或 _all。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 字节值的显示单位。
expand_wildcards (Sequence[str | Literal['all', 'closed', 'hidden', 'none', 'open']] | str | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | None) – 通配符可匹配的索引类型。
format (str | None) – 指定返回列式数据的格式,可选值为 text、json、cbor、yaml 或 smile。
health (str | Literal['green', 'red', 'unavailable', 'unknown', 'yellow'] | None) – 用于限制返回索引的健康状态,默认返回所有健康状态的索引。
help (bool | None) – 设为 true 时输出可用列名,此选项不可与其他查询参数组合使用。
include_unloaded_segments (bool | None) – 为 true 时,响应包含未加载到内存中的段信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的超时时间。
pri (bool | None) – 为 true 时,响应仅包含主分片信息。
s (str | Sequence[str] | None) – 指定表格排序方式的列名列表,默认升序排序, 可通过在列名后添加 :asc 或 :desc 后缀修改排序方式。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 时间值的显示单位。
v (bool | None) – 设为 true 时启用详细输出模式。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- master(*, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取主节点信息。
获取主节点信息,包括节点 ID、绑定 IP 地址和名称。
重要提示:cat API 仅适用于通过命令行或 Kibana 控制台的人工使用场景, 不适用于应用程序调用。如需应用程序调用,请使用 nodes info API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-master
- Parameters:
format (str | None) – 指定返回列式数据的格式,可选值为 text、json、cbor、yaml 或 smile。
help (bool | None) – 设为 true 时输出可用列名,此选项不可与其他查询参数组合使用。
local (bool | None) – 为 true 时,从本地集群状态计算选定节点列表; 为 false 时从主节点的集群状态计算。无论哪种情况,协调节点都会向每个选定节点发送信息请求。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的超时时间。
s (str | Sequence[str] | None) – 指定表格排序方式的列名列表,默认升序排序, 可通过在列名后添加 :asc 或 :desc 后缀修改排序方式。
v (bool | None) – 设为 true 时启用详细输出模式。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- ml_data_frame_analytics(*, id=None, allow_no_match=None, bytes=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, pretty=None, s=None, time=None, v=None)
获取数据帧分析任务。
获取数据帧分析任务的配置和使用信息。
重要提示:CAT API 仅适用于通过 Kibana 控制台或命令行的人工使用场景, 不适用于应用程序调用。如需应用程序调用,请使用 get data frame analytics jobs statistics API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-data-frame-analytics
- Parameters:
id (str | None) – 要获取的数据帧分析任务 ID
allow_no_match (bool | None) – 是否允许通配表达式不匹配任何配置(包括 _all 字符串或未指定配置的情况)
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 字节值的显示单位
format (str | None) – 指定返回列式数据的格式,可选值为 text、json、cbor、yaml 或 smile。
h (Sequence[str | Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']] | str | ~typing.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version'] | None) – 要显示的列名列表(逗号分隔)。
help (bool | None) – 设为 true 时输出可用列名,此选项不可与其他查询参数组合使用。
s (Sequence[str | Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version']] | str | ~typing.Literal['assignment_explanation', 'create_time', 'description', 'dest_index', 'failure_reason', 'id', 'model_memory_limit', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'progress', 'source_index', 'state', 'type', 'version'] | None) – 用于排序响应的列名或列别名列表(逗号分隔)。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 时间值的显示单位。
v (bool | None) – 设为 true 时启用详细输出模式。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- ml_datafeeds(*, datafeed_id=None, allow_no_match=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, pretty=None, s=None, time=None, v=None)
获取数据馈送。
获取数据馈送的配置和使用信息。 此API最多返回10,000个数据馈送。 如果启用了Elasticsearch安全功能,您必须具有
monitor_ml
、monitor
、manage_ml
或manage
集群权限才能使用此API。重要提示:CAT API仅适用于通过Kibana控制台或命令行的人工使用。 它们不适用于应用程序使用。对于应用程序消费,请使用获取数据馈送统计信息API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-datafeeds
- Parameters:
datafeed_id (str | None) – 唯一标识数据馈送的数字字符串。
allow_no_match (bool | None) – 指定当请求出现以下情况时的处理方式:* 包含通配符表达式但没有匹配的数据馈送 * 包含`_all` 字符串或无标识符且没有匹配项 * 包含通配符表达式且只有部分匹配。如果为`true`,当没有匹配时API返回空数据馈送 数组,当有部分匹配时返回结果子集。如果为`false`,当没有匹配或只有部分匹配时API返回404状态码。
format (str | None) – 指定返回列数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
h (Sequence[str | Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']] | str | ~typing.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st'] | None) – 要显示的列名逗号分隔列表。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
s (Sequence[str | Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st']] | str | ~typing.Literal['ae', 'bc', 'id', 'na', 'ne', 'ni', 'nn', 's', 'sba', 'sc', 'seah', 'st'] | None) – 用于排序响应的列名或列别名逗号分隔列表。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- ml_jobs(*, job_id=None, allow_no_match=None, bytes=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, pretty=None, s=None, time=None, v=None)
获取异常检测任务。
获取异常检测任务的配置和使用信息。 此API最多返回10,000个任务。 如果启用了Elasticsearch安全功能,您必须具有
monitor_ml
、monitor
、manage_ml
或manage
集群权限才能使用此API。重要提示:CAT API仅适用于通过Kibana控制台或命令行的人工使用。 它们不适用于应用程序使用。对于应用程序消费,请使用获取异常检测任务统计信息API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-jobs
- Parameters:
job_id (str | None) – 异常检测任务的标识符。
allow_no_match (bool | None) – 指定当请求出现以下情况时的处理方式:* 包含通配符表达式但没有匹配的任务 * 包含`_all`字符串 或无标识符且没有匹配项 * 包含通配符表达式且只有部分匹配。如果为`true`,当没有匹配时API返回空任务 数组,当有部分匹配时返回结果子集。如果为`false`,当没有匹配或只有部分匹配时API返回404状态码。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
format (str | None) – 指定返回列数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
h (Sequence[str | Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']] | str | ~typing.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state'] | None) – 要显示的列名逗号分隔列表。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
s (Sequence[str | Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state']] | str | ~typing.Literal['assignment_explanation', 'buckets.count', 'buckets.time.exp_avg', 'buckets.time.exp_avg_hour', 'buckets.time.max', 'buckets.time.min', 'buckets.time.total', 'data.buckets', 'data.earliest_record', 'data.empty_buckets', 'data.input_bytes', 'data.input_fields', 'data.input_records', 'data.invalid_dates', 'data.last', 'data.last_empty_bucket', 'data.last_sparse_bucket', 'data.latest_record', 'data.missing_fields', 'data.out_of_order_timestamps', 'data.processed_fields', 'data.processed_records', 'data.sparse_buckets', 'forecasts.memory.avg', 'forecasts.memory.max', 'forecasts.memory.min', 'forecasts.memory.total', 'forecasts.records.avg', 'forecasts.records.max', 'forecasts.records.min', 'forecasts.records.total', 'forecasts.time.avg', 'forecasts.time.max', 'forecasts.time.min', 'forecasts.time.total', 'forecasts.total', 'id', 'model.bucket_allocation_failures', 'model.by_fields', 'model.bytes', 'model.bytes_exceeded', 'model.categorization_status', 'model.categorized_doc_count', 'model.dead_category_count', 'model.failed_category_count', 'model.frequent_category_count', 'model.log_time', 'model.memory_limit', 'model.memory_status', 'model.over_fields', 'model.partition_fields', 'model.rare_category_count', 'model.timestamp', 'model.total_category_count', 'node.address', 'node.ephemeral_id', 'node.id', 'node.name', 'opened_time', 'state'] | None) – 用于排序响应的列名或列别名逗号分隔列表。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- ml_trained_models(*, model_id=None, allow_no_match=None, bytes=None, error_trace=None, filter_path=None, format=None, from_=None, h=None, help=None, human=None, pretty=None, s=None, size=None, time=None, v=None)
获取训练模型。
获取推理训练模型的配置和使用信息。
重要提示:CAT API仅适用于通过Kibana控制台或命令行的人工使用。 它们不适用于应用程序使用。对于应用程序消费,请使用获取训练模型统计信息API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-trained-models
- Parameters:
model_id (str | None) – 训练模型的唯一标识符。
allow_no_match (bool | None) – 指定当请求出现以下情况时的处理方式:包含通配符表达式但没有匹配的模型;包含`_all`字符串 或无标识符且没有匹配项;包含通配符表达式且只有部分匹配。如果为`true`,当没有匹配时API返回空数组 当有部分匹配时返回结果子集。如果为`false`,当没有匹配或只有部分匹配时API返回404状态码。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
format (str | None) – 指定返回列数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
from – 跳过指定数量的转换。
h (Sequence[str | Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']] | str | ~typing.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version'] | None) – 要显示的列名逗号分隔列表。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
s (Sequence[str | Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version']] | str | ~typing.Literal['create_time', 'created_by', 'data_frame_analytics_id', 'description', 'heap_size', 'id', 'ingest.count', 'ingest.current', 'ingest.failed', 'ingest.pipelines', 'ingest.time', 'license', 'operations', 'version'] | None) – 用于排序响应的列名或列别名逗号分隔列表。
size (int | None) – 要显示的最大转换数量。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
from_ (int | None)
human (bool | None)
pretty (bool | None)
- Return type:
- nodeattrs(*, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取节点属性信息。
获取自定义节点属性的信息。 重要提示:cat API仅适用于通过命令行或Kibana控制台的人工使用。它们不适用于应用程序使用。对于应用程序消费,请使用节点信息API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodeattrs
- Parameters:
format (str | None) – 指定返回列数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
local (bool | None) – 如果为`true`,请求从本地集群状态计算选定节点列表。如果为`false`,则从主节点的集群状态计算 选定节点列表。在这两种情况下,协调节点将向每个选定节点发送进一步信息的请求。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接到主节点的时间段。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序默认为升序,可以通过在列名后添加`:asc`或`:desc`来更改。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- nodes(*, bytes=None, error_trace=None, filter_path=None, format=None, full_id=None, h=None, help=None, human=None, include_unloaded_segments=None, master_timeout=None, pretty=None, s=None, time=None, v=None)
获取节点信息。
获取集群中节点的信息。 重要提示:cat API仅适用于通过命令行或Kibana控制台的人工使用。它们不适用于应用程序使用。对于应用程序消费,请使用节点信息API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodes
- Parameters:
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
format (str | None) – 指定返回列数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
full_id (bool | str | None) – 如果为`true`,返回完整节点ID。如果为`false`,返回缩短的节点ID。
h (Sequence[str | Literal['build', 'completion.size', 'cpu', 'disk.avail', 'disk.total', 'disk.used', 'disk.used_percent', 'fielddata.evictions', 'fielddata.memory_size', 'file_desc.current', 'file_desc.max', 'file_desc.percent', 'flush.total', 'flush.total_time', 'get.current', 'get.exists_time', 'get.exists_total', 'get.missing_time', 'get.missing_total', 'get.time', 'get.total', 'heap.current', 'heap.max', 'heap.percent', 'http_address', 'id', 'indexing.delete_current', 'indexing.delete_time', 'indexing.delete_total', 'indexing.index_current', 'indexing.index_failed', 'indexing.index_failed_due_to_version_conflict', 'indexing.index_time', 'indexing.index_total', 'ip', 'jdk', 'load_15m', 'load_1m', 'load_5m', 'mappings.total_count', 'mappings.total_estimated_overhead_in_bytes', 'master', 'merges.current', 'merges.current_docs', 'merges.current_size', 'merges.total', 'merges.total_docs', 'merges.total_size', 'merges.total_time', 'name', 'node.role', 'pid', 'port', 'query_cache.evictions', 'query_cache.hit_count', 'query_cache.memory_size', 'query_cache.miss_count', 'ram.current', 'ram.max', 'ram.percent', 'refresh.time', 'refresh.total', 'request_cache.evictions', 'request_cache.hit_count', 'request_cache.memory_size', 'request_cache.miss_count', 'script.cache_evictions', 'script.compilations', 'search.fetch_current', 'search.fetch_time', 'search.fetch_total', 'search.open_contexts', 'search.query_current', 'search.query_time', 'search.query_total', 'search.scroll_current', 'search.scroll_time', 'search.scroll_total', 'segments.count', 'segments.fixed_bitset_memory', 'segments.index_writer_memory', 'segments.memory', 'segments.version_map_memory', 'shard_stats.total_count', 'suggest.current', 'suggest.time', 'suggest.total', 'uptime', 'version']] | str | ~typing.Literal['build', 'completion.size', 'cpu', 'disk.avail', 'disk.total', 'disk.used', 'disk.used_percent', 'fielddata.evictions', 'fielddata.memory_size', 'file_desc.current', 'file_desc.max', 'file_desc.percent', 'flush.total', 'flush.total_time', 'get.current', 'get.exists_time', 'get.exists_total', 'get.missing_time', 'get.missing_total', 'get.time', 'get.total', 'heap.current', 'heap.max', 'heap.percent', 'http_address', 'id', 'indexing.delete_current', 'indexing.delete_time', 'indexing.delete_total', 'indexing.index_current', 'indexing.index_failed', 'indexing.index_failed_due_to_version_conflict', 'indexing.index_time', 'indexing.index_total', 'ip', 'jdk', 'load_15m', 'load_1m', 'load_5m', 'mappings.total_count', 'mappings.total_estimated_overhead_in_bytes', 'master', 'merges.current', 'merges.current_docs', 'merges.current_size', 'merges.total', 'merges.total_docs', 'merges.total_size', 'merges.total_time', 'name', 'node.role', 'pid', 'port', 'query_cache.evictions', 'query_cache.hit_count', 'query_cache.memory_size', 'query_cache.miss_count', 'ram.current', 'ram.max', 'ram.percent', 'refresh.time', 'refresh.total', 'request_cache.evictions', 'request_cache.hit_count', 'request_cache.memory_size', 'request_cache.miss_count', 'script.cache_evictions', 'script.compilations', 'search.fetch_current', 'search.fetch_time', 'search.fetch_total', 'search.open_contexts', 'search.query_current', 'search.query_time', 'search.query_total', 'search.scroll_current', 'search.scroll_time', 'search.scroll_total', 'segments.count', 'segments.fixed_bitset_memory', 'segments.index_writer_memory', 'segments.memory', 'segments.version_map_memory', 'shard_stats.total_count', 'suggest.current', 'suggest.time', 'suggest.total', 'uptime', 'version'] | None) – 要显示的列名逗号分隔列表。支持简单通配符。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
include_unloaded_segments (bool | None) – 如果为true,响应包括未加载到内存中的段信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接到主节点的时间段。
s (str | Sequence[str] | None) – 决定排序顺序的列名或别名逗号分隔列表。排序默认为升序,可以通过在列名后添加`:asc` 或`:desc`来更改。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- pending_tasks(*, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, time=None, v=None)
获取待处理任务信息。
获取尚未生效的集群级别变更信息。 重要提示:cat API 仅适用于通过命令行或 Kibana 控制台的人工使用,不适用于应用程序调用。如需应用程序使用,请使用待处理集群任务 API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-pending-tasks
- Parameters:
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml 或 smile。
help (bool | None) – 设置为 true 时将输出可用列。此选项不能与其他查询字符串选项组合使用。
local (bool | None) – 如果为 true,请求将从本地集群状态计算选定节点列表。如果为 false,则从主节点的集群状态计算选定节点列表。无论哪种情况,协调节点都会向每个选定节点发送请求以获取更多信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的超时时间。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序默认为升序,可通过在列名后添加 :asc 或 :desc 后缀来更改。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 显示时间值的单位。
v (bool | None) – 设置为 true 时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- plugins(*, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, include_bootstrap=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取插件信息。
获取集群中每个节点上运行的插件列表。 重要提示:cat API 仅适用于通过命令行或 Kibana 控制台的人工使用,不适用于应用程序调用。如需应用程序使用,请使用节点信息 API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-plugins
- Parameters:
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml 或 smile。
help (bool | None) – 设置为 true 时将输出可用列。此选项不能与其他查询字符串选项组合使用。
include_bootstrap (bool | None) – 在响应中包含引导插件
local (bool | None) – 如果为 true,请求将从本地集群状态计算选定节点列表。如果为 false,则从主节点的集群状态计算选定节点列表。无论哪种情况,协调节点都会向每个选定节点发送请求以获取更多信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的超时时间。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序默认为升序,可通过在列名后添加 :asc 或 :desc 后缀来更改。
v (bool | None) – 设置为 true 时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- recovery(*, index=None, active_only=None, bytes=None, detailed=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, pretty=None, s=None, time=None, v=None)
获取分片恢复信息。
获取正在进行和已完成的分片恢复信息。 分片恢复是初始化分片副本的过程,例如从快照恢复主分片或从主分片同步副本分片。当分片恢复完成时,恢复的分片可用于搜索和索引。 对于数据流,API 返回有关流后备索引的信息。 重要提示:cat API 仅适用于通过命令行或 Kibana 控制台的人工使用,不适用于应用程序调用。如需应用程序使用,请使用索引恢复 API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-recovery
- Parameters:
index (str | Sequence[str] | None) – 用于限制请求的数据流、索引和别名的逗号分隔列表。支持通配符 (*)。要针对所有数据流和索引,请省略此参数或使用 * 或 _all。
active_only (bool | None) – 如果为 true,响应仅包含正在进行的分片恢复。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
detailed (bool | None) – 如果为 true,响应包含有关分片恢复的详细信息。
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml 或 smile。
h (Sequence[str | Literal['bytes', 'bytes_percent', 'bytes_recovered', 'bytes_total', 'files', 'files_percent', 'files_recovered', 'files_total', 'index', 'repository', 'shard', 'snapshot', 'source_host', 'source_node', 'stage', 'start_time', 'start_time_millis', 'stop_time', 'stop_time_millis', 'target_host', 'target_node', 'time', 'translog_ops', 'translog_ops_percent', 'translog_ops_recovered', 'type']] | str | ~typing.Literal['bytes', 'bytes_percent', 'bytes_recovered', 'bytes_total', 'files', 'files_percent', 'files_recovered', 'files_total', 'index', 'repository', 'shard', 'snapshot', 'source_host', 'source_node', 'stage', 'start_time', 'start_time_millis', 'stop_time', 'stop_time_millis', 'target_host', 'target_node', 'time', 'translog_ops', 'translog_ops_percent', 'translog_ops_recovered', 'type'] | None) – 要显示的列名的逗号分隔列表。支持简单通配符。
help (bool | None) – 设置为 true 时将输出可用列。此选项不能与其他查询字符串选项组合使用。
s (str | Sequence[str] | None) – 决定排序顺序的列名或别名的逗号分隔列表。排序默认为升序,可通过在列名后添加 :asc 或 :desc 后缀来更改。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为 true 时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- repositories(*, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取快照仓库信息。
获取集群的快照仓库列表。 重要提示:cat API 仅适用于通过命令行或 Kibana 控制台的人工使用,不适用于应用程序调用。如需应用程序使用,请使用获取快照仓库 API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-repositories
- Parameters:
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml 或 smile。
help (bool | None) – 设置为 true 时将输出可用列。此选项不能与其他查询字符串选项组合使用。
local (bool | None) – 如果为 true,请求将从本地集群状态计算选定节点列表。如果为 false,则从主节点的集群状态计算选定节点列表。无论哪种情况,协调节点都会向每个选定节点发送请求以获取更多信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的超时时间。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序默认为升序,可通过在列名后添加 :asc 或 :desc 后缀来更改。
v (bool | None) – 设置为 true 时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- segments(*, index=None, bytes=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取段信息。
获取索引分片中 Lucene 段的底层信息。 对于数据流,API 返回有关后备索引的信息。 重要提示:cat API 仅适用于通过命令行或 Kibana 控制台的人工使用,不适用于应用程序调用。如需应用程序使用,请使用索引段 API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-segments
- Parameters:
index (str | Sequence[str] | None) – 用于限制请求的数据流、索引和别名的逗号分隔列表。支持通配符 (*)。要针对所有数据流和索引,请省略此参数或使用 * 或 _all。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
format (str | None) – 指定返回列式数据的格式,可设置为 text、json、cbor、yaml 或 smile。
h (Sequence[str | Literal['committed', 'compound', 'docs.count', 'docs.deleted', 'generation', 'id', 'index', 'ip', 'prirep', 'searchable', 'segment', 'shard', 'size', 'size.memory', 'version']] | str | ~typing.Literal['committed', 'compound', 'docs.count', 'docs.deleted', 'generation', 'id', 'index', 'ip', 'prirep', 'searchable', 'segment', 'shard', 'size', 'size.memory', 'version'] | None) – 要显示的列名的逗号分隔列表。支持简单通配符。
help (bool | None) – 设置为 true 时将输出可用列。此选项不能与其他查询字符串选项组合使用。
local (bool | None) – 如果为 true,请求将从本地集群状态计算选定节点列表。如果为 false,则从主节点的集群状态计算选定节点列表。无论哪种情况,协调节点都会向每个选定节点发送请求以获取更多信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的超时时间。
s (str | Sequence[str] | None) – 决定排序顺序的列名或别名的逗号分隔列表。排序默认为升序,可通过在列名后添加 :asc 或 :desc 后缀来更改。
v (bool | None) – 设置为 true 时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- shards(*, index=None, bytes=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, master_timeout=None, pretty=None, s=None, time=None, v=None)
获取分片信息。
获取集群中分片的相关信息。 对于数据流,该API返回关于后备索引的信息。 重要提示:cat API仅适用于通过命令行或Kibana控制台进行人工查看,不适用于应用程序调用。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-shards
- Parameters:
index (str | Sequence[str] | None) – 用于限制请求的数据流、索引和别名的逗号分隔列表。支持通配符(*)。 若要针对所有数据流和索引,请省略此参数或使用`*`或`_all`。
bytes (str | Literal['b', 'gb', 'kb', 'mb', 'pb', 'tb'] | None) – 用于显示字节值的单位。
format (str | None) – 指定返回列式数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
h (Sequence[str | Literal['completion.size', 'dataset.size', 'dense_vector.value_count', 'docs', 'dsparse_vector.value_count', 'fielddata.evictions', 'fielddata.memory_size', 'flush.total', 'flush.total_time', 'get.current', 'get.exists_time', 'get.exists_total', 'get.missing_time', 'get.missing_total', 'get.time', 'get.total', 'id', 'index', 'indexing.delete_current', 'indexing.delete_time', 'indexing.delete_total', 'indexing.index_current', 'indexing.index_failed', 'indexing.index_failed_due_to_version_conflict', 'indexing.index_time', 'indexing.index_total', 'ip', 'merges.current', 'merges.current_docs', 'merges.current_size', 'merges.total', 'merges.total_docs', 'merges.total_size', 'merges.total_time', 'node', 'prirep', 'query_cache.evictions', 'query_cache.memory_size', 'recoverysource.type', 'refresh.time', 'refresh.total', 'search.fetch_current', 'search.fetch_time', 'search.fetch_total', 'search.open_contexts', 'search.query_current', 'search.query_time', 'search.query_total', 'search.scroll_current', 'search.scroll_time', 'search.scroll_total', 'segments.count', 'segments.fixed_bitset_memory', 'segments.index_writer_memory', 'segments.memory', 'segments.version_map_memory', 'seq_no.global_checkpoint', 'seq_no.local_checkpoint', 'seq_no.max', 'shard', 'state', 'store', 'suggest.current', 'suggest.time', 'suggest.total', 'sync_id', 'unassigned.at', 'unassigned.details', 'unassigned.for', 'unassigned.reason']] | str | ~typing.Literal['completion.size', 'dataset.size', 'dense_vector.value_count', 'docs', 'dsparse_vector.value_count', 'fielddata.evictions', 'fielddata.memory_size', 'flush.total', 'flush.total_time', 'get.current', 'get.exists_time', 'get.exists_total', 'get.missing_time', 'get.missing_total', 'get.time', 'get.total', 'id', 'index', 'indexing.delete_current', 'indexing.delete_time', 'indexing.delete_total', 'indexing.index_current', 'indexing.index_failed', 'indexing.index_failed_due_to_version_conflict', 'indexing.index_time', 'indexing.index_total', 'ip', 'merges.current', 'merges.current_docs', 'merges.current_size', 'merges.total', 'merges.total_docs', 'merges.total_size', 'merges.total_time', 'node', 'prirep', 'query_cache.evictions', 'query_cache.memory_size', 'recoverysource.type', 'refresh.time', 'refresh.total', 'search.fetch_current', 'search.fetch_time', 'search.fetch_total', 'search.open_contexts', 'search.query_current', 'search.query_time', 'search.query_total', 'search.scroll_current', 'search.scroll_time', 'search.scroll_total', 'segments.count', 'segments.fixed_bitset_memory', 'segments.index_writer_memory', 'segments.memory', 'segments.version_map_memory', 'seq_no.global_checkpoint', 'seq_no.local_checkpoint', 'seq_no.max', 'shard', 'state', 'store', 'suggest.current', 'suggest.time', 'suggest.total', 'sync_id', 'unassigned.at', 'unassigned.details', 'unassigned.for', 'unassigned.reason'] | None) – 响应中显示的列列表。支持简单通配符。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间段。
s (str | Sequence[str] | None) – 决定排序顺序的列名或别名逗号分隔列表。排序默认为升序, 可通过在列名后添加`:asc`或`:desc`后缀来更改。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- snapshots(*, repository=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, ignore_unavailable=None, master_timeout=None, pretty=None, s=None, time=None, v=None)
获取快照信息。
获取一个或多个存储库中存储的快照信息。 快照是索引或运行中的Elasticsearch集群的备份。 重要提示:cat API仅适用于通过命令行或Kibana控制台进行人工查看,不适用于应用程序调用。对于应用程序使用,请使用获取快照API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-snapshots
- Parameters:
repository (str | Sequence[str] | None) – 用于限制请求的快照存储库的逗号分隔列表。接受通配符表达式。`_all`返回所有存储库。 如果任何存储库在请求期间失败,Elasticsearch将返回错误。
format (str | None) – 指定返回列式数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
h (Sequence[str | Literal['duration', 'end_epoch', 'end_time', 'failed_shards', 'id', 'indices', 'reason', 'repository', 'start_epoch', 'start_time', 'status', 'successful_shards', 'total_shards']] | str | ~typing.Literal['duration', 'end_epoch', 'end_time', 'failed_shards', 'id', 'indices', 'reason', 'repository', 'start_epoch', 'start_time', 'status', 'successful_shards', 'total_shards'] | None) – 要显示的列名的逗号分隔列表。支持简单通配符。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
ignore_unavailable (bool | None) – 如果为`true`,响应中不包含不可用快照的信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间段。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序默认为升序, 可通过在列名后添加`:asc`或`:desc`后缀来更改。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- tasks(*, actions=None, detailed=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, nodes=None, parent_task_id=None, pretty=None, s=None, time=None, timeout=None, v=None, wait_for_completion=None)
获取任务信息。
获取集群中当前正在运行的任务信息。 重要提示:cat API仅适用于通过命令行或Kibana控制台进行人工查看,不适用于应用程序调用。对于应用程序使用,请使用任务管理API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-tasks
- Parameters:
detailed (bool | None) – 如果为`true`,响应中包含关于分片恢复的详细信息。
format (str | None) – 指定返回列式数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
parent_task_id (str | None) – 父任务标识符,用于限制响应范围。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序默认为升序, 可通过在列名后添加`:asc`或`:desc`后缀来更改。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待响应的超时时间。如果在超时到期前未收到响应, 则请求失败并返回错误。
v (bool | None) – 设置为`true`时将启用详细输出。
wait_for_completion (bool | None) – 如果为`true`,请求将阻塞直到任务完成。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- templates(*, name=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, v=None)
获取索引模板信息。
获取集群中的索引模板信息。 您可以使用索引模板在创建新索引时应用索引设置和字段映射。 重要提示:cat API仅适用于通过命令行或Kibana控制台进行人工查看,不适用于应用程序调用。对于应用程序使用,请使用获取索引模板API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-templates
- Parameters:
name (str | None) – 要返回的模板名称。接受通配符表达式。 如果省略,则返回所有模板。
format (str | None) – 指定返回列式数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
local (bool | None) – 如果为`true`,请求从本地集群状态计算选定节点列表。 如果为`false`,则从主节点的集群状态计算选定节点列表。 在这两种情况下,协调节点都会向每个选定节点发送请求以获取更多信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间段。
s (str | Sequence[str] | None) – 决定表格排序方式的列列表。排序默认为升序, 可通过在列名后添加`:asc`或`:desc`后缀来更改。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- thread_pool(*, thread_pool_patterns=None, error_trace=None, filter_path=None, format=None, h=None, help=None, human=None, local=None, master_timeout=None, pretty=None, s=None, time=None, v=None)
获取线程池统计信息。
获取集群中每个节点的线程池统计信息。 返回的信息包括所有内置线程池和自定义线程池。 重要提示:cat API仅适用于通过命令行或Kibana控制台进行人工查看,不适用于应用程序调用。对于应用程序使用,请使用节点信息API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-thread-pool
- Parameters:
thread_pool_patterns (str | Sequence[str] | None) – 用于限制请求的线程池名称的逗号分隔列表。接受通配符表达式。
format (str | None) – 指定返回列式数据的格式,可设置为`text`、json、cbor、yaml`或`smile。
h (Sequence[str | Literal['active', 'completed', 'core', 'ephemeral_id', 'host', 'ip', 'keep_alive', 'largest', 'max', 'name', 'node_id', 'node_name', 'pid', 'pool_size', 'port', 'queue', 'queue_size', 'rejected', 'size', 'type']] | str | ~typing.Literal['active', 'completed', 'core', 'ephemeral_id', 'host', 'ip', 'keep_alive', 'largest', 'max', 'name', 'node_id', 'node_name', 'pid', 'pool_size', 'port', 'queue', 'queue_size', 'rejected', 'size', 'type'] | None) – 响应中显示的列列表。支持简单通配符。
help (bool | None) – 设置为`true`时将输出可用列。此选项不能与其他查询字符串选项组合使用。
local (bool | None) – 如果为`true`,请求从本地集群状态计算选定节点列表。 如果为`false`,则从主节点的集群状态计算选定节点列表。 在这两种情况下,协调节点都会向每个选定节点发送请求以获取更多信息。
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间段。
s (str | Sequence[str] | None) – 决定排序顺序的列名或别名逗号分隔列表。排序默认为升序, 可通过在列名后添加`:asc`或`:desc`后缀来更改。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 用于显示时间值的单位。
v (bool | None) – 设置为`true`时将启用详细输出。
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- transforms(*, transform_id=None, allow_no_match=None, error_trace=None, filter_path=None, format=None, from_=None, h=None, help=None, human=None, pretty=None, s=None, size=None, time=None, v=None)
获取转换信息。
获取关于转换的配置和使用信息。
CAT API 仅供人类通过 Kibana 控制台或命令行使用,不适用于应用程序调用。如需应用程序使用,请调用获取转换统计信息 API。
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-transforms
- Parameters:
transform_id (str | None) – 转换标识符或通配符表达式。若不指定此参数,则返回所有转换的信息。
allow_no_match (bool | None) – 控制当请求包含通配符表达式但无匹配转换、包含 _all 字符串或无标识符但无匹配项、或通配符表达式仅有部分匹配时的行为。设为 true 时,无匹配返回空数组,部分匹配返回子集结果;设为 false 时,无匹配或部分匹配返回 404 状态码。
format (str | None) – 指定返回列式数据的格式,可选 text、json、cbor、yaml 或 smile。
from – 跳过指定数量的转换。
h (Sequence[str | Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']] | str | ~typing.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version'] | None) – 要显示的列名逗号分隔列表。
help (bool | None) – 设为 true 时输出可用列信息。此选项不可与其他查询字符串参数组合使用。
s (Sequence[str | Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version']] | str | ~typing.Literal['changes_last_detection_time', 'checkpoint', 'checkpoint_duration_time_exp_avg', 'checkpoint_progress', 'create_time', 'delete_time', 'description', 'dest_index', 'docs_per_second', 'documents_deleted', 'documents_indexed', 'documents_processed', 'frequency', 'id', 'index_failure', 'index_time', 'index_total', 'indexed_documents_exp_avg', 'last_search_time', 'max_page_search_size', 'pages_processed', 'pipeline', 'processed_documents_exp_avg', 'processing_time', 'reason', 'search_failure', 'search_time', 'search_total', 'source_index', 'state', 'transform_type', 'trigger_count', 'version'] | None) – 用于排序响应的列名或列别名逗号分隔列表。
size (int | None) – 要获取的转换最大数量。
time (str | Literal['d', 'h', 'm', 'micros', 'ms', 'nanos', 's'] | None) – 显示时间值的单位。
v (bool | None) – 设为 true 时启用详细输出模式。
error_trace (bool | None)
from_ (int | None)
human (bool | None)
pretty (bool | None)
- Return type: