example to curl a disk image from a public url > streamed into HyperCore REST API PUT to VirtualDisk/upload #15
ddemlow
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
pretty handy one-liner (maybe more useful as shell script)
curls a disk image from a url streamed into curl PUT to VirtualDisk/upload and automatically populates the correct size all in one step!
URL="https://cloud-images.ubuntu.com/minimal/releases/jammy/release-20220810/ubuntu-22.04-minimal-cloudimg-amd64.img";
FILESIZE=$(curl -sI "$URL" | awk '/Content-Length/ {print $2}' | tr -d '\r');
curl -L "$URL" | curl -u admin:admin
-H "Content-Type: application/octet-stream"
-H "Content-Length: $FILESIZE"
-T - -k "https://10.100.15.14/rest/v1/VirtualDisk/upload?filename=ubuntu-22.04-minimal-cloudimg-amd64.img&filesize=$FILESIZE" -vvv
Beta Was this translation helpful? Give feedback.
All reactions