Skip to content

Conversation

@jrodewig
Copy link
Contributor

@jrodewig jrodewig commented Oct 7, 2019

Changes

  • Corrects the request convention for several cat APIs
  • Adds the bytes and time parameters to cat API docs and JSON specs

Closes #30202

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (>docs)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/CAT APIs)

@jrodewig
Copy link
Contributor Author

jrodewig commented Oct 7, 2019

@elasticmachine run elasticsearch-ci/2

1 similar comment
@jrodewig
Copy link
Contributor Author

jrodewig commented Oct 7, 2019

@elasticmachine run elasticsearch-ci/2

A value of `-1` indicates {es} was unable to compute this number.
end::memory[]

tag::name[]
Copy link
Contributor Author

@jrodewig jrodewig Oct 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrodewig jrodewig requested a review from jakelandis October 8, 2019 00:21
@jakelandis
Copy link
Contributor

jakelandis commented Oct 8, 2019

While the parameters are supported for the APIs, they may not influence the result. I think we should only add the documentation to the _cat/ endpoints that are influence by the parameter.

For example GET _cat/aliases?help shows that the following is supported:

alias          | a                | alias name           
index          | i,idx            | index alias points to
filter         | f,fi             | filter               
routing.index  | ri,routingIndex  | index routing        
routing.search | rs,routingSearch | search routing   

These columns are not bytes or time and thus should not document or spec-api declare it's support. It won't error but that feels like an implementation detail/bug with the _cat APIs.

Could you update only those endpoints that will be influenced by the parameters ? I have included a full list below.

GET  _cat/aliases?help
GET _cat/allocation?help
GET _cat/count?help
GET _cat/fielddata?help
GET _cat/health?help
GET _cat/indices?help
GET _cat/master?help
GET _cat/nodeattrs?help
GET _cat/nodes?help
GET _cat/pending_tasks?help
GET _cat/plugins?help
GET _cat/recovery?help
GET _cat/repositories?help
GET _cat/segments?help
GET _cat/shards?help
GET _cat/snapshots?help
GET _cat/tasks?help
GET _cat/templates?help
GET _cat/thread_pool?help

@jakelandis
Copy link
Contributor

jakelandis commented Oct 8, 2019

It won't error but that feels like an implementation detail/bug with the _cat APIs.

I logged #47755 to get better validation around these APIs.

@jrodewig
Copy link
Contributor Author

jrodewig commented Oct 9, 2019

Thanks for the feedback @jakelandis.

I scaled back the changes with 1904efc.
The bytes and time parameters are now documented only when it impacts the response.

@jrodewig
Copy link
Contributor Author

jrodewig commented Oct 9, 2019

@elasticmachine update branch

include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]

include::{docdir}/rest-api/common-parms.asciidoc[tag=time]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one should include bytes too

GET _cat/indices?h=ftt,ss&bytes=g&time=ms

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]

include::{docdir}/rest-api/common-parms.asciidoc[tag=time]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should also include bytes

GET _cat/shards?h=sm&bytes=b

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (pending the two minor changes)

Thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing params in rest-api-specs

3 participants