Vultr: Difference between revisions
From wikinotes
(→API) |
(→API) |
||
Line 19: | Line 19: | ||
-X GET \ | -X GET \ | ||
-H "Authorization: Bearer ${API_KEY}" | -H "Authorization: Bearer ${API_KEY}" | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
curl "https://api.vultr.com/v2/os" | |||
curl "https://api.vultr.com/v2/plans" | jq | grep -e '"id":' -e '"monthly_cost"' | sed 'N;s/\n/ /' | less | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
os_id= | |||
ddos_protection=false | |||
hostname= | |||
curl "https://api.vultr.com/v2/instances" \ | |||
-X POST \ | |||
-H "Authorization: Bearer ${API_KEY}" \ | |||
-d <(cat <<EOF | |||
{ | |||
"region": "ewr", | |||
"plan": "vc2-6c-16gb", | |||
"label": "Example Instance", | |||
"os_id": 215, | |||
"user_data": "QmFzZTY0IEV4YW1wbGUgRGF0YQ==", | |||
"backups": "enabled", | |||
"hostname": "my_hostname" | |||
} | |||
EOF | |||
) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- API --> | </blockquote><!-- API --> |
Revision as of 20:53, 25 September 2022
vultr is another cloud provider, like digitalocean.
it has a wider range of supported OS's, and cheaper rates.
Documentation
home https://www.vultr.com/ api https://www.vultr.com/api/
API
curl "https://api.vultr.com/v2/instances" \ -X GET \ -H "Authorization: Bearer ${API_KEY}"curl "https://api.vultr.com/v2/os" curl "https://api.vultr.com/v2/plans" | jq | grep -e '"id":' -e '"monthly_cost"' | sed 'N;s/\n/ /' | lessos_id= ddos_protection=false hostname= curl "https://api.vultr.com/v2/instances" \ -X POST \ -H "Authorization: Bearer ${API_KEY}" \ -d <(cat <<EOF { "region": "ewr", "plan": "vc2-6c-16gb", "label": "Example Instance", "os_id": 215, "user_data": "QmFzZTY0IEV4YW1wbGUgRGF0YQ==", "backups": "enabled", "hostname": "my_hostname" } EOF )