---
title: "Yük dengeleyiciler — API başvurusu"
description: "Bulut sunucularınız için yönetilen L4/L7 yük dengeleyici: servisler, sağlık kontrolü, hedefler, ücretsiz Let's Encrypt sertifikası, ölçümler. AB bölge"
url: https://www.gyrohosting.com/developers/tr/api/load-balancers.html
language: tr
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Yük dengeleyiciler

Bulut sunucularınız için yönetilen L4/L7 yük dengeleyici: servisler, sağlık kontrolü, hedefler, ücretsiz Let's Encrypt sertifikası, ölçümler. AB bölgeleri.

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


## GET /cloud/load-balancer-types

**Yük dengeleyici boyutları ve fiyatları** · operationId `listLoadBalancerTypes` · scope `cloud_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listLoadBalancerTypes.json

Sipariş edilebilir boyutlar, sınırlar, bölgeler ve dönem başına EUR fiyatlar (KDV hariç); `list_amount` üstü çizili liste fiyatıdır.


### Yanıtlar

- **200**: Sizes
- **401**: Missing, invalid or revoked key

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancer-types' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb types
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancer-types", 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/load-balancer-types", {
  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/load-balancers

**Yük dengeleyicileri listele** · operationId `listLoadBalancers` · scope `cloud_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listLoadBalancers.json




### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `page` | query | integer |  |
| `limit` | query | integer |  |
| `status` | query | string |  |

### Yanıtlar

- **200**: Load balancers
- **401**: Missing, invalid or revoked key

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb list
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers", 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/load-balancers", {
  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/load-balancers

**Yük dengeleyici sipariş et** · operationId `createLoadBalancer` · scope `cloud_order` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/createLoadBalancer.json

Bakiyeden sipariş + ödeme (sunucularla aynı para kuralları): `"confirm": true`, `Idempotency-Key` başlığı, teklif için `dry_run`. Yaklaşık bir dakikada hazır; sonra servis ve hedef ekleyin.


### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `Idempotency-Key` | header | string |  |

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `size` | string (small, medium, large) |  |
| `product_id` | integer |  |
| `region` | string (eu-de-1, eu-de-2, eu-fi-1) |  |
| `cycle` | string |  |
| `end_customer_id` | integer |  |
| `dry_run` | boolean |  |
| `confirm` | boolean |  |
| `project_id` | integer | Optional project for the new service(s) (0 = default project). Checked before the order: unknown id = 404 `project_not_found` (GyroAPI order endpoints) or 422 `checkout_blocked` with `[project_not_found]` (POST /orders). |

### Yanıtlar

- **201**: Ordered
- **200**: Quote (dry_run)
- **400**: Malformed request (e.g. missing Idempotency-Key)
- **401**: Missing, invalid or revoked key
- **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/load-balancers' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"size": "small", "product_id": 1, "region": "eu-de-1", "cycle": "string", "end_customer_id": 1, "dry_run": true, "confirm": true, "project_id": 1}'
```
```bash
gyro lb create --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```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/load-balancers", headers=h, json={"size": "small", "product_id": 1, "region": "eu-de-1", "cycle": "string", "end_customer_id": 1, "dry_run": True, "confirm": True, "project_id": 1}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({"size": "small", "product_id": 1, "region": "eu-de-1", "cycle": "string", "end_customer_id": 1, "dry_run": true, "confirm": true, "project_id": 1}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/load-balancers/{id}

**Yük dengeleyiciyi getir** · operationId `getLoadBalancer` · scope `cloud_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/getLoadBalancer.json




### Parametreler

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

### Yanıtlar

- **200**: Load balancer
- **401**: Missing, invalid or revoked key
- **404**: Not found — also returned for objects owned by someone else

### Örnekler

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb get 12345
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345", 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/load-balancers/12345", {
  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}`);
```


## DELETE /cloud/load-balancers/{id}

**Yük dengeleyiciyi sil (iptal)** · operationId `deleteLoadBalancer` · scope `cloud_delete` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/deleteLoadBalancer.json

`confirm=true` gerekir. `immediate=true` hemen iptal eder: trafik ve faturalama durur, yük dengeleyici ve sertifikaları hemen kalıcı olarak silinir. immediate yoksa iptal talebi açılır.


### Parametreler

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

### Yanıtlar

- **202**: Cancelling
- **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 DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb delete 12345
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345", 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/load-balancers/12345", {
  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}`);
```


## GET /cloud/load-balancers/{id}/services

**Yük dengeleyicinin servislerini (portlarını) listele** · operationId `typed_get_load_balancers__id__services` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_load_balancers__id__services.json

Servisler, sağlık kontrolü ve HTTP seçenekleriyle; ayrıca sertifikalar ve sınırlar.


### Parametreler

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

### Yanıtlar

- **200**: Tool data / result
- **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

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb service list 12345
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services", 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/load-balancers/12345/services", {
  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/load-balancers/{id}/services

**Servis ekle** · operationId `typed_post_load_balancers__id__services` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_load_balancers__id__services.json

Dinleyici ekler. HTTPS en az bir sertifika ister; TLS yük dengeleyicide sonlanır, hedeflere HTTP gider. Şifreli geçiş için TCP 443.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `protocol` (zorunlu) | string (tcp, http, https) |  |
| `listen_port` (zorunlu) | integer | Port the load balancer listens on |
| `destination_port` (zorunlu) | integer | Port on the targets |
| `proxyprotocol` | boolean | Send PROXY protocol header to targets |
| `hc_protocol` | string (tcp, http) | Health check type |
| `hc_port` | integer |  |
| `hc_interval` | integer | 3-60 s |
| `hc_timeout` | integer | 1-30 s, below interval |
| `hc_retries` | integer | 0-5 |
| `hc_path` | string | HTTP check path (starts with /) |
| `hc_domain` | string | HTTP check Host header |
| `hc_status_codes` | string | Comma separated, e.g. 2??,3?? |
| `hc_tls` | boolean | HTTP check over TLS |
| `sticky` | boolean | Sticky sessions (cookie) |
| `cookie_name` | string |  |
| `cookie_lifetime` | integer |  |
| `idle_timeout` | integer | Idle timeout (s) |
| `certificates` | string | HTTPS: comma separated certificate ids of this load balancer |
| `redirect_http` | boolean | HTTPS: redirect port 80 to HTTPS (port 80 must be free) |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"protocol": "tcp", "listen_port": 1, "destination_port": 1, "proxyprotocol": true, "hc_protocol": "tcp", "hc_port": 1, "hc_interval": 1, "hc_timeout": 1, "hc_retries": 1, "hc_path": "string", "hc_domain": "string", "hc_status_codes": "string", "hc_tls": true, "sticky": true, "cookie_name": "string", "cookie_lifetime": 1, "idle_timeout": 1, "certificates": "string", "redirect_http": true, "confirm": true}'
```
```bash
gyro lb service add 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services", headers=h, json={"protocol": "tcp", "listen_port": 1, "destination_port": 1, "proxyprotocol": True, "hc_protocol": "tcp", "hc_port": 1, "hc_interval": 1, "hc_timeout": 1, "hc_retries": 1, "hc_path": "string", "hc_domain": "string", "hc_status_codes": "string", "hc_tls": True, "sticky": True, "cookie_name": "string", "cookie_lifetime": 1, "idle_timeout": 1, "certificates": "string", "redirect_http": 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/load-balancers/12345/services", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"protocol": "tcp", "listen_port": 1, "destination_port": 1, "proxyprotocol": true, "hc_protocol": "tcp", "hc_port": 1, "hc_interval": 1, "hc_timeout": 1, "hc_retries": 1, "hc_path": "string", "hc_domain": "string", "hc_status_codes": "string", "hc_tls": true, "sticky": true, "cookie_name": "string", "cookie_lifetime": 1, "idle_timeout": 1, "certificates": "string", "redirect_http": true, "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## PATCH /cloud/load-balancers/{id}/services/{port}

**Servisi güncelle** · operationId `typed_patch_load_balancers__id__services__port` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_patch_load_balancers__id__services__port.json

{port} servisinin seçeneklerini değiştirir. Protokol değişmez (silip ekleyin).


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `destination_port` | integer | Port on the targets |
| `proxyprotocol` | boolean | Send PROXY protocol header to targets |
| `hc_protocol` | string (tcp, http) | Health check type |
| `hc_port` | integer |  |
| `hc_interval` | integer | 3-60 s |
| `hc_timeout` | integer | 1-30 s, below interval |
| `hc_retries` | integer | 0-5 |
| `hc_path` | string | HTTP check path (starts with /) |
| `hc_domain` | string | HTTP check Host header |
| `hc_status_codes` | string | Comma separated, e.g. 2??,3?? |
| `hc_tls` | boolean | HTTP check over TLS |
| `sticky` | boolean | Sticky sessions (cookie) |
| `cookie_name` | string |  |
| `cookie_lifetime` | integer |  |
| `idle_timeout` | integer | Idle timeout (s) |
| `certificates` | string | HTTPS: comma separated certificate ids of this load balancer |
| `redirect_http` | boolean | HTTPS: redirect port 80 to HTTPS (port 80 must be free) |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X PATCH 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services/1' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"destination_port": 1, "proxyprotocol": true, "hc_protocol": "tcp", "hc_port": 1, "hc_interval": 1, "hc_timeout": 1, "hc_retries": 1, "hc_path": "string", "hc_domain": "string", "hc_status_codes": "string", "hc_tls": true, "sticky": true, "cookie_name": "string", "cookie_lifetime": 1, "idle_timeout": 1, "certificates": "string", "redirect_http": true, "confirm": true}'
```
```bash
gyro lb service update 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.patch("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services/1", headers=h, json={"destination_port": 1, "proxyprotocol": True, "hc_protocol": "tcp", "hc_port": 1, "hc_interval": 1, "hc_timeout": 1, "hc_retries": 1, "hc_path": "string", "hc_domain": "string", "hc_status_codes": "string", "hc_tls": True, "sticky": True, "cookie_name": "string", "cookie_lifetime": 1, "idle_timeout": 1, "certificates": "string", "redirect_http": 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/load-balancers/12345/services/1", {
  method: "PATCH",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"destination_port": 1, "proxyprotocol": true, "hc_protocol": "tcp", "hc_port": 1, "hc_interval": 1, "hc_timeout": 1, "hc_retries": 1, "hc_path": "string", "hc_domain": "string", "hc_status_codes": "string", "hc_tls": true, "sticky": true, "cookie_name": "string", "cookie_lifetime": 1, "idle_timeout": 1, "certificates": "string", "redirect_http": true, "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/load-balancers/{id}/services/{port}

**Servisi sil** · operationId `typed_delete_load_balancers__id__services__port` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_load_balancers__id__services__port.json

{port} portundaki dinlemeyi durdurur. `"confirm": true` gerekir.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services/1' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro lb service delete 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/services/1", headers=h, json={"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/load-balancers/12345/services/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/load-balancers/{id}/targets

**Hedefleri sağlık durumuyla listele** · operationId `typed_get_load_balancers__id__targets` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_load_balancers__id__targets.json

Hedefler, servis başına sağlık durumu ve eklenebilecek bulut sunucular / fiziksel sunucu IP'leri.


### Parametreler

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

### Yanıtlar

- **200**: Tool data / result
- **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

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/targets' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb target list 12345
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/targets", 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/load-balancers/12345/targets", {
  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/load-balancers/{id}/targets

**Hedef ekle** · operationId `typed_post_load_balancers__id__targets` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_load_balancers__id__targets.json

type=server (server = bulut sunucu hizmet no, aynı bölge), type=all (tüm bulut sunucularınız, yeniler otomatik) ya da type=ip (fiziksel sunucu IP'niz). use_private_ip için özel ağ bağlı olmalı.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `type` (zorunlu) | string (server, all, ip) |  |
| `server` | integer | Cloud server id (type=server) |
| `ip` | string | Dedicated server IP (type=ip) |
| `use_private_ip` | boolean |  |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/targets' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"type": "server", "server": 1, "ip": "string", "use_private_ip": true, "confirm": true}'
```
```bash
gyro lb target add 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/targets", headers=h, json={"type": "server", "server": 1, "ip": "string", "use_private_ip": 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/load-balancers/12345/targets", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"type": "server", "server": 1, "ip": "string", "use_private_ip": true, "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/load-balancers/{id}/targets

**Hedefi çıkar** · operationId `typed_delete_load_balancers__id__targets` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_load_balancers__id__targets.json

Eklemedeki alanlar; sorguda (?type=server&server=123&confirm=true) ya da JSON gövdede. `"confirm": true` gerekir.


### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer | Service id |
| `type` | query | string | server / all / ip |
| `server` | query | string | Cloud server id |
| `ip` | query | string | Dedicated server IP |

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `type` | string |  |
| `server` | integer |  |
| `ip` | string |  |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/targets' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"type": "string", "server": 1, "ip": "string", "confirm": true}'
```
```bash
gyro lb target remove 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/targets", headers=h, json={"type": "string", "server": 1, "ip": "string", "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/load-balancers/12345/targets", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"type": "string", "server": 1, "ip": "string", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/load-balancers/{id}/certificates

**Sertifikaları listele** · operationId `typed_get_load_balancers__id__certificates` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_load_balancers__id__certificates.json

Yüklenen ve Let's Encrypt sertifikaları (Let's Encrypt kendiliğinden yenilenir), bekleyen istek ve doğrulama yönlendirme adresi.


### Parametreler

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

### Yanıtlar

- **200**: Tool data / result
- **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

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb cert list 12345
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates", 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/load-balancers/12345/certificates", {
  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/load-balancers/{id}/certificates

**Sertifika yükle** · operationId `typed_post_load_balancers__id__certificates` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_load_balancers__id__certificates.json

PEM sertifika zinciri + şifresiz özel anahtar. Anahtar yalnız yük dengeleyiciye gönderilir; panelde saklanmaz, loglanmaz.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `name` | string |  |
| `certificate` (zorunlu) | string | PEM chain |
| `private_key` (zorunlu) | string | PEM key (unencrypted) |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "certificate": "string", "private_key": "string", "confirm": true}'
```
```bash
gyro lb cert upload 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates", headers=h, json={"name": "string", "certificate": "string", "private_key": "string", "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/load-balancers/12345/certificates", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "string", "certificate": "string", "private_key": "string", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/load-balancers/{id}/certificates/letsencrypt

**Ücretsiz Let's Encrypt sertifikası iste** · operationId `typed_post_load_balancers__id__certificates_letsencrypt` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_load_balancers__id__certificates_letsencrypt.json

A kaydı bu yük dengeleyiciye yönlenmiş en çok 10 ad. Hedefleriniz /.well-known/acme-challenge/<token> isteklerini GET certificates'taki adrese yönlendirmeli; `acme=waiting` yanıtı ad başına kontrolü verir, yönlendirmeyi düzeltip verify çağırın.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `domains` (zorunlu) | string | Comma separated names |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/letsencrypt' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains": "string", "confirm": true}'
```
```bash
gyro lb cert letsencrypt 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/letsencrypt", headers=h, json={"domains": "string", "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/load-balancers/12345/certificates/letsencrypt", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"domains": "string", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/load-balancers/{id}/certificates/letsencrypt

**Bekleyen Let's Encrypt isteğini iptal et** · operationId `typed_delete_load_balancers__id__certificates_letsencrypt` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_load_balancers__id__certificates_letsencrypt.json

Bekleyen isteği bırakır. `"confirm": true` gerekir.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/letsencrypt' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro lb cert cancel 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/letsencrypt", headers=h, json={"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/load-balancers/12345/certificates/letsencrypt", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/load-balancers/{id}/certificates/letsencrypt/verify

**Bekleyen Let's Encrypt isteğini sürdür** · operationId `typed_post_load_balancers__id__certificates_letsencrypt_verify` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_load_balancers__id__certificates_letsencrypt_verify.json

Yönlendirmeyi yeniden dener, doğrulatır ve sertifikayı yükler (`acme=issued`).


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/letsencrypt/verify' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro lb cert verify 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/letsencrypt/verify", headers=h, json={"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/load-balancers/12345/certificates/letsencrypt/verify", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/load-balancers/{id}/certificates/{cid}

**Sertifikayı sil** · operationId `typed_delete_load_balancers__id__certificates__cid` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_load_balancers__id__certificates__cid.json

Yalnız bir serviste kullanılmayan sertifikalar. `"confirm": true` gerekir.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/1' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro lb cert delete 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/certificates/1", headers=h, json={"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/load-balancers/12345/certificates/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/load-balancers/{id}/settings

**Algoritma, ters DNS, özel ağ** · operationId `typed_get_load_balancers__id__settings` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_load_balancers__id__settings.json

Algoritma, PTR kayıtları, aynı bölgedeki özel ağlarınız ve sınırlar.


### Parametreler

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

### Yanıtlar

- **200**: Tool data / result
- **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

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/settings' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb settings 12345
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/settings", 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/load-balancers/12345/settings", {
  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}`);
```


## PUT /cloud/load-balancers/{id}/algorithm

**Dağıtım algoritmasını değiştir** · operationId `typed_put_load_balancers__id__algorithm` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_put_load_balancers__id__algorithm.json

round_robin ya da least_connections.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `algorithm` (zorunlu) | string (round_robin, least_connections) |  |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X PUT 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/algorithm' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"algorithm": "round_robin", "confirm": true}'
```
```bash
gyro lb algorithm set 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/algorithm", headers=h, json={"algorithm": "round_robin", "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/load-balancers/12345/algorithm", {
  method: "PUT",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"algorithm": "round_robin", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## PUT /cloud/load-balancers/{id}/rdns

**Ters DNS ayarla** · operationId `typed_put_load_balancers__id__rdns` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_put_load_balancers__id__rdns.json

Yük dengeleyici IP'lerinden biri için PTR; boş değer varsayılana döndürür.


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `ip` (zorunlu) | string |  |
| `ptr` | string |  |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X PUT 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/rdns' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ip": "string", "ptr": "string", "confirm": true}'
```
```bash
gyro lb rdns set 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/rdns", headers=h, json={"ip": "string", "ptr": "string", "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/load-balancers/12345/rdns", {
  method: "PUT",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"ip": "string", "ptr": "string", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/load-balancers/{id}/network

**Özel ağa bağla** · operationId `typed_post_load_balancers__id__network` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_load_balancers__id__network.json

Aynı bölgedeki özel ağlarınızdan biri (GET settings).


### Parametreler

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

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `network` (zorunlu) | integer |  |
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/network' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"network": 1, "confirm": true}'
```
```bash
gyro lb network attach 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/network", headers=h, json={"network": 1, "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/load-balancers/12345/network", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"network": 1, "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/load-balancers/{id}/network/{nid}

**Özel ağdan ayır** · operationId `typed_delete_load_balancers__id__network__nid` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_load_balancers__id__network__nid.json

Özel IP kullanan hedefler önce çıkarılmalı. `"confirm": true` gerekir.


### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer | Service id |
| `nid` (zorunlu) | path | string | Private network id |

### İstek gövdesi

| Alan | Tür | Açıklama |
|---|---|---|
| `confirm` | boolean |  |

### Yanıtlar

- **202**: Tool data / result
- **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

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/network/1' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro lb network detach 12345 --help    # tüm seçenekler
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/network/1", headers=h, json={"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/load-balancers/12345/network/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/load-balancers/{id}/metrics

**Yük dengeleyici ölçümleri** · operationId `typed_get_load_balancers__id__metrics` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_load_balancers__id__metrics.json

Açık bağlantı, yeni bağlantı/sn, istek/sn, bant genişliği (Mbit/s).


### Parametreler

| Alan | in | Tür | Açıklama |
|---|---|---|---|
| `id` (zorunlu) | path | integer | Service id |
| `period` | query | string | 24h / 7d / 30d |

### Yanıtlar

- **200**: Tool data / result
- **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

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/metrics' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro lb metrics 12345
```
```hcl
# kaynak gyro_load_balancer: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/load_balancer
# Two cloud servers behind a managed load balancer (EU regions: eu-de-1, eu-de-2, eu-fi-1).
resource "gyro_server" "web" {
  count         = 2
  plan          = "standart-2-4"
  region        = "eu-de-1"
  image         = "ubuntu-24.04"
  hostname      = "web-${count.index + 1}.example.com"
  confirm_order = true
}

resource "gyro_load_balancer" "web" {
  size          = "small" # small | medium | large (GET /cloud/load-balancer-types)
  region        = "eu-de-1"
  algorithm     = "least_connections"
  confirm_order = true # creating a load balancer is a paid order from your account balance

  services = [
    {
      protocol         = "http"
      listen_port      = 80
      destination_port = 80
      sticky_sessions  = true
      health_check     = { protocol = "http", path = "/healthz", interval = 10, timeout = 5, retries = 3 }
    },
    {
      # TLS passthrough: certificates stay on the servers
      protocol         = "tcp"
      listen_port      = 443
      destination_port = 443
    },
  ]

  targets = [for s in gyro_server.web : { type = "server", server_id = tonumber(s.id) }]
}

output "load_balancer_ip" {
  value = gyro_load_balancer.web.ipv4 # point your A record here
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/load-balancers/12345/metrics", 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/load-balancers/12345/metrics", {
  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}`);
```
