-
Notifications
You must be signed in to change notification settings - Fork 80
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
"local" parameter only in compatible cat requests #3096
Conversation
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
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.
One question, but if we're comfortable with the duplication this LGTM.
@@ -28,4 +28,15 @@ import { CatRequestBase } from '@cat/_types/CatBase' | |||
* @doc_id cat-nodeattrs | |||
* @cluster_privileges monitor | |||
*/ | |||
export interface Request extends CatRequestBase {} | |||
export interface Request extends CatRequestBase { |
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.
To reduce code duplication, would it help to add a CatWithLocalRequestBase
that each of these can extend?
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.
sure that works too, I'll do it
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 requires a change in the compiler:
elasticsearch-specification/compiler/src/model/build-model.ts
Lines 347 to 349 in 48e2d9d
// CatRequestBase is special as it's a "marker" base class that doesn't imply a property body type. We should get rid of it. | |
} else if (parent.name === 'CatRequestBase' && parent.namespace === 'cat._types') { | |
// nothing to do |
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.
don't think it's worth modifying the compiler for cat, so if it's okay I'd merge it as is
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.
Thanks! The approach looks good. I don't think _cat/indices supports ?local.
/** | ||
* If `true`, the request computes the list of selected nodes from the | ||
* local cluster state. If `false` the list of selected nodes are computed | ||
* from the cluster state of the master node. In both cases the coordinating | ||
* node will send requests for further information to each selected node. | ||
* @server_default false | ||
*/ | ||
local?: boolean |
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.
local isn't in the JSON spec or the source for _cat/indices: https://github.com/elastic/elasticsearch/blob/35c6b60c773917b48c93b428305ba844f6a27903/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java#L59
/** | |
* If `true`, the request computes the list of selected nodes from the | |
* local cluster state. If `false` the list of selected nodes are computed | |
* from the cluster state of the master node. In both cases the coordinating | |
* node will send requests for further information to each selected node. | |
* @server_default false | |
*/ | |
local?: boolean |
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.
it doesn't reject it like the other requests which doesn't support it. I think it just does nothing though, I'm removing it
Following you can find the validation results for the APIs you have changed.
You can validate these APIs yourself by using the |
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.
Thanks! LGTM.
* local parameter only in compatible cat requests * fix import * format * regenerate output * removed local from cat indices (cherry picked from commit 2bf3907) # Conflicts: # output/schema/validation-errors.json
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* local parameter only in compatible cat requests * fix import * format * regenerate output * removed local from cat indices (cherry picked from commit 2bf3907)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* "local" parameter only in compatible cat requests (#3096) * local parameter only in compatible cat requests * fix import * format * regenerate output * removed local from cat indices (cherry picked from commit 2bf3907) # Conflicts: # output/schema/validation-errors.json * Add `local` to cat aliases as it's supported in 8.x --------- Co-authored-by: Laura Trotta <[email protected]>
* "local" parameter only in compatible cat requests (#3096) * local parameter only in compatible cat requests * fix import * format * regenerate output * removed local from cat indices (cherry picked from commit 2bf3907) * Add `local` to cat aliases as it's supported in 8.x --------- Co-authored-by: Laura Trotta <[email protected]>
Followup of #3059, removing
local
from common cat parameters and adding it only to those requests which allow it.I can't test it with java because it has its own handcrafted test types, but it seems straightforward enough.