feat(cli): show instance backups and their download URLs - #503
Open
stackanthony wants to merge 1 commit into
Open
feat(cli): show instance backups and their download URLs#503stackanthony wants to merge 1 commit into
stackanthony wants to merge 1 commit into
Conversation
Vast takes backups of customer instances and volumes (for example before a machine is decommissioned) into a company-managed bucket. Customers had no way to see that those backups exist, let alone retrieve them. Adds two read-only commands, plus the api and SDK bindings behind them: vastai show instance-backups [--contract-id N] vastai show instance-backup-files CONTRACT_ID The list epilog documents the restore path, which is the point of the feature: `vastai copy vast.CONTRACT_ID:/path INSTANCE_ID:/path`. It also spells out the asymmetry between the two component kinds, since it is not guessable -- an instance's filesystem lives under upper/, while a backed-up volume sits at the root of its own contract id. instance-backup-files prints the authorization token separately from the URLs because the URLs are unusable without it, and surfaces the server's truncated flag: a partial listing must not read as the whole backup when someone is verifying a backup before wiping a machine. Commands live in vastai/ only. The deprecated vast.py is left alone, matching how recent features landed (it is sync'd for removals, not additions). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vastzuby
approved these changes
Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Vast takes backups of customer instances and volumes into a company-managed bucket (e.g. before a machine is decommissioned). Customers currently have no way to see those backups exist, let alone retrieve them. This adds the read side.
Commands
Backing API (already on the webserver):
GET /api/v0/instance_backups/andGET /api/v0/instance_backups/{contract_id}/download/.Changes
vastai/api/storage.pyvastai/cli/commands/storage.pyvastai/cli/display.pyvastai/sdk.pyAdditive only — 152 insertions, no deletions.
Notes for review
vastai/only. The deprecatedvast.pyis untouched, matching how recent features landed there (it gets sync'd for removals, not additions).vastai copy vast.CONTRACT_ID:/path INSTANCE_ID:/path) and the non-guessable asymmetry: an instance's filesystem lives underupper/, while a backed-up volume sits at the root of its own contract id.instance-backup-filesprints the authorization token separately from the URLs, because the URLs 401 without it, and surfaces the server'struncatedflag — a partial listing must not read as the whole backup when someone is verifying before wiping a machine.typereportsunknownfor a contract archived out of the live tables.Testing
Verified end-to-end against a local stack with a real Backblaze account:
/instance_backups/,/instance_backups/?contract_id=N,/instance_backups/N/download/test_tar_utilsfailures plus two network-dependent suites)