{
 "openapi": "3.1.0",
 "info": {
  "title": "Gyro Public API",
  "version": "2.30.0",
  "summary": "Manage Gyro cloud servers, SSH keys and billing programmatically.",
  "x-summary-tr": "Gyro bulut sunucularınızı, SSH anahtarlarınızı ve faturalarınızı programla yönetin.",
  "contact": {
   "name": "Gyro Hosting",
   "url": "https://www.gyrohosting.com"
  },
  "license": {
   "name": "Proprietary",
   "identifier": "LicenseRef-Gyro-API-Terms"
  }
 },
 "servers": [
  {
   "url": "https://www.gyrohosting.com/api/v1/client",
   "description": "Production"
  }
 ],
 "paths": {
  "/cloud/servers/{id}/firewall/policy": {
   "delete": {
    "tags": [
     "Networking"
    ],
    "operationId": "deleteFirewallPolicy",
    "summary": "Remove your firewall rules",
    "x-summary-tr": "Güvenlik duvarı kurallarınızı kaldır",
    "description": "Removes every customer rule of the server (all traffic allowed). Rules applied by Gyro support stay.",
    "x-scope": "cloud_write",
    "x-cli": {
     "command": "firewall delete",
     "confirm": true
    },
    "responses": {
     "200": {
      "description": "Policy after the change",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/FirewallPolicy"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "description": "firewall_not_enabled"
     }
    }
   },
   "parameters": [
    {
     "$ref": "#/components/parameters/ServerId"
    }
   ]
  }
 },
 "components": {
  "parameters": {
   "ServerId": {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
     "type": "integer"
    },
    "description": "Server id (= service id in the client area)"
   }
  },
  "responses": {
   "NotFound": {
    "description": "Not found — also returned for objects owned by someone else",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "code",
       "message"
      ],
      "properties": {
       "code": {
        "type": "string",
        "example": "server_not_found"
       },
       "message": {
        "type": "string"
       },
       "details": {
        "type": "object",
        "additionalProperties": true,
        "description": "Extra data. Limit refusals add the LimitHint fields (`limit_exceeded: true`, `limit_key`, `limit`, `current`, `how_to_increase`, `support_ticket`, `hint`): account limits are raised with a support ticket. Validation errors (length, format) never carry the limit hint.",
        "x-description-tr": "Ek veri. Sınır retlerinde LimitHint alanları gelir: hesap sınırları destek talebiyle artırılır. Doğrulama hataları (uzunluk, biçim) sınır ipucu taşımaz."
       }
      }
     }
    }
   },
   "FirewallPolicy": {
    "type": "object",
    "description": "Network firewall of a server (AWS network ACL / ufw model). Rules are evaluated top to bottom, the first match wins; default_action applies to inbound traffic that matches no rule.",
    "properties": {
     "server_id": {
      "type": "integer"
     },
     "engine": {
      "type": "string",
      "enum": [
       "network",
       "cloud"
      ],
      "description": "network = Istanbul core network (allow + deny, inbound + outbound, stateless - see capabilities); cloud = provider firewall (allow rules only, default deny, inbound only)"
     },
     "default_action": {
      "type": "string",
      "enum": [
       "allow",
       "deny"
      ]
     },
     "ping": {
      "type": "boolean"
     },
     "status": {
      "type": "string",
      "enum": [
       "none",
       "applying",
       "trial",
       "active",
       "open",
       "removing"
      ]
     },
     "permanent": {
      "type": "boolean"
     },
     "trial_seconds_left": {
      "type": "integer"
     },
     "busy": {
      "type": "boolean"
     },
     "locked": {
      "type": "boolean",
      "description": "Settings locked by Gyro support"
     },
     "rules": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/FirewallRule"
      }
     },
     "operator_rules": {
      "type": "array",
      "description": "Rules applied by Gyro (read only, evaluated before yours)",
      "items": {
       "$ref": "#/components/schemas/FirewallRule"
      }
     },
     "corrections": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Network addresses corrected on save (e.g. 10.1.2.3/24 -> 10.1.2.0/24)"
     },
     "capabilities": {
      "$ref": "#/components/schemas/FirewallCapabilities"
     }
    }
   },
   "FirewallCapabilities": {
    "type": "object",
    "description": "Features of the firewall platform behind this server. A request that uses a feature marked false is rejected with 422 err_feature_off.",
    "properties": {
     "backend": {
      "type": "string",
      "enum": [
       "stateful",
       "stateless",
       "cloud"
      ],
      "description": "stateless = hardware ACL at the network edge: with default_action deny, replies to connections the server opened are let through automatically (TCP replies, UDP from port 53/123, UDP to udp_return_ports, ICMP replies)."
     },
     "country_filter": {
      "type": "boolean"
     },
     "brute_force": {
      "type": "boolean"
     },
     "port_scan": {
      "type": "boolean"
     },
     "rate_limit": {
      "type": "boolean"
     },
     "outbound_rules": {
      "type": "boolean"
     },
     "security_groups": {
      "type": "boolean"
     },
     "trial": {
      "type": "boolean"
     },
     "counters": {
      "type": "boolean"
     },
     "udp_return_ports": {
      "type": "string",
      "nullable": true,
      "example": "32768-65535"
     }
    }
   },
   "FirewallRule": {
    "type": "object",
    "properties": {
     "direction": {
      "type": "string",
      "enum": [
       "in",
       "out"
      ]
     },
     "priority": {
      "type": "integer",
      "description": "Position (first match wins) - network firewall"
     },
     "type": {
      "type": "string",
      "enum": [
       "rule",
       "brute_force",
       "port_scan"
      ]
     },
     "action": {
      "type": "string",
      "enum": [
       "allow",
       "deny"
      ]
     },
     "source": {
      "type": "string",
      "description": "any | CIDR list | country:XX | not-country:XX"
     },
     "destination": {
      "type": "string",
      "description": "any or one IP of the server"
     },
     "description": {
      "type": "string"
     },
     "threshold": {
      "type": [
       "integer",
       "null"
      ]
     },
     "read_only": {
      "type": "boolean"
     },
     "protocol": {
      "type": "string",
      "example": "tcp"
     },
     "port": {
      "type": [
       "string",
       "null"
      ],
      "example": "22"
     },
     "source_ips": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}