-
Notifications
You must be signed in to change notification settings - Fork 115
add enum values for Metric and IndexMetrics path params #5635
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
base: main
Are you sure you want to change the base?
add enum values for Metric and IndexMetrics path params #5635
Conversation
|
Following you can find the validation changes against the target branch for the API.
You can validate this API yourself by using the |
|
Wondering if this case is similar to @pquentin recent related PR in a way that the server accepts combinations of multiple of these enum values (flags). We should define an alias: if that's the case. |
pquentin
left a comment
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.
Sorry, as discussed offline last week, I did not know that you were working on fixing those APIs. I did it for another reason, namely #5215.
That said, on the docs side, we also need descriptions of the enum values. This documented enum:
elasticsearch-specification/specification/_types/common.ts
Lines 193 to 207 in 4d3b72e
| /** | |
| * Type of index that wildcard expressions can match. | |
| */ | |
| export enum ExpandWildcard { | |
| /** Match any data stream or index, including hidden ones. */ | |
| all, | |
| /** Match open, non-hidden indices. Also matches any non-hidden data stream. */ | |
| open, | |
| /** Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. */ | |
| closed, | |
| /** Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`. */ | |
| hidden, | |
| /** Wildcard expressions are not accepted. */ | |
| none | |
| } |
renders like this:
| export enum Metrics { | ||
| adaptive_selection, | ||
| allocations, | ||
| breaker, | ||
| discovery, | ||
| fs, | ||
| http, | ||
| indexing_pressure, | ||
| indices, | ||
| ingest, | ||
| jvm, | ||
| os, | ||
| process, | ||
| repositories, | ||
| thread_pool, | ||
| transport | ||
| } |
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.
This enum is not used. But I already defined it as NodeStatsMetric in specification/nodes/stats/NodesStatsRequest.ts anyway, with a few values that were missing in the 8.x docs so far.
| index_metric?: CommonStatsFlags | ||
| index_metric?: IndexMetrics |
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.
CommonStatsFlag is the name of the enum in the server code, so that was already correct. (Your version is also missing _all that is accepted by the server too.)
Linked to #360
adds enums for Metrics and IndexMetrics for node stats endpoint
Added the enum values by referring the 8.19 docs