{
 "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/{mid}/command": {
   "post": {
    "tags": [
     "Object storage"
    ],
    "operationId": "renewStorageMountCommand",
    "summary": "New install command (rotates the mount key)",
    "x-summary-tr": "Yeni kurulum komutu (bağlantı anahtarı yenilenir)",
    "x-scope": "cloud_write",
    "x-cli": {
     "command": "server storage-mount command"
    },
    "description": "Creates a new access key for the mount and a new single-use install command (the old key stops at once). Use after reinstalling the server or when the command expired.",
    "x-description-tr": "Bağlantı için yeni erişim anahtarı ve yeni tek kullanımlık komut üretir (eski anahtar hemen durur). Sunucu yeniden kurulduğunda ya da komutun süresi dolduğunda kullanın.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Server service id"
     },
     {
      "name": "mid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Storage mount id"
     }
    ],
    "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": {
      "$ref": "#/components/responses/Validation"
     },
     "429": {
      "description": "rate_limited"
     },
     "503": {
      "description": "storage_mount_unavailable"
     }
    }
   }
  }
 },
 "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."
       }
      }
     }
    }
   },
   "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"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}