Description
Java API client version
8.10.3
Java version
20.0.2
Elasticsearch Version
8.9.0
Problem description
Using the rest endpoint _nodes/process I was accessing the
node[].name
node[].version
node[].roles
The endpoint nodes().stats().nodes() only returns name and roles but not the node version.
co.elastic.clients.elasticsearch.nodes.Stats resp. co.elastic.clients.elasticsearch.nodes.Stats.Builder used in co.elastic.clients.elasticsearch.nodes.NodesStatsResponse doesn't contain a version field.
However, the java API doesn't allow to request only the basic information + process but always transfers everything to be deserialized.
Expected in .nodes().stats(s->s.fields("process")) only the process field is being requested and all other fields (except basic information) is null, butt all data is requested and requested and returned.
reducing the responded fields must be done using metrics:
client.nodes().stats(s->s.metric("process"))