hashicorp / hashicorp/nomad

API: Include total resources for a node in the node API responses

Open
#9,241 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

theme/api theme/cli type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

The node API will currently give the following information:

  1. NodeResources: The resources available to nomad, as configured in the client config
  2. ReservedResources: The resources currently reserved by allocations running on the node

What is missing is the total amount of resources as fingerprinted, not necessarily available to nomad.

This would allow us to do things like "X% of available resources are reserved. Y% node resources are available to nomad" without hitting the client stats endpoint like the nomad node status command currently does.

Endpoints affected
  • /v1/nodes?resources=true
  • /v1/node/:node_id

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the handlers and response structures for /v1/nodes?resources=true and /v1/node/:node_id, then locate the existing NodeResources and ReservedResources fields. Confirm how the node's fingerprinted total resources are represented before adding the response field. Done means both endpoints expose the total and the returned values support comparing total, available, and reserved resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.