-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Count API - count the number of documents in an index pattern #6534
Conversation
Let's support both GET and POST here. |
@rashidkpc so the same endpoint, just accessible by either method? Or I should say, the same functionality. |
@rashidkpc added support for GET. Ready for another look. |
|
||
server.route({ | ||
path, | ||
method: 'POST', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this just be ['GET', 'POST']
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I even looked that up yesterday, I guess I didn't have enough coffee this morning. Updated.
LGTM |
Count API - count the number of documents in an index pattern
Required by #6493
Description
This is a simple Kibana API that works similarly to Elasticsearch's _count api. The functionality is pared down and Kibana specific, only allowing you to retrieve the document count for a given index pattern.
Usage
The Count API supports both GET and POST requests for its single endpoint (POST was included so that the API can support a query body down the road, if required).
POST /api/kibana/{index_pattern}/_count
GET /api/kibana/{index_pattern}/_count
Response payload is a simple JSON document e.g.:
Returns 404 if the pattern matches no existing indices.