fachinformatiker-wiki

it's easy when it's here

User Tools

Site Tools


hosting:hetzner:cloud

API

Rescale

PowerShell

$env:HETZNER_TOKEN = "<CLOUD-API-TOKEN>"
$env:HETZNER_SERVER_ID = "12345678"
$env:HETZNER_SERVER_TYPE = "cx23"
 
$body = @{
    upgrade_disk = $true
    server_type  = $env:HETZNER_SERVER_TYPE
} | ConvertTo-Json
 
Invoke-WebRequest `
  -Method Post `
  -Headers @{ "Authorization" = "Bearer $env:HETZNER_TOKEN" } `
  -Uri "https://api.hetzner.cloud/v1/servers/$env:HETZNER_SERVER_ID/actions/change_type" `
  -ContentType "application/json" `
  -Body $body `
  -UseBasicParsing
 
Remove-Item Env:HETZNER_TOKEN
Remove-Item Env:HETZNER_SERVER_ID
Remove-Item Env:HETZNER_SERVER_TYPE

https://docs.hetzner.cloud/reference/cloud#tag/server-actions/change_server_type

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.  More information about cookies 
hosting/hetzner/cloud.txt · Last modified: by gsys