feat: [PR-1697] sf nodes ssh supports v2/nodes
#249
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
v2/nodes/{id}/sshendpoint first for SSH info, falling back to thev0/vms/sshendpoint if it fails (including 401)apiClientfor the v0 fallback instead of rawfetch+getApiUrlSshInfotype*.v2.nodes.sfcompute.devvs*.vms.sfcompute.dev)Context
This is a stepping stone toward supporting
sf nodes sshfor the new capacities API. The v2 endpoint will serve capacities nodes going forward, while the v0/vms fallback keeps existing Nodes API users working during the deprecation window. Once the Nodes API is fully deprecated, the v0 fallback can be removed. For capacities nodes, we can use the nano ID prefix to route to the correct endpoint, avoiding ambiguity with legacy node names/IDs.Test plan
sf nodes ssh root@<node-name>connects successfully via v2 endpointsf nodes ssh root@<vm-id>falls back to v0 endpoint and connectssf nodes ssh root@<node-name> --jsonreturns SSH info JSON🤖 Generated with Claude Code