{
 "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}/storage-mounts": {
   "post": {
    "tags": [
     "Object storage"
    ],
    "operationId": "createStorageMount",
    "summary": "Mount a bucket on the server",
    "x-summary-tr": "Kovayı sunucuya bağla",
    "x-scope": "cloud_write",
    "x-cli": {
     "command": "server storage-mount create"
    },
    "description": "Mount a bucket of your Gyro Object Storage service on a Linux server (systemd) as a folder (rclone FUSE mount with a local write cache, starts on boot, reconnects). Each mount gets its own access key limited to that one bucket (read-only or read/write); it does not use your key limit and is deleted with the mount. Gyro Cloud Istanbul (tr-ist-1) servers apply it automatically (`automatic: true`); other servers run `install_command` once. Free; S3 traffic counts towards the storage service. Supported servers: Gyro Cloud (Istanbul and EU), Turkey VDS, dedicated servers. The answer carries `install_command` (single use, 60 minutes). **Protected Storage (2.20.0):** supported; read-only unless `read_only: false` together with `accept_versioning: true`.",
    "x-description-tr": "Nesne Depolama hizmetinizdeki bir kovayı Linux sunucunuza (systemd) klasör olarak bağlar (rclone FUSE, yerel yazma önbelleği, açılışta başlar, kopunca yeniden bağlanır). Her bağlantının yalnız o kovaya yetkili (salt okuma ya da okuma/yazma) ayrı bir erişim anahtarı vardır; anahtar sınırınızdan düşmez, bağlantıyla birlikte silinir. Gyro Bulut İstanbul (tr-ist-1) sunucularında otomatik uygulanır (`automatic: true`); diğer sunucularda `install_command` bir kez çalıştırılır. Ücretsizdir; S3 trafiği depolama hizmetinden sayılır.  Yanıtta `install_command` döner (tek kullanımlık, 60 dakika). **Korumalı Depolama (2.20.0):** desteklenir; `read_only: false` ve `accept_versioning: true` verilmedikçe salt okuma bağlanır.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Server service id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "storage_service_id",
         "bucket"
        ],
        "properties": {
         "storage_service_id": {
          "type": "integer",
          "description": "your active Object Storage service"
         },
         "bucket": {
          "type": "string",
          "description": "bucket name in that service",
          "example": "backups"
         },
         "mount_point": {
          "type": "string",
          "description": "absolute path under /mnt, /srv, /data, /media, /opt, /home or /var/www; default /mnt/<bucket>. Must be empty or missing on the server.",
          "example": "/mnt/backups"
         },
         "read_only": {
          "type": "boolean",
          "description": "Default: false on Object Storage, **true on Protected Storage**."
         },
         "accept_versioning": {
          "type": "boolean",
          "default": false,
          "description": "Protected Storage read/write only: confirms that every write/overwrite creates a new version, deletes only add a delete marker, locked files cannot be deleted and used space/cost grow. Without it: 422 versioning_ack_required."
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "storage_mount": {
             "$ref": "#/components/schemas/StorageMount"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "description": "server_not_active | storage_not_active | limit | mount_point_in_use | mount_point_nested | not_live",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "invalid_bucket | invalid_mount_point | versioning_ack_required (Protected Storage read/write without accept_versioning) | storage_error"
     },
     "429": {
      "description": "rate_limited"
     },
     "503": {
      "description": "storage_mount_unavailable"
     }
    }
   }
  }
 },
 "components": {
  "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."
       }
      }
     }
    }
   },
   "StorageMount": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "server_id": {
      "type": "integer"
     },
     "storage_service_id": {
      "type": "integer"
     },
     "bucket": {
      "type": "string",
      "description": "bucket name at the time of mounting (renaming the bucket later does not break the mount)"
     },
     "mount_point": {
      "type": "string",
      "example": "/mnt/backups"
     },
     "read_only": {
      "type": "boolean"
     },
     "name": {
      "type": "string",
      "description": "systemd unit instance: gyro-s3mount@<name>"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "installing",
       "active",
       "error",
       "expired",
       "removed",
       "ended"
      ],
      "description": "pending = waiting for the install command; installing = command/agent running; active = mounted (reported by the server); expired = command not used within 60 minutes (key removed, request a new command)"
     },
     "automatic": {
      "type": "boolean",
      "description": "true = applied by the Gyro Compute guest agent (tr-ist-1); otherwise run install_command on the server"
     },
     "message": {
      "type": "string"
     },
     "last_report_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": "string"
     },
     "token_expires_at": {
      "type": [
       "string",
       "null"
      ]
     },
     "install_command": {
      "type": "string",
      "description": "only in create / command answers: one-line command (valid 60 minutes, single use; the script checksum is verified before it runs). Treat as a secret."
     },
     "remove_command": {
      "type": "string",
      "example": "sudo gyro-s3mount remove backups"
     },
     "protected": {
      "type": "boolean",
      "description": "true = Protected Storage (versioned / lockable) bucket: every write on a read/write mount becomes a new version, deletes only add a delete marker"
     }
    }
   }
  },
  "responses": {
   "NotFound": {
    "description": "Not found — also returned for objects owned by someone else",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}