fachinformatiker-wiki

it's easy when it's here

User Tools

Site Tools


hosting:hetzner:cloud

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
hosting:hetzner:cloud [2026/02/21 00:47] – [Rescale] gsyshosting:hetzner:cloud [2026/02/21 03:02] (current) gsys
Line 6: Line 6:
  
 <code powershell> <code powershell>
-$serverid = "12345678+$env:HETZNER_TOKEN = "<CLOUD-API-TOKEN>
-$servertype = "cx23+$env:HETZNER_SERVER_ID = "12345678
-$token = "<CLOUD-API-TOKEN>"+$env:HETZNER_SERVER_TYPE = "cx23" 
 $body = @{ $body = @{
     upgrade_disk = $true     upgrade_disk = $true
-    server_type  = $servertype+    server_type  = $env:HETZNER_SERVER_TYPE
 } | ConvertTo-Json } | ConvertTo-Json
  
 Invoke-WebRequest ` Invoke-WebRequest `
   -Method Post `   -Method Post `
-  -Headers @{ "Authorization" = "Bearer $token" } ` +  -Headers @{ "Authorization" = "Bearer $env:HETZNER_TOKEN" } ` 
-  -Uri "https://api.hetzner.cloud/v1/servers/$serverid/actions/change_type" `+  -Uri "https://api.hetzner.cloud/v1/servers/$env:HETZNER_SERVER_ID/actions/change_type" `
   -ContentType "application/json" `   -ContentType "application/json" `
   -Body $body `   -Body $body `
   -UseBasicParsing   -UseBasicParsing
  
-Clear-Variable server* +Remove-Item Env:HETZNER_TOKEN 
-Clear-Variable token +Remove-Item Env:HETZNER_SERVER_ID 
-Clear-Variable body+Remove-Item Env:HETZNER_SERVER_TYPE
 </code> </code>
 +https://docs.hetzner.cloud/reference/cloud#tag/server-actions/change_server_type
hosting/hetzner/cloud.1771631267.txt.gz · Last modified: by gsys