Repository navigation
Conversation
The API has served signed storage URLs for a sample, its MediaInfo XML
and its extra files for a while, but the CLI could only show where a
file lives, not fetch it. Getting a sample meant the web UI or pasting
a URL into curl.
`sp sample download <id>` asks /samples/{id}/download for the URL and
streams the bytes to disk. The file is written to a temporary name
beside the destination and moved into place only once complete and
checked against the sample's recorded SHA-256, so an interrupted or
corrupt transfer never leaves something that looks like a real
sample. A mismatch gets its own exit code, 11.
The storage URL is fetched without the bearer token: it points at the
bucket, which has no business seeing the platform credential.
--media-info and --extra-file fetch the other two files through their
own routes. Neither has a recorded digest, so both report
verified=false. -d/--dest rather than -o, which already means the
output format one level up.
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.
The API serves signed storage URLs for a sample, its MediaInfo XML and its extra files, but the CLI could only show where a file lives, not fetch it.
sp sample download <id>streams the sample to a temporary name beside the destination and moves it into place only once it is complete and matches the sample's recorded SHA-256. A mismatch exits with code 11. The storage URL is fetched without the bearer token.--media-infoand--extra-filefetch the other two files; neither has a recorded digest, so both reportverified=false.-d/--destsets the destination, since-oalready selects the output format.