Skip to content

Expand docs for include_defaults #5052

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

Merged
merged 4 commits into from
Aug 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ export interface Request extends RequestBase {
*/
flat_settings?: boolean
/**
* If `true`, returns default cluster settings from the local node.
* If `true`, also returns default values for all other cluster settings, reflecting the values
* in the `elasticsearch.yml` file of one of the nodes in the cluster. If the nodes in your
* cluster do not all have the same values in their `elasticsearch.yml` config files then the
* values returned by this API may vary from invocation to invocation and may not reflect the
* values that Elasticsearch uses in all situations. Use the `GET _nodes/settings` API to
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm having trouble finding a _nodes/settings API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bizarrely it's the GET /_nodes/{nodeId} path from RestNodesInfoAction, see how we compute metricsOrNodeIds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we say _nodes/{nodeId}/info instead??

I tracked down a couple of commits that suggest GET _nodes/settings actually works as an endpoint: elastic/elasticsearch@f7db7eb (adds the code you mentioned, metricsOrNodeIds) and elastic/elasticsearch@ad50afb. I can't find any documentation around the API, though. There's technically a test RemoteClusterSecurityRestIT#testNodesInfo that uses GET _nodes/settings. I gather that GET /_nodes/settings will return GET /_nodes/_all/settings

I think the _nodes/* API lacks both documentation and testing -- like a user can't look up what GET /_nodes/settings does and find an answer. I'm good with committing this as is, but it'd be great to file a JIRA ticket to address testing and docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GET _nodes/{nodeId}/info isn't a valid endpoint. Here are the nodes info API docs - particularly GET /_nodes/{metric}. We seem to have lost the list of valid metrics, but info isn't one of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened #5094

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohhh, it's GET _nodes/{nodeId}/info/{metrics} -- I didn't have it quite right. Though not in that documentation you linked, anyway... 🤨

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What a mess :) but yeah GET _nodes/_all/info/settings is a longer (but more cohesive) way of getting the same output as GET _nodes/settings

* fetch the settings for each individual node in your cluster.
* @server_default false
*/
include_defaults?: boolean
Expand Down