---
title: "Paket değişikliği ve ek hizmetler — API başvurusu"
description: "Paket yükseltme ve ek hizmet satın alma; bakiyeden ödenir (dry_run, confirm, Idempotency-Key, günlük sınır: hesap başına varsayılan 50 ücretli işlem, "
url: https://www.gyrohosting.com/developers/tr/api/plan-changes-and-add-ons.html
language: tr
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Paket değişikliği ve ek hizmetler

Paket yükseltme ve ek hizmet satın alma; bakiyeden ödenir (dry_run, confirm, Idempotency-Key, günlük sınır: hesap başına varsayılan 50 ücretli işlem, hesap/bayi bazında istisna, 429 daily_limit).

Base URL: `https://www.gyrohosting.com/api/v1/client` · OpenAPI: https://www.gyrohosting.com/developers/openapi.json


## GET /cloud/services/{id}/resize-options

**Hizmetin yükseltilebileceği ürünler ve fiyatları** · operationId `getResizeOptions` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/getResizeOptions.json



**Veri güvencesi (Gyro Bulut İstanbul, tr-ist-1)**: plan değişikliği diski ve içindeki tüm veriyi, IP adreslerini, ek diskleri ve snapshot'ları korur. Kök disk yerinde büyütülür ve dosya sistemi kendiliğinden genişler; disk asla küçülmez, daha küçük diskli plan 409 `disk_shrink` ile reddedilir (`dry_run`'da da; resize-options bu planları `allowed: false` gösterir). Artan CPU/RAM hipervizör izin veriyorsa canlı uygulanır, yoksa sunucu düzgünce kapatılıp yeniden açılır (ölçüm: 1-2 -> 2-4 yeniden başladı, SSH yaklaşık 12 sn yok; 2-4 -> 4-8 canlı, yeniden başlatma yok). Sunucuda snapshot varken disk büyütülemez: 409 `resize_refused` (önce snapshot'ları silin). Yanıtta `data_preserved: true`, `disk: grows_only`, `restart: if_needed`. Veriyi yalnız yeniden kurulum siler (`POST /cloud/servers/{id}/actions/rebuild`, `confirm: true` ister): disk, ek diskler ve snapshot'lar silinir (IP adresleri kalır). **`recreate_required`** (422, yalnız faturalı ürünler): hedef plan hizmetin başka platformda yeniden kurulmasını gerektirir, bu da veriyi siler; API bunu asla yapmaz, hiçbir şey değişmez ve ücret alınmaz. resize-options'tan başka plan seçin ya da yeni sunucu açıp veriyi taşıyın.


### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: Options
- **401**: Missing, invalid or revoked key
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/services/12345/resize-options' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro service resize-option list 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/resize-options", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/resize-options", {
  method: "GET",
  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/services/{id}/resize

**Paketi yükselt (bakiyeden ödenir)** · operationId `resizeService` · scope `cloud_order` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/resizeService.json

dry_run fiyatı döndürür; gerçek değişiklik `"confirm": true` + Idempotency-Key ister. Yükseltme faturası oluşturulur ve bakiyeden ödenir; bakiye yetmezse `awaiting_payment` ve pay_url döner. Sunucuyu yeniden kuracak değişiklikler reddedilir (`recreate_required`).
**Ön ödemeli hizmetler** (Gyro Kapsayıcı, Gyro Bulut İstanbul): fatura yok, confirm/Idempotency-Key gerekmez; resize-options'tan `product_id` ya da `plan` seçin. Yeni saatlik ücret bir sonraki saatten; disk küçülmez; daha büyük plan için bakiye 24 saatlik farkı karşılamalı.

**Veri güvencesi (Gyro Bulut İstanbul, tr-ist-1)**: plan değişikliği diski ve içindeki tüm veriyi, IP adreslerini, ek diskleri ve snapshot'ları korur. Kök disk yerinde büyütülür ve dosya sistemi kendiliğinden genişler; disk asla küçülmez, daha küçük diskli plan 409 `disk_shrink` ile reddedilir (`dry_run`'da da; resize-options bu planları `allowed: false` gösterir). Artan CPU/RAM hipervizör izin veriyorsa canlı uygulanır, yoksa sunucu düzgünce kapatılıp yeniden açılır (ölçüm: 1-2 -> 2-4 yeniden başladı, SSH yaklaşık 12 sn yok; 2-4 -> 4-8 canlı, yeniden başlatma yok). Sunucuda snapshot varken disk büyütülemez: 409 `resize_refused` (önce snapshot'ları silin). Yanıtta `data_preserved: true`, `disk: grows_only`, `restart: if_needed`. Veriyi yalnız yeniden kurulum siler (`POST /cloud/servers/{id}/actions/rebuild`, `confirm: true` ister): disk, ek diskler ve snapshot'lar silinir (IP adresleri kalır). **`recreate_required`** (422, yalnız faturalı ürünler): hedef plan hizmetin başka platformda yeniden kurulmasını gerektirir, bu da veriyi siler; API bunu asla yapmaz, hiçbir şey değişmez ve ücret alınmaz. resize-options'tan başka plan seçin ya da yeni sunucu açıp veriyi taşıyın.


### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |
| `Idempotency-Key` (zorunlu) | header | string | Unique per logical request (e.g. a UUID). Replays within 24 hours return the stored answer. |

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `product_id` | integer | target product from resize-options (or give plan for prepaid services) |
| `price_id` | integer |  |
| `dry_run` | boolean |  |
| `confirm` | boolean |  |
| `plan` | string | prepaid services: plan name from resize-options (alternative to product_id) |

### Yanıtlar

- **202**: Accepted / awaiting_payment (200 for dry_run)
- **401**: Missing, invalid or revoked key
- **404**: Not found — also returned for objects owned by someone else
- **422**: recreate_required (invoiced products: would re-create the service - refused, nothing changed) | invalid_product | confirm_required
- **409**: disk_shrink | resize_refused (has snapshots / busy) | not_actionable

### Örnekler

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/services/12345/resize' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"product_id": 1, "price_id": 1, "dry_run": true, "confirm": true, "plan": "string"}'
```
```bash
gyro service resize 12345 --help    # tüm seçenekler
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
h["Idempotency-Key"] = str(uuid.uuid4())
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/resize", headers=h, json={"product_id": 1, "price_id": 1, "dry_run": True, "confirm": True, "plan": "string"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/resize", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({"product_id": 1, "price_id": 1, "dry_run": true, "confirm": true, "plan": "string"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/services/{id}/addons/available

**Bu hizmete alınabilecek ek hizmetler** · operationId `listAvailableAddons` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listAvailableAddons.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: Add-ons
- **401**: Missing, invalid or revoked key
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons/available' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro service addon available get 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons/available", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons/available", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/services/{id}/addons

**Hizmetin ek hizmetleri** · operationId `listServiceAddons` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listServiceAddons.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |
| `id` (zorunlu) | path | integer |  |

### Yanıtlar

- **200**: Add-ons

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro service addon list 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons", {
  method: "GET",
  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/services/{id}/addons

**Ek hizmet satın al (bakiyeden ödenir)** · operationId `buyAddon` · scope `cloud_order` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/buyAddon.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |
| `Idempotency-Key` (zorunlu) | header | string | Unique per logical request (e.g. a UUID). Replays within 24 hours return the stored answer. |

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `addon_id` (zorunlu) | integer |  |
| `option_id` (zorunlu) | integer |  |
| `quantity` | integer |  |
| `dry_run` | boolean |  |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Accepted / awaiting_payment (200 for dry_run)
- **401**: Missing, invalid or revoked key
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Örnekler

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"addon_id": 1, "option_id": 1, "quantity": 1, "dry_run": true, "confirm": true}'
```
```bash
gyro service addon create 12345 --help    # tüm seçenekler
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
h["Idempotency-Key"] = str(uuid.uuid4())
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons", headers=h, json={"addon_id": 1, "option_id": 1, "quantity": 1, "dry_run": True, "confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({"addon_id": 1, "option_id": 1, "quantity": 1, "dry_run": true, "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/services/{id}/addons/{aid}

**Ön ödemeli ek hizmeti hemen kaldır** · operationId `removeServiceAddon` · scope `cloud_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/removeServiceAddon.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer |  |
| `aid` (zorunlu) | path | integer | add-on record id (GET .../addons) |
| `confirm` (zorunlu) | query | boolean |  |

### Yanıtlar

- **200**: Removed
- **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

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons/1' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro service addon delete 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/services/12345/addons/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```
