OpenAPI Türkçe gyrohosting.com ↗

Networking

Reverse DNS and the inbound firewall of a server.

#GET/cloud/servers/{id}/rdns

List reverse DNS entriesScope: cloud_readlistRdnsOpenAPI for this operation

tr-ist-1 (Gyro Bulut İstanbul): every address (primary and additional IPv4) gets an automatic PTR <a-b-c-d>.ip.gyrohosting.com with a matching A record. Set hostname to your own FQDN to replace it (published within seconds); an empty value restores the default. Names under Gyro domains and protected brand names are refused (HTTP 422 with an explanatory message); at most 30 changes per server per hour. The A record of your name should point to the address (forward-confirmed reverse DNS) for e-mail delivery; it is not enforced. When the server is deleted or an additional IP is released, its PTR is removed.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

200PTR records of the server's addresses — data: array<RdnsEntry>
404Not found — also returned for objects owned by someone else

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/rdns' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server rdns list 12345
# resource gyro_server_rdns: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_rdns
resource "gyro_server_rdns" "mail" {
  server_id = gyro_server.web.id
  ip        = gyro_server.web.ipv4
  hostname  = "mail.example.com"
}
import os, uuid, requests

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

Set (or reset) the PTR record of one addressScope: cloud_writesetRdnsOpenAPI for this operation

tr-ist-1 (Gyro Bulut İstanbul): every address (primary and additional IPv4) gets an automatic PTR <a-b-c-d>.ip.gyrohosting.com with a matching A record. Set hostname to your own FQDN to replace it (published within seconds); an empty value restores the default. Names under Gyro domains and protected brand names are refused (HTTP 422 with an explanatory message); at most 30 changes per server per hour. The A record of your name should point to the address (forward-confirmed reverse DNS) for e-mail delivery; it is not enforced. When the server is deleted or an additional IP is released, its PTR is removed. dns_ptr and ptr are accepted as aliases of hostname. Legacy Istanbul VDS servers keep the request flow (status: pending until applied).

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Request body

FieldTypeDescription
ip requiredstringAn address of this server (IPv6 addresses inside the server's /64 are allowed)
hostnamestringFQDN; empty string resets to the default

Responses

200Updated list — data: array<RdnsEntry>
404Not found — also returned for objects owned by someone else
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X PUT 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/rdns' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ip": "string", "hostname": "string"}'
gyro server rdns set 12345 --help    # all flags
# resource gyro_server_rdns: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_rdns
resource "gyro_server_rdns" "mail" {
  server_id = gyro_server.web.id
  ip        = gyro_server.web.ipv4
  hostname  = "mail.example.com"
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/rdns", headers=h, json={"ip": "string", "hostname": "string"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/rdns", {
  method: "PUT",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"ip": "string", "hostname": "string"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#GET/cloud/servers/{id}/firewall

Inbound firewall rulesScope: cloud_readgetFirewallOpenAPI for this operation

Read-only in v1. An empty list means no Gyro firewall is applied (all inbound traffic reaches the server). tr-ist-1: rules come from the network firewall add-on (security groups); without the add-on the list is empty and writes answer 409 firewall_not_enabled.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

200Rules — data: array<FirewallRule>
404Not found — also returned for objects owned by someone else

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server firewall list 12345
# resource gyro_firewall: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/firewall
# Web server: 80/443 open to everyone, SSH only from the office, everything else denied.
resource "gyro_firewall" "web" {
  server_id      = 1234
  default_action = "deny"

  rule {
    action      = "allow"
    protocol    = "tcp"
    port        = "80,443"
    description = "web"
  }
  rule {
    action   = "allow"
    protocol = "udp"
    port     = "443"
  }
  rule {
    action = "allow"
    port   = "22"
    source = "203.0.113.10"
  }
}

# Database: open, but 3306 closed to one address; outbound SMTP blocked.
resource "gyro_firewall" "db" {
  server_id      = 1235
  default_action = "allow"

  rule {
    action = "deny"
    port   = "3306"
    source = "198.51.100.7"
  }
  rule {
    direction = "out"
    action    = "deny"
    port      = "25"
  }
}
import os, uuid, requests

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

Add a firewall ruleScope: cloud_writeaddFirewallRuleOpenAPI for this operation

Network firewall add-on: inserts at priority (default last) and applies as a trial unless permanent. Otherwise the cloud server's simple inbound allow list.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Request body

FieldTypeDescription
priorityintegerPosition (1 = evaluated first). Default = last. First matching rule wins.
directionstring (in, out)in = inbound to the server, out = new outbound connections (network firewall only)
actionstring (allow, deny)
protocolstring (tcp, udp, tcp_udp, icmp, all)
sourcestringany | IPv4/CIDR list (comma separated, max 10). For direction out: the remote address. Country sources (country:XX / not-country:XX) are accepted only when capabilities.country_filter is true (currently not offered).
destinationstringany (all IPs of the server) or one IP address of the server
portstringany | 22 | 80,443 | 1000-2000 (not for icmp/all)
descriptionstring
source_ipsarray<string>Legacy - CIDRs (use source)
permanentbooleanNetwork firewall - skip the 5 minute trial and make the change permanent at once
confirm_warningsbooleanApply even when the change has warnings (lock-out risk, shadowed or duplicate rules, private sources)

Responses

201All rules after the change — data: array<FirewallRule>
404Not found — also returned for objects owned by someone else
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/rules' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"protocol": "tcp", "port": "22", "source_ips": ["203.0.113.0/24"]}'
gyro server firewall rule add 12345 --help    # all flags
# resource gyro_firewall: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/firewall
# Web server: 80/443 open to everyone, SSH only from the office, everything else denied.
resource "gyro_firewall" "web" {
  server_id      = 1234
  default_action = "deny"

  rule {
    action      = "allow"
    protocol    = "tcp"
    port        = "80,443"
    description = "web"
  }
  rule {
    action   = "allow"
    protocol = "udp"
    port     = "443"
  }
  rule {
    action = "allow"
    port   = "22"
    source = "203.0.113.10"
  }
}

# Database: open, but 3306 closed to one address; outbound SMTP blocked.
resource "gyro_firewall" "db" {
  server_id      = 1235
  default_action = "allow"

  rule {
    action = "deny"
    port   = "3306"
    source = "198.51.100.7"
  }
  rule {
    direction = "out"
    action    = "deny"
    port      = "25"
  }
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/rules", headers=h, json={"protocol": "tcp", "port": "22", "source_ips": ["203.0.113.0/24"]}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/rules", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"protocol": "tcp", "port": "22", "source_ips": ["203.0.113.0/24"]}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#DELETE/cloud/servers/{id}/firewall/rules/{n}

Remove a firewall rule (the last one needs confirm)Scope: cloud_writedeleteFirewallRuleOpenAPI for this operation

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)
n requiredpathinteger1-based position from GET /firewall
confirmqueryboolean

Responses

200Remaining rules — data: array<FirewallRule>
404Not found — also returned for objects owned by someone else
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/rules/1' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server firewall rule delete 12345
# resource gyro_firewall: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/firewall
# Web server: 80/443 open to everyone, SSH only from the office, everything else denied.
resource "gyro_firewall" "web" {
  server_id      = 1234
  default_action = "deny"

  rule {
    action      = "allow"
    protocol    = "tcp"
    port        = "80,443"
    description = "web"
  }
  rule {
    action   = "allow"
    protocol = "udp"
    port     = "443"
  }
  rule {
    action = "allow"
    port   = "22"
    source = "203.0.113.10"
  }
}

# Database: open, but 3306 closed to one address; outbound SMTP blocked.
resource "gyro_firewall" "db" {
  server_id      = 1235
  default_action = "allow"

  rule {
    action = "deny"
    port   = "3306"
    source = "198.51.100.7"
  }
  rule {
    direction = "out"
    action    = "deny"
    port      = "25"
  }
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/rules/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/rules/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}`);

#GET/cloud/servers/{id}/firewall/policy

Network firewall policy (rules, default action, status)Scope: cloud_readgetFirewallPolicyOpenAPI for this operation

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

200Policy — data: FirewallPolicy
404Not found — also returned for objects owned by someone else
409The network firewall add-on is not active on this server (firewall_not_enabled)

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/policy' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro firewall get 12345
# resource gyro_firewall: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/firewall
# Web server: 80/443 open to everyone, SSH only from the office, everything else denied.
resource "gyro_firewall" "web" {
  server_id      = 1234
  default_action = "deny"

  rule {
    action      = "allow"
    protocol    = "tcp"
    port        = "80,443"
    description = "web"
  }
  rule {
    action   = "allow"
    protocol = "udp"
    port     = "443"
  }
  rule {
    action = "allow"
    port   = "22"
    source = "203.0.113.10"
  }
}

# Database: open, but 3306 closed to one address; outbound SMTP blocked.
resource "gyro_firewall" "db" {
  server_id      = 1235
  default_action = "allow"

  rule {
    action = "deny"
    port   = "3306"
    source = "198.51.100.7"
  }
  rule {
    direction = "out"
    action    = "deny"
    port      = "25"
  }
}
import os, uuid, requests

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

Replace the network firewall policyScope: cloud_writeputFirewallPolicyOpenAPI for this operation

Applies as a 5 minute trial unless permanent is true; confirm with POST /firewall/policy/confirm. Warnings return 422 confirm_warnings_required with details.warnings.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Request body

FieldTypeDescription
default_actionstring (allow, deny)
pingboolean
rules requiredarray<FirewallRuleInput>
permanentbooleanSkip the 5 minute trial (otherwise call POST /firewall/policy/confirm within 5 minutes or the change is reverted)
confirm_warningsboolean

Responses

200Policy after the change — data: FirewallPolicy
404Not found — also returned for objects owned by someone else
409firewall_not_enabled
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X PUT 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/policy' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"default_action": "deny", "rules": [{"action": "allow", "protocol": "tcp", "port": "80,443", "source": "any"}, {"action": "allow", "protocol": "tcp", "port": "22", "source": "203.0.113.10"}]}'
gyro firewall set 12345 --help    # all flags
# resource gyro_firewall: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/firewall
# Web server: 80/443 open to everyone, SSH only from the office, everything else denied.
resource "gyro_firewall" "web" {
  server_id      = 1234
  default_action = "deny"

  rule {
    action      = "allow"
    protocol    = "tcp"
    port        = "80,443"
    description = "web"
  }
  rule {
    action   = "allow"
    protocol = "udp"
    port     = "443"
  }
  rule {
    action = "allow"
    port   = "22"
    source = "203.0.113.10"
  }
}

# Database: open, but 3306 closed to one address; outbound SMTP blocked.
resource "gyro_firewall" "db" {
  server_id      = 1235
  default_action = "allow"

  rule {
    action = "deny"
    port   = "3306"
    source = "198.51.100.7"
  }
  rule {
    direction = "out"
    action    = "deny"
    port      = "25"
  }
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/policy", headers=h, json={"default_action": "deny", "rules": [{"action": "allow", "protocol": "tcp", "port": "80,443", "source": "any"}, {"action": "allow", "protocol": "tcp", "port": "22", "source": "203.0.113.10"}]}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/policy", {
  method: "PUT",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"default_action": "deny", "rules": [{"action": "allow", "protocol": "tcp", "port": "80,443", "source": "any"}, {"action": "allow", "protocol": "tcp", "port": "22", "source": "203.0.113.10"}]}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#DELETE/cloud/servers/{id}/firewall/policy

Remove your firewall rulesScope: cloud_writedeleteFirewallPolicyOpenAPI for this operation

Removes every customer rule of the server (all traffic allowed). Rules applied by Gyro support stay.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

200Policy after the change — data: FirewallPolicy
404Not found — also returned for objects owned by someone else
409firewall_not_enabled

Examples

curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/policy' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro firewall delete 12345
# resource gyro_firewall: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/firewall
# Web server: 80/443 open to everyone, SSH only from the office, everything else denied.
resource "gyro_firewall" "web" {
  server_id      = 1234
  default_action = "deny"

  rule {
    action      = "allow"
    protocol    = "tcp"
    port        = "80,443"
    description = "web"
  }
  rule {
    action   = "allow"
    protocol = "udp"
    port     = "443"
  }
  rule {
    action = "allow"
    port   = "22"
    source = "203.0.113.10"
  }
}

# Database: open, but 3306 closed to one address; outbound SMTP blocked.
resource "gyro_firewall" "db" {
  server_id      = 1235
  default_action = "allow"

  rule {
    action = "deny"
    port   = "3306"
    source = "198.51.100.7"
  }
  rule {
    direction = "out"
    action    = "deny"
    port      = "25"
  }
}
import os, uuid, requests

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

#POST/cloud/servers/{id}/firewall/policy/confirm

Make the running firewall trial permanentScope: cloud_writeconfirmFirewallPolicyOpenAPI for this operation

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (= service id in the client area)

Responses

200Policy — data: FirewallPolicy
404Not found — also returned for objects owned by someone else
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)

Examples

curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/firewall/policy/confirm' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro firewall confirm 12345
# resource gyro_firewall: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/firewall
# Web server: 80/443 open to everyone, SSH only from the office, everything else denied.
resource "gyro_firewall" "web" {
  server_id      = 1234
  default_action = "deny"

  rule {
    action      = "allow"
    protocol    = "tcp"
    port        = "80,443"
    description = "web"
  }
  rule {
    action   = "allow"
    protocol = "udp"
    port     = "443"
  }
  rule {
    action = "allow"
    port   = "22"
    source = "203.0.113.10"
  }
}

# Database: open, but 3306 closed to one address; outbound SMTP blocked.
resource "gyro_firewall" "db" {
  server_id      = 1235
  default_action = "allow"

  rule {
    action = "deny"
    port   = "3306"
    source = "198.51.100.7"
  }
  rule {
    direction = "out"
    action    = "deny"
    port      = "25"
  }
}
import os, uuid, requests

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

#GET/cloud/servers/{id}/ips

List the server's IPv4 addressesScope: cloud_readlistServerIpsOpenAPI for this operation

Minimum charge: each added IP is billed for at least 6 hours (pricing.minimum_hours): releasing it earlier still bills the minimum (debited at release), and taking the same address again starts a new minimum. At most adds_per_hour addresses (default 10) can be added to a server per 60 minutes. Additional IPv4 addresses are billed per address hourly from the prepaid balance (default 2 EUR per address-month, pricing shows the current price), from the hour they are added until they are released. Up to max per server (default 5). Each address is configured on the server automatically (/32 on the primary interface, kept across reboots and reinstalls); reverse DNS: PUT /cloud/servers/{id}/rdns.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (tr-ist-1)

Responses

200OK — data: ServerIps
404Not found — also returned for objects owned by someone else
409not_actionable (suspended / busy)
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
501not_supported (not a tr-ist-1 Gyro Compute server)

Examples

curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/ips' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server ip list 12345
# resource gyro_server_ip: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_ip
resource "gyro_server_ip" "extra" {
  count     = 2
  server_id = gyro_server.web.id
}

output "extra_ips" {
  value = gyro_server_ip.extra[*].ip
}
import os, uuid, requests

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

Add additional IPv4 addressesScope: cloud_writeaddServerIpsOpenAPI for this operation

Minimum charge: each added IP is billed for at least 6 hours (pricing.minimum_hours): releasing it earlier still bills the minimum (debited at release), and taking the same address again starts a new minimum. At most adds_per_hour addresses (default 10) can be added to a server per 60 minutes. Additional IPv4 addresses are billed per address hourly from the prepaid balance (default 2 EUR per address-month, pricing shows the current price), from the hour they are added until they are released. Up to max per server (default 5). Each address is configured on the server automatically (/32 on the primary interface, kept across reboots and reinstalls); reverse DNS: PUT /cloud/servers/{id}/rdns. Prepaid tr-ist-1 servers only; not while the server is suspended.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (tr-ist-1)

Request body

FieldTypeDescription
countinteger

Responses

201OK — data: ServerIps
404Not found — also returned for objects owned by someone else
409not_actionable (suspended / busy)
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
501not_supported (not a tr-ist-1 Gyro Compute server)

Examples

curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/ips' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"count": 1}'
gyro server ip add 12345 --help    # all flags
# resource gyro_server_ip: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_ip
resource "gyro_server_ip" "extra" {
  count     = 2
  server_id = gyro_server.web.id
}

output "extra_ips" {
  value = gyro_server_ip.extra[*].ip
}
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/ips", headers=h, json={"count": 1}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/ips", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"count": 1}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);

#DELETE/cloud/servers/{id}/ips/{ip}

Release an additional IPv4 addressScope: cloud_writeremoveServerIpOpenAPI for this operation

Minimum charge: each added IP is billed for at least 6 hours (pricing.minimum_hours): releasing it earlier still bills the minimum (debited at release), and taking the same address again starts a new minimum. At most adds_per_hour addresses (default 10) can be added to a server per 60 minutes. The address is removed from the server and returns to the pool (getting the same address back is not guaranteed); billing stops at release (the minimum still applies). Needs confirm=true.

Parameters

FieldinTypeDescription
id requiredpathintegerServer id (tr-ist-1)
ip requiredpathstring
confirm requiredqueryboolean

Responses

200OK — data: ServerIps
404Not found — also returned for objects owned by someone else
409not_actionable (suspended / busy)
422Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
501not_supported (not a tr-ist-1 Gyro Compute server)

Examples

curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/ips/1' \
  -H "Authorization: Bearer $GYRO_TOKEN"
gyro server ip remove 12345
# resource gyro_server_ip: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_ip
resource "gyro_server_ip" "extra" {
  count     = 2
  server_id = gyro_server.web.id
}

output "extra_ips" {
  value = gyro_server_ip.extra[*].ip
}
import os, uuid, requests

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