Last active
August 29, 2015 14:02
-
-
Save kylog/d98dfc7e709c0878ac93 to your computer and use it in GitHub Desktop.
vcloud one liners
This file contains 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
listvm() { curl --url http://vcloud.delivery.puppetlabs.net/vm 2> /dev/null | ruby -e 'require "json"; JSON.parse(STDIN.read).each { |vm| puts vm }' } | |
getvm() { curl -d --url http://vcloud.delivery.puppetlabs.net/vm/$1 2> /dev/null | ruby -e 'require "json"; resp = JSON.parse(STDIN.read); puts resp["'$1'"]["hostname"]'} | |
sshvm() { ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa-acceptance root@$1 "${@:2}" } | |
rmvm() { curl -X DELETE --url http://vcloud.delivery.puppetlabs.net/vm/$1 } |
I've also added
scpvm() { scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa-acceptance root@$1 $2 }
for when I need to copy files back from the VM. Use it as
scpvm hash:sourcepath target
or scpvm qnox09vbsacexxf:~/logfile logfile
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! Updated. Just ran into this myself.