nomad icon indicating copy to clipboard operation
nomad copied to clipboard

optionally return node metadata in NodeListStub

Open tomqwpl opened this issue 10 months ago • 1 comments

Proposal

Currently NodeListStub doesn't contain the node metadata. If you want to get that you have to get the full node information. Propose that NodeStubFields be extended to include "Meta", and if included, populate metadata in the response.

Is there any reason not to include that? Is done deliberately for security reasons for example?

Use-cases

We're migrating from using information provided through the driver to using the dynamic node metadata. NodeListStub contains the driver attributes, but it doesn't contain the node metadata.

Attempted Solutions

Alternative is that having listed the nodes, have to list through and get the full node information for each node just to get the metadata. This will be inefficient for a large number of nodes.

On the face of it this wouldn't appear to be a very complicated change, and I'm happy to try and give it a go if it's likely that a PR along these lines would be accepted. There may be things I'm not aware of though that would prevent it.

tomqwpl avatar Mar 28 '24 18:03 tomqwpl

Hi @tomqwpl! The NodeListStub object deliberately keeps out a lot of fields because the Node object can be arbitrarily large once you count all the node attributes and metadata. For folks running large clusters (ex. 10,000+ nodes), we want them to be able to hit that endpoint to populate the node index UI page without pulling down a ton of data they don't need.

That being said, we have some precedent in the List Nodes API for having querystring parameters that can attach extra information to the object. Ex. resources. If you're game for trying a PR, that'd be a good source of inspiration.

tgross avatar Apr 01 '24 19:04 tgross