{
 "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}/templates": {
   "post": {
    "tags": [
     "Templates"
    ],
    "operationId": "createTemplate",
    "summary": "Capture a server as a template",
    "x-summary-tr": "Sunucudan şablon oluştur",
    "x-scope": "cloud_write",
    "x-cli": {
     "command": "template create"
    },
    "description": "Billed 0.05 EUR per GB-month of the space the template really uses, hourly from the prepaid balance (through the account's template storage service, opened with the first template). Deleting a template stops its charge. At most 10 templates; visible only in your account. Only the root disk is copied. `mode: snapshot` (default) keeps the server running (file system frozen briefly via a temporary snapshot); `mode: shutdown` stops the server, copies it and starts it again. Servers created from the template get a new host name, IP, root password, SSH host keys and machine id (cloud-init); your users, files and settings stay. Linux servers only. Ready in about a minute (`status` creating -> ready).",
    "x-description-tr": "Şablonun gerçekten kullandığı alan üzerinden GB başına aylık 0,05 € (ön ödemeli bakiyeden saatlik; ilk şablonla açılan şablon deposu hizmeti üzerinden). Silince ücret durur. En çok 10 şablon; yalnız sizin hesabınızda görünür. Yalnız kök disk alınır. `mode: snapshot` (varsayılan) sunucu açık kalır (geçici anlık görüntü, dosya sistemi kısa süre dondurulur); `mode: shutdown` sunucuyu kapatıp kopyalar ve yeniden açar. Şablondan açılan sunucularda sunucu adı, IP, root parolası, SSH sunucu anahtarları ve makine kimliği yenilenir; kullanıcılarınız, dosyalarınız ve ayarlarınız kalır. Yalnız Linux. Yaklaşık bir dakikada hazır.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Server id (tr-ist-1)"
     }
    ],
    "responses": {
     "202": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "status": {
             "type": "string"
            },
            "server_id": {
             "type": "integer"
            },
            "template": {
             "$ref": "#/components/schemas/Template"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "description": "template_limit, template_not_ready, busy",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     }
    },
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "maxLength": 60
         },
         "description": {
          "type": "string",
          "maxLength": 200
         },
         "mode": {
          "type": "string",
          "enum": [
           "snapshot",
           "shutdown"
          ]
         }
        },
        "required": []
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "responses": {
   "Validation": {
    "description": "Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "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."
       }
      }
     }
    }
   },
   "Template": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "image": {
      "type": "string",
      "description": "Image slug to use for installs: custom:<id>"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "enum": [
       "creating",
       "ready",
       "error",
       "deleting",
       "suspended"
      ],
      "description": "suspended = template storage suspended (balance)"
     },
     "size_gb": {
      "type": "number",
      "description": "Space the template really uses (GB, billed)"
     },
     "size_bytes": {
      "type": "integer"
     },
     "min_disk_gb": {
      "type": "integer",
      "description": "Smallest disk a server from this template can have"
     },
     "base_image": {
      "type": "string"
     },
     "base_image_name": {
      "type": "string"
     },
     "source_server_id": {
      "type": [
       "integer",
       "null"
      ]
     },
     "region": {
      "type": "string"
     },
     "mode": {
      "type": "string",
      "enum": [
       "snapshot",
       "shutdown"
      ],
      "description": "How the template was copied"
     },
     "warnings": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "crash_consistent | extra_disks_excluded"
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "ready_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "pricing": {
      "type": "object",
      "properties": {
       "billing": {
        "type": "string"
       },
       "per_gb_monthly_eur": {
        "type": "number"
       },
       "monthly_eur": {
        "type": "number"
       },
       "hourly_eur": {
        "type": "number"
       }
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}