Skip to content

Add sorting support to diagnostic APIs #88094

Open
@dakrone

Description

@dakrone

Description

Some of our APIs can be quite large depending on the number of indices or shards in the cluster. To assist a user (or ourselves) finding what they need from some of these APIs, it would be beneficial if we could sort the output of some of these APIs by certain criteria.

An example of this could look like:

GET /_stats?sort=indices.status:desc,indices.uuid:asc
{
  "_shards": {...},
  "_all": {...},
  "indices": {
    "my-index-001920": {
      "uuid": "b-uuid",
      "status": "open",
      …
    },
    "my-index-002812": {
      "uuid": "d-uuid",
      "status": "open",
      …
    },
    "my-index-000120": {
      "uuid": "a-uuid",
      "status": "closed",
      … 
    }
}

This would also be very helpful for pagination (#87555) and filtering (#88095).

Some APIs that could support sorting:

  • Indices stats
  • ILM explain
  • Get indices (settings/mappings/aliases)
  • Index shard stores

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions