Skip to content

Instantly share code, notes, and snippets.

@abdallah
Created July 26, 2012 10:57
Show Gist options
  • Save abdallah/3181493 to your computer and use it in GitHub Desktop.
Save abdallah/3181493 to your computer and use it in GitHub Desktop.
Re-install VPS at RimuHosting
#!/bin/bash
APIKEY=0000000000000000000000000
VPSOID=00000000
VPSNAME=test01.vps
# more info on this per http://apidocs.rimuhosting.com/jaxbdocs/com/rimuhosting/rs/order/OSDPrepUtils.NewVPSRequest.html
# & instantiation_options: http://apidocs.rimuhosting.com/jaxbdocs/com/rimuhosting/rs/order/OSDPrepUtils.InstantiationData.html
create_vps() {
echo Installing ${VPSNAME} ...
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: rimuhosting apikey=$APIKEY" \
--data "{'new_order_request' : {'instantiation_options' : {'domain_name' : '${VPSNAME}' }}}" \
"https://rimuhosting.com/r/orders/new-vps"
}
delete_vps() {
echo Deleting ${VPSNAME} ...
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: rimuhosting apikey=$APIKEY" \
"https://rimuhosting.com/r/orders/order-${VPSOID}-${VPSNAME}/vps"
}
delete_vps
create_vps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment