Sunucu işlemleri
Güç, yeniden kurulum, parola ve kurtarma işlemleri. Eşzamansızdır; live.locked false olana kadar sunucuyu sorgulayın.
#POST/cloud/servers/{id}/actions/{action}
Sunucu işlemi çalıştırKapsam: cloud_writeserverActionBu işlemin OpenAPI parçası
Ağır işlemler (yeniden kurulum, reset, kurtarma, snapshot'tan dönüş, parola sıfırlama) sunucu başına günlük sınırlıdır. Tek seferlik root_password yalnız istekte Idempotency-Key yoksa döner (tekrar için saklanan yanıtlara sır yazılmaz; bu durumda root_password_withheld: true görürsünüz).
tr-ist-1 bölgesi: poweron, shutdown, reboot, poweroff (shutdown ile aynı), rebuild ve reset_password var; reset, enable_rescue ve disable_rescue 422 action_not_supported döner. rebuild sunucunun kendi ürününün imajlarını kabul eder.
2.14.0 (Gyro Compute, tr-ist-1): reset (sert yeniden başlatma) da var; rebuild user_data kabul eder ve sunucunun SSH anahtarlarını yeniden kurar; poweroff sert kapatmadır (shutdown = düzgün kapatma).
2.19.1 (yeniden kurulum + uygulama): bulut sunucularda rebuild app (+ isteğe bağlı app_domain) alır: disk silinir, yeni sistem kurulur ve uygulama üstüne kurulur (ilerleme GET /cloud/servers/{id}/app ve /app/log; giriş bilgileri uygulama durumunda bir kez). app olmadan yeniden kurulum sunucunun önceki uygulama kaydını kapatır (otomatik adresi silinir). Korunanlar: IP adresleri (ek IPv4 dahil), sunucu adı, paket, SSH anahtarları, güvenlik duvarı kuralları; tr-ist-1'de ek diskler ve snapshot'lar silinir, AB/ABD/SG'de volume, snapshot ve yedekler kalır.
rebuild veriyi siler ("confirm": true ister): disk imajdan yeniden oluşur; tr-ist-1'de ek diskler ve snapshot'lar da silinir, IP adresleri, siparişteki SSH anahtarları ve plan kalır. Plan değişikliği (/cloud/services/{id}/resize) veriyi asla silmez.
Parametreler
| Alan | in | Tür | Açıklama |
|---|---|---|---|
id zorunlu | path | integer | Server id (= service id in the client area) |
action zorunlu | path | string (poweron, shutdown, reboot, poweroff, reset, rebuild, reset_password, enable_rescue, disable_rescue) | shutdown = graceful (ACPI), poweroff = hard power cut, reset = hard reset (needs confirm),
rebuild = reinstall from image (needs confirm, wipes the disk), reset_password / enable_rescue
return a one-time root_password.
|
İstek gövdesi
| Alan | Tür | Açıklama |
|---|---|---|
image | string | rebuild only: image slug from /cloud/images |
confirm | boolean | required for reset and rebuild |
user_data | string | rebuild only (tr-ist-1 Gyro Compute): cloud-init for the new system; must start with #cloud-config or #!. Cannot be combined with app. |
app | string | rebuild only: one-click app id from GET /cloud/apps, installed automatically on top of the new system (cloud servers: Gyro Cloud EU/US/SG and Istanbul). The image must be one the app supports (os of the app). Follow the install with GET /cloud/servers/{id}/app and /app/log. Cannot be combined with user_data; at most 3 app installs per server per hour. |
app_domain | string | rebuild with app only: your domain for the app (its A record must point to the server); empty = automatic <ip-with-dashes>.gyroapp.net address. |
Yanıtlar
| 202 | Accepted — data: ActionResult |
| 404 | Not found — also returned for objects owned by someone else |
| 409 | State conflict (server_locked, not_actionable, ssh_key_exists, server_limit, idempotency_in_flight) |
| 422 | Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...) |
Örnekler
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/actions/reboot' \
-H "Authorization: Bearer $GYRO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"image": "ubuntu-24.04", "confirm": true, "user_data": "string", "app": "uptime-kuma", "app_domain": "string"}'gyro server power off 12345 --help # tüm seçeneklerimport os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/actions/reboot", headers=h, json={"image": "ubuntu-24.04", "confirm": True, "user_data": "string", "app": "uptime-kuma", "app_domain": "string"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/actions/reboot", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"image": "ubuntu-24.04", "confirm": true, "user_data": "string", "app": "uptime-kuma", "app_domain": "string"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);#POST/cloud/servers/{id}/console
Tek seferlik VNC konsol bileti alKapsam: cloud_writeopenConsoleBu işlemin OpenAPI parçası
Yaklaşık bir dakika geçerli websocket adresi ve parola döner. Idempotency-Key göndermeyin (400). tr-ist-1'de bilet WebMKS websocket'idir (protocol: webmks, parola boş: adresin kendisi tek seferlik sırdır). 2.14.0 (Gyro Compute): protocol: web, url tarayıcıda açılan tek kullanımlık konsol sayfasıdır (90 sn); eski istemciler için wss_url aynı adresi taşır.
Parametreler
| Alan | in | Tür | Açıklama |
|---|---|---|---|
id zorunlu | path | integer | Server id (= service id in the client area) |
Yanıtlar
| 201 | Ticket — data: object |
| 400 | Malformed request (e.g. missing Idempotency-Key) |
| 404 | Not found — also returned for objects owned by someone else |
| 409 | State conflict (server_locked, not_actionable, ssh_key_exists, server_limit, idempotency_in_flight) |
Örnekler
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/console' \
-H "Authorization: Bearer $GYRO_TOKEN"gyro server console 12345import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/console", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/console", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);#POST/cloud/bulk
Bir eylemi 50 sunucuya kadar toplu çalıştırKapsam: cloud_writebulkServerActionBu işlemin OpenAPI parçası
İstek gövdesi
| Alan | Tür | Açıklama |
|---|---|---|
action zorunlu | string (poweron, shutdown, reboot, poweroff, reset, rebuild, disable_rescue) | |
server_ids zorunlu | array<integer> | |
image | string | |
confirm | boolean |
Yanıtlar
| 207 | Per-target results — data: BulkResult |
| 422 | Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...) |
Örnekler
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/bulk' \
-H "Authorization: Bearer $GYRO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action": "poweron", "server_ids": [1], "image": "string", "confirm": true}'gyro bulk --help # tüm seçeneklerimport os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/bulk", headers=h, json={"action": "poweron", "server_ids": [1], "image": "string", "confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/bulk", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"action": "poweron", "server_ids": [1], "image": "string", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);