Skip to content

Return more Node attributes from Node list api endpoint #25864

Open
@jeffawang

Description

@jeffawang

Proposal

I'd like the node list endpoint to return more node attributes by allowing me to specify them in the query parameters.

Currently, I can pass os=true to /v1/nodes, and the api response returns a mapping! Currently it only reports os.name, but in my use case, I want to get the unique node identifiers, such as unique.platform.aws.instance-id.

Looking at the code here, it looks to me like os.name is hard-coded as the only "key attribute" available in this list.

Use-cases

I want to list nodes and get their aws instance ID, so that I can join it with another dataset from the AWS API.

Attempted Solutions

For now, I'm just calling the list endpoint, then iterating over all the nodes individually.

Specifically, I have been calling the api with the official go client, as well as the CLI via nomad operator api '/v1/nodes?os=true'.

I'd love to be able to do something like nomad operator api '/v1/nodes?unique=true' to instruct the API to return attributes such as unique.platform.aws.instance-id.

Or, if that is too complicated or the query parameter namespace is too crowded, just returning all of the node attributes would work for me.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Needs Roadmapping

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions