View Source ElasticsearchEx.Api.Cat (Elasticsearch_ex v1.7.0)

Provides the functions to interact with the CAT APIs.

Important

cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API.

Summary

Functions

Retrieves the cluster’s index aliases, including filter and routing information. The API does not return data stream aliases.

Provides a snapshot of the number of shards allocated to each data node and their disk space.

Returns configuration and usage information about anomaly detection jobs.

Returns information about component templates in a cluster. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.

Provides quick access to a document count for a data stream, an index, or an entire cluster.

Returns configuration and usage information about data frame analytics jobs.

Returns configuration and usage information about datafeeds.

Returns the amount of heap memory currently used by the field data cache on every data node in the cluster.

Returns the health status of a cluster, similar to the cluster health API.

Returns high-level information about indices in a cluster, including backing indices for data streams.

Returns information about the master node, including the ID, bound IP address, and name.

Returns information about custom node attributes.

Returns information about a cluster’s nodes.

Returns cluster-level changes that have not yet been executed, similar to the pending cluster tasks API.

Returns cluster-level changes that have not yet been executed, similar to the pending cluster tasks API.

Returns information about ongoing and completed shard recoveries, similar to the index recovery API.

Returns the snapshot repositories for a cluster.

Returns low-level information about the Lucene segments in index shards, similar to the indices segments API.

The shards command is the detailed view of what nodes contain which shards. It will tell you if it’s a primary or replica, the number of docs, the bytes it takes on disk, and the node where it’s located.

Returns information about the snapshots stored in one or more repositories. A snapshot is a backup of an index or running Elasticsearch cluster.

Returns information about tasks currently executing in the cluster, similar to the task management API.

Returns information about index templates in a cluster. You can use index templates to apply index settings and field mappings to new indices at creation.

Returns thread pool statistics for each node in a cluster. Returned information includes all built-in thread pools and custom thread pools.

Returns configuration and usage information about inference trained models.

Returns configuration and usage information about transforms.

Types

Functions

Link to this function

aliases(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec aliases(nil | index(), opts()) :: ElasticsearchEx.response()

Retrieves the cluster’s index aliases, including filter and routing information. The API does not return data stream aliases.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.aliases(nil, format: :json, v: true)
{:ok,
 [
   %{
     "alias" => "my-alias",
     "filter" => "-",
     "index" => "my-index",
     "is_write_index" => "-",
     "routing.index" => "-",
     "routing.search" => "-"
   }
 ]}
Link to this function

allocation(node_id \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec allocation(nil | binary(), opts()) :: ElasticsearchEx.response()

Provides a snapshot of the number of shards allocated to each data node and their disk space.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.allocation(nil, format: :json, v: true)
{:ok,
 [
   %{
     "disk.avail" => "35.3gb",
     "disk.indices" => "23.8kb",
     "disk.percent" => "84",
     "disk.total" => "228.2gb",
     "disk.used" => "192.8gb",
     "host" => "127.0.0.1",
     "ip" => "127.0.0.1",
     "node" => "my-node",
     "node.role" => "cdfhilmrstw",
     "shards" => "3"
   }
 ]}
Link to this function

anomaly_detectors(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec anomaly_detectors(nil | index(), opts()) :: ElasticsearchEx.response()

Returns configuration and usage information about anomaly detection jobs.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.anomaly_detectors(nil, format: :json, h: "id,s,dpr,mb", v: true)
{:ok,
 [
   %{
     "dpr" => "14022",
     "id" => "high_sum_total_sales",
     "mb" => "1.5mb",
     "s" => "closed"
   },
   %{
     "dpr" => "1216",
     "id" => "low_request_rate",
     "mb" => "40.5kb",
     "s" => "closed"
   },
   %{
     "dpr" => "28146",
     "id" => "response_code_rates",
     "mb" => "132.7kb",
     "s" => "closed"
   },
   %{
     "dpr" => "28146",
     "id" => "url_scanning",
     "mb" => "501.6kb",
     "s" => "closed"
   }
 ]}
Link to this function

component_templates(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec component_templates(nil | index(), opts()) :: ElasticsearchEx.response()

Returns information about component templates in a cluster. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.component_templates(nil, format: :json, s: "name", v: true)
{:ok,
 [
   %{
     "alias_count" => "0",
     "included_in" => "[my-index-template]",
     "mapping_count" => "1",
     "name" => "my-template-1",
     "settings_count" => "0",
     "version" => "0"
   },
   %{
     "alias_count" => "3",
     "included_in" => "[my-index-template]",
     "mapping_count" => "0",
     "name" => "my-template-2",
     "settings_count" => "0",
     "version" => "0"
   }
 ]}
Link to this function

count(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec count(nil | index(), opts()) :: ElasticsearchEx.response()

Provides quick access to a document count for a data stream, an index, or an entire cluster.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.count(nil, format: :json, v: true)
{:ok, [%{"count" => "4", "epoch" => "1712153041", "timestamp" => "14:04:01"}]}
Link to this function

data_frame_analytics(data_frame_analytics_id \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec data_frame_analytics(nil | binary(), opts()) :: ElasticsearchEx.response()

Returns configuration and usage information about data frame analytics jobs.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.data_frame_analytics(nil, format: :json, v: true)
{:ok,
 [
   %{
     "create_time" => "2020-02-12T11:49:09.594Z",
     "id" => "classifier_job_1",
     "state" => "stopped",
     "type" => "classification"
   },
   %{
     "create_time" => "2020-02-12T11:49:14.479Z",
     "id" => "classifier_job_2",
     "state" => "stopped",
     "type" => "classification"
   },
   %{
     "create_time" => "2020-02-12T11:49:16.928Z",
     "id" => "classifier_job_3",
     "state" => "stopped",
     "type" => "classification"
   },
   %{
     "create_time" => "2020-02-12T11:49:19.127Z",
     "id" => "classifier_job_4",
     "state" => "stopped",
     "type" => "classification"
   },
   %{
     "create_time" => "2020-02-12T11:49:21.349Z",
     "id" => "classifier_job_5",
     "state" => "stopped",
     "type" => "classification"
   }
 ]}
Link to this function

datafeeds(feed_id \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec datafeeds(nil | binary(), opts()) :: ElasticsearchEx.response()

Returns configuration and usage information about datafeeds.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.datafeeds(nil, format: :json, v: true)
{:ok,
 [
   %{
     "buckets.count" => "743",
     "id" => "datafeed-high_sum_total_sales",
     "search.count" => "7",
     "state" => "stopped"
   },
   %{
     "buckets.count" => "1457",
     "id" => "datafeed-low_request_rate",
     "search.count" => "3",
     "state" => "stopped"
   },
   %{
     "buckets.count" => "1460",
     "id" => "datafeed-response_code_rates",
     "search.count" => "18",
     "state" => "stopped"
   },
   %{
     "buckets.count" => "1460",
     "id" => "datafeed-url_scanning",
     "search.count" => "18",
     "state" => "stopped"
   }
 ]}
Link to this function

fielddata(field \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec fielddata(nil | binary(), opts()) :: ElasticsearchEx.response()

Returns the amount of heap memory currently used by the field data cache on every data node in the cluster.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.fielddata(nil, format: :json, v: true)
{:ok,
 [
   %{
     "field" => "body",
     "host" => "127.0.0.1",
     "id" => "Nqk-6inXQq-OxUfOUI8jNQ",
     "ip" => "127.0.0.1",
     "node" => "Nqk-6in",
     "size" => "544b"
   },
   %{
     "field" => "mind",
     "host" => "127.0.0.1",
     "id" => "Nqk-6inXQq-OxUfOUI8jNQ",
     "ip" => "127.0.0.1",
     "node" => "Nqk-6in",
     "size" => "360b"
   },
   %{
     "field" => "soul",
     "host" => "127.0.0.1",
     "id" => "Nqk-6inXQq-OxUfOUI8jNQ",
     "ip" => "127.0.0.1",
     "node" => "Nqk-6in",
     "size" => "480b"
   }
 ]}
Link to this function

health(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec health(nil | index(), opts()) :: ElasticsearchEx.response()

Returns the health status of a cluster, similar to the cluster health API.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.health(nil, format: :json, v: true)
{:ok,
 [
   %{
     "active_shards_percent" => "100.0%",
     "cluster" => "elasticsearch",
     "epoch" => "1712153802",
     "init" => "0",
     "max_task_wait_time" => "-",
     "node.data" => "1",
     "node.total" => "1",
     "pending_tasks" => "0",
     "pri" => "3",
     "relo" => "0",
     "shards" => "3",
     "status" => "green",
     "timestamp" => "14:16:42",
     "unassign" => "0"
   }
 ]}
Link to this function

indices(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec indices(nil | index(), opts()) :: ElasticsearchEx.response()

Returns high-level information about indices in a cluster, including backing indices for data streams.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.indices(nil,
...>   format: :json,
...>   include_unloaded_segments: true,
...>   v: true,
...>   h: "index,pri,rep,health,status,docs.count,docs.deleted,store.size,pri.store.size",
...>   s: :index
...> )
{:ok,
 [
   %{
     "docs.count" => "6",
     "docs.deleted" => "0",
     "health" => "green",
     "index" => "my-index",
     "pri" => "1",
     "pri.store.size" => "18.9kb",
     "rep" => "0",
     "status" => "open",
     "store.size" => "18.9kb"
   }
 ]}
Link to this function

master(opts \\ [])

View Source (since 1.1.0)
@spec master(opts()) :: ElasticsearchEx.response()

Returns information about the master node, including the ID, bound IP address, and name.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.master(format: :json, v: true)
{:ok,
 [
   %{
     "host" => "127.0.0.1",
     "id" => "YzWoH_2BT-6UjVGDyPdqYg",
     "ip" => "127.0.0.1",
     "node" => "YzWoH_2"
   }
 ]}
Link to this function

nodeattrs(opts \\ [])

View Source (since 1.1.0)
@spec nodeattrs(opts()) :: ElasticsearchEx.response()

Returns information about custom node attributes.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.nodeattrs(format: :json, v: true)
{:ok,
 [
   %{
     "attr" => "testattr",
     "host" => "127.0.0.1",
     "ip" => "127.0.0.1",
     "node" => "node-0",
     "value" => "test"
   }
 ]}
Link to this function

nodes(opts \\ [])

View Source (since 1.1.0)
@spec nodes(opts()) :: ElasticsearchEx.response()

Returns information about a cluster’s nodes.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.nodes(format: :json, v: true)
{:ok,
 [
   %{
     "cpu" => "42",
     "heap.percent" => "65",
     "ip" => "127.0.0.1",
     "load_15m" => "*",
     "load_1m" => "3.07",
     "load_5m" => "dim",
     "node.role" => "mJw06l1",
     "ram.percent" => "99"
   }
 ]}
Link to this function

pending_tasks(opts \\ [])

View Source (since 1.1.0)
@spec pending_tasks(opts()) :: ElasticsearchEx.response()

Returns cluster-level changes that have not yet been executed, similar to the pending cluster tasks API.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.pending_tasks(format: :json, v: true)
{:ok,
 [
   %{
     "insertOrder" => "1685",
     "priority" => "HIGH",
     "source" => "update-mapping",
     "timeInQueue" => "855ms"
   },
   %{
     "insertOrder" => "1686",
     "priority" => "HIGH",
     "source" => "update-mapping",
     "timeInQueue" => "843ms"
   },
   %{
     "insertOrder" => "1693",
     "priority" => "HIGH",
     "source" => "update-mapping",
     "timeInQueue" => "753ms"
   },
   %{
     "insertOrder" => "1688",
     "priority" => "HIGH",
     "source" => "update-mapping",
     "timeInQueue" => "816ms"
   },
   %{
     "insertOrder" => "1689",
     "priority" => "HIGH",
     "source" => "update-mapping",
     "timeInQueue" => "802ms"
   },
   %{
     "insertOrder" => "1690",
     "priority" => "HIGH",
     "source" => "update-mapping",
     "timeInQueue" => "787ms"
   },
   %{
     "insertOrder" => "1691",
     "priority" => "HIGH",
     "source" => "update-mapping",
     "timeInQueue" => "773ms"
   }
 ]}
Link to this function

plugins(opts \\ [])

View Source (since 1.1.0)
@spec plugins(opts()) :: ElasticsearchEx.response()

Returns cluster-level changes that have not yet been executed, similar to the pending cluster tasks API.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.plugins(format: :json, h: "name,component,version,description", s: "component", v: true)
{:ok,
 [
   %{
     "component" => "analysis-icu",
     "description" => "The ICU Analysis plugin integrates the Lucene ICU module into Elasticsearch, adding ICU-related analysis components.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "analysis-kuromoji",
     "description" => "The Japanese (kuromoji) Analysis plugin integrates Lucene kuromoji analysis module into elasticsearch.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "analysis-nori",
     "description" => "The Korean (nori) Analysis plugin integrates Lucene nori analysis module into elasticsearch.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "analysis-phonetic",
     "description" => "The Phonetic Analysis plugin integrates phonetic token filter analysis with elasticsearch.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "analysis-smartcn",
     "description" => "Smart Chinese Analysis plugin integrates Lucene Smart Chinese analysis module into elasticsearch.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "analysis-stempel",
     "description" => "The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into elasticsearch.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "analysis-ukrainian",
     "description" => "The Ukrainian Analysis plugin integrates the Lucene UkrainianMorfologikAnalyzer into elasticsearch.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "discovery-azure-classic",
     "description" => "The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "discovery-ec2",
     "description" => "The EC2 discovery plugin allows to use AWS API for the unicast discovery mechanism.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "discovery-gce",
     "description" => "The Google Compute Engine (GCE) Discovery plugin allows to use GCE API for the unicast discovery mechanism.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "mapper-annotated-text",
     "description" => "The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "mapper-murmur3",
     "description" => "The Mapper Murmur3 plugin allows to compute hashes of a field's values at index-time and to store them in the index.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "mapper-size",
     "description" => "The Mapper Size plugin allows document to record their uncompressed size at index time.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   },
   %{
     "component" => "store-smb",
     "description" => "The Store SMB plugin adds support for SMB stores.",
     "name" => "U7321H6",
     "version" => "8.13.1"
   }
 ]}
Link to this function

recovery(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec recovery(nil | index(), opts()) :: ElasticsearchEx.response()

Returns information about ongoing and completed shard recoveries, similar to the index recovery API.

For data streams, the API returns information about the stream’s backing indices.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.recovery(format: :json, v: true)
{:ok,
 [
   %{
     "bytes" => "0b",
     "bytes_percent" => "100%",
     "bytes_recovered" => "0b",
     "bytes_total" => "9928b",
     "files" => "0",
     "files_percent" => "100%",
     "files_recovered" => "0",
     "files_total" => "13",
     "index" => "my-index-000001",
     "repository" => "n/a",
     "shard" => "0",
     "snapshot" => "n/a",
     "source_host" => "n/a",
     "source_node" => "n/a",
     "stage" => "done",
     "target_host" => "127.0.0.1",
     "target_node" => "node-0",
     "time" => "13ms",
     "translog_ops" => "0",
     "translog_ops_percent" => "100.0%",
     "translog_ops_recovered" => "0",
     "type" => "store"
   }
 ]}
Link to this function

repositories(opts \\ [])

View Source (since 1.1.0)
@spec repositories(opts()) :: ElasticsearchEx.response()

Returns the snapshot repositories for a cluster.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.repositories(format: :json, v: true)
{:ok, [%{"id" => "repo1", "type" => "fs"}, %{"id" => "repo2", "type" => "s3"}]}
Link to this function

segments(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec segments(nil | index(), opts()) :: ElasticsearchEx.response()

Returns low-level information about the Lucene segments in index shards, similar to the indices segments API.

For data streams, the API returns information about the stream’s backing indices.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.segments(nil, format: :json, v: true)
{:ok,
 [
   %{
     "committed" => "false",
     "compound" => "true",
     "docs.count" => "1",
     "docs.deleted" => "0",
     "generation" => "0",
     "index" => "test",
     "ip" => "127.0.0.1",
     "prirep" => "p",
     "searchable" => "true",
     "segment" => "_0",
     "shard" => "0",
     "size" => "3kb",
     "size.memory" => "0",
     "version" => "9.10.0"
   },
   %{
     "committed" => "false",
     "compound" => "true",
     "docs.count" => "1",
     "docs.deleted" => "0",
     "generation" => "0",
     "index" => "test1",
     "ip" => "127.0.0.1",
     "prirep" => "p",
     "searchable" => "true",
     "segment" => "_0",
     "shard" => "0",
     "size" => "3kb",
     "size.memory" => "0",
     "version" => "9.10.0"
   }
 ]}
Link to this function

shards(index \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec shards(nil | index(), opts()) :: ElasticsearchEx.response()

The shards command is the detailed view of what nodes contain which shards. It will tell you if it’s a primary or replica, the number of docs, the bytes it takes on disk, and the node where it’s located.

For data streams, the API returns information about the stream’s backing indices.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.shards(nil, format: :json, v: true)
{:ok,
 [
   %{
     "dataset" => "18.9kb",
     "docs" => "6",
     "index" => "my-index",
     "ip" => "127.0.0.1",
     "node" => "my-node",
     "prirep" => "p",
     "shard" => "0",
     "state" => "STARTED",
     "store" => "18.9kb"
   }
 ]}
Link to this function

snapshots(repository \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec snapshots(nil | binary(), opts()) :: ElasticsearchEx.response()

Returns information about the snapshots stored in one or more repositories. A snapshot is a backup of an index or running Elasticsearch cluster.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.snapshots(nil, format: :json, v: true, s: "id")
{:ok,
 [
   %{
     "duration" => "4.6m",
     "end_epoch" => "1445616978",
     "end_time" => "18:16:18",
     "failed_shards" => "1",
     "id" => "snap1",
     "indices" => "1",
     "repository" => "repo1",
     "start_epoch" => "1445616705",
     "start_time" => "18:11:45",
     "status" => "FAILED",
     "successful_shards" => "4",
     "total_shards" => "5"
   },
   %{
     "duration" => "6.2m",
     "end_epoch" => "1445634672",
     "end_time" => "23:11:12",
     "failed_shards" => "0",
     "id" => "snap2",
     "indices" => "2",
     "repository" => "repo1",
     "start_epoch" => "1445634298",
     "start_time" => "23:04:58",
     "status" => "SUCCESS",
     "successful_shards" => "10",
     "total_shards" => "10"
   }
 ]}
Link to this function

tasks(opts \\ [])

View Source (since 1.1.0)
@spec tasks(opts()) :: ElasticsearchEx.response()

Returns information about tasks currently executing in the cluster, similar to the task management API.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.tasks(format: :json, v: true)
{:ok,
 [
   %{
     "action" => "cluster:monitor/tasks/lists[n]",
     "ip" => "127.0.0.1:9300",
     "node" => "oTUltX4IQMOUUVeiohTt8A",
     "parent_task_id" => "oTUltX4IQMOUUVeiohTt8A:123",
     "running_time" => "44.1micros",
     "start_time" => "1458585884904",
     "task_id" => "oTUltX4IQMOUUVeiohTt8A:124",
     "timestamp" => "01:48:24",
     "type" => "direct"
   },
   %{
     "action" => "cluster:monitor/tasks/lists",
     "ip" => "127.0.0.1:9300",
     "node" => "oTUltX4IQMOUUVeiohTt8A",
     "parent_task_id" => "-",
     "running_time" => "186.2micros",
     "start_time" => "1458585884904",
     "task_id" => "oTUltX4IQMOUUVeiohTt8A:123",
     "timestamp" => "01:48:24",
     "type" => "transport"
   }
 ]}
Link to this function

templates(template_name \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec templates(nil | binary(), opts()) :: ElasticsearchEx.response()

Returns information about index templates in a cluster. You can use index templates to apply index settings and field mappings to new indices at creation.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.templates("my-template-*", format: :json, v: true, s: "name")
{:ok,
 [
   %{
     "index_patterns" => "[te*]",
     "name" => "my-template-0",
     "order" => "500",
     "version" => "[]"
   },
   %{
     "index_patterns" => "[tea*]",
     "name" => "my-template-1",
     "order" => "501",
     "version" => "[]"
   },
   %{
     "composed_of" => "[]",
     "index_patterns" => "[teak*]",
     "name" => "my-template-2",
     "order" => "502",
     "version" => "7"
   }
 ]}
Link to this function

thread_pool(thread_pool \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec thread_pool(nil | binary(), opts()) :: ElasticsearchEx.response()

Returns thread pool statistics for each node in a cluster. Returned information includes all built-in thread pools and custom thread pools.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.thread_pool(nil, format: :json, v: true, h: "id,name,active,rejected,completed")
{:ok,
 [
   %{
     "active" => "0",
     "completed" => "70",
     "id" => "0EWUhXeBQtaVGlexUeVwMg",
     "name" => "generic",
     "rejected" => "0"
   }
 ]}
Link to this function

trained_models(opts \\ [])

View Source (since 1.1.0)
@spec trained_models(opts()) :: ElasticsearchEx.response()

Returns configuration and usage information about inference trained models.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.trained_models(format: :json, v: true, h: "c,o,l,ct,v")
{:ok,
 [
   %{
     "create_time" => "2020-01-28T12:56:17.138Z",
     "created_by" => "_xpack",
     "id" => "ddddd-1580216177138",
     "license" => "PLATINUM",
     "operations" => "196",
     "version" => "8.0.0"
   },
   %{
     "create_time" => "2020-01-28T12:48:05.537Z",
     "created_by" => "_xpack",
     "id" => "flight-regress-1580215685537",
     "license" => "PLATINUM",
     "operations" => "102",
     "version" => "8.0.0"
   },
   %{
     "create_time" => "2019-12-05T12:28:34.594Z",
     "created_by" => "_xpack",
     "id" => "lang_ident_model_1",
     "license" => "BASIC",
     "operations" => "39629",
     "version" => "7.6.0"
   }
 ]}
Link to this function

transforms(transform_id \\ nil, opts \\ [])

View Source (since 1.1.0)
@spec transforms(nil | binary(), opts()) :: ElasticsearchEx.response()

Returns configuration and usage information about transforms.

Query parameters

Refer to the official documentation for a detailed list of the parameters.

Examples

iex> ElasticsearchEx.Api.Cat.transforms(nil, format: :json, v: true)
{:ok,
 [
   {
     "id" : "ecommerce_transform",
     "state" : "started",
     "checkpoint" : "1",
     "documents_processed" : "705",
     "checkpoint_progress" : "100.00",
     "changes_last_detection_time" : null
   }
 ]}