Module elasticsearch::cat

source ·
Expand description

Cat APIs

The Cat APIs aim to meet the needs of humans when looking at data returned from Elasticsearch, formatting it as compact, column aligned text, making it easier on human eyes.

Plain text responses

By default, all Cat APIs are configured to send requests with text/plain content-type and accept headers, returning plain text responses

let response = client
    .cat()
    .nodes()
    .send()
    .await?;

let response_body = response.text().await?;

JSON responses

JSON responses can be returned from Cat APIs either by using .format("json")

let response = client
    .cat()
    .nodes()
    .format("json")
    .send()
    .await?;

let response_body = response.json::<Value>().await?;

Or by setting an accept header using .headers()

let response = client
    .cat()
    .nodes()
    .header(ACCEPT, HeaderValue::from_static(DEFAULT_ACCEPT))
    .send()
    .await?;

let response_body = response.json::<Value>().await?;

Column Headers

The column headers to return can be controlled with .h()

let response = client
    .cat()
    .nodes()
    .h(&["ip", "port", "heapPercent", "name"])
    .send()
    .await?;

let response_body = response.json::<String>().await?;

Structs

Enums

API parts for the Cat Aliases API
API parts for the Cat Allocation API
API parts for the Cat Component Templates API
API parts for the Cat Count API
API parts for the Cat Fielddata API
API parts for the Cat Health API
API parts for the Cat Help API
API parts for the Cat Indices API
API parts for the Cat Master API
API parts for the Cat Ml Data Frame Analytics API
API parts for the Cat Ml Datafeeds API
API parts for the Cat Ml Jobs API
API parts for the Cat Ml Trained Models API
API parts for the Cat Nodeattrs API
API parts for the Cat Nodes API
API parts for the Cat Pending Tasks API
API parts for the Cat Plugins API
API parts for the Cat Recovery API
API parts for the Cat Repositories API
API parts for the Cat Segments API
API parts for the Cat Shards API
API parts for the Cat Snapshots API
API parts for the Cat Tasks API
API parts for the Cat Templates API
API parts for the Cat Thread Pool API
API parts for the Cat Transforms API