Skip to content

Add GetNodeByNodeKey API endpoint for O(1) node lookup#3138

Open
sbatista-uc wants to merge 3 commits into
juanfont:mainfrom
MCP-Manager:feat/get-node-by-key-clean
Open

Add GetNodeByNodeKey API endpoint for O(1) node lookup#3138
sbatista-uc wants to merge 3 commits into
juanfont:mainfrom
MCP-Manager:feat/get-node-by-key-clean

Conversation

@sbatista-uc
Copy link
Copy Markdown

Expose the existing in-memory NodeStore.GetNodeByNodeKey as a gRPC/REST endpoint at GET /api/v1/node/by-node-key/{node_key}. Returns the full Node proto including the online status field.

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

#3137

sbatista-uc and others added 2 commits March 11, 2026 23:14
Instead of listing all nodes and filtering client-side, this exposes the
existing in-memory NodeStore.GetNodeByNodeKey as a gRPC/REST endpoint at
GET /api/v1/node/by-node-key/{node_key}. Returns the full Node proto
including the online status field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests cover: successful lookup, not-found, invalid key formats
(empty, garbage, truncated), and online status field population.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sbatista-uc
Copy link
Copy Markdown
Author

@kradalby can you weigh in on the addition of this endpoint? Now that #1711 is addressed this missing endpoint is the only reason why I need a fork at all.

…t/get-node-by-key-clean

# Conflicts:
#	hscontrol/grpcv1_test.go
@kradalby
Copy link
Copy Markdown
Collaborator

There is an upcoming milestone where we likely will replace the api so I have not spent any time on anything that would change the current one as it likely will be replaced again. #2305

@sbatista-uc
Copy link
Copy Markdown
Author

Sounds good, as you refactor the API I would appreciate if you keep in mind my request to get a node by ID. Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants