{
 "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/containers/{id}/registry/imports": {
   "post": {
    "tags": [
     "Containers"
    ],
    "operationId": "importContainerImage",
    "summary": "Import an image from another registry",
    "x-summary-tr": "Başka bir depodan imaj içe aktar",
    "x-scope": "services_write",
    "x-cli": {
     "command": "container registry import"
    },
    "description": "Copies an image (e.g. `nginx:1.27`, `docker.io/library/redis:7`, `ghcr.io/gyro-ornek/uygulama:1.0`) into the environment's Gyro registry without `docker push`. HTTPS registries only; only the linux/amd64 variant of multi-platform images is copied. `repo` (default: last part of the source name) and `tag` (default: source tag) name the copy under `<host>/<code>/`; an existing name:tag needs `overwrite: true`. Private images: `username` + `password` (token) are used only for this copy, never stored or returned, and redacted in the API log. Runs in the background: poll GET .../registry/imports. Limits: 1 running import per environment (409 `import_running`), 10 per hour (429 `import_rate_limited`), 15 minutes, 128 layers, size within the free registry space (50 GB cap, 2 GB free, then the usual €0.05/GB-month). Sources that resolve to private, internal or Gyro infrastructure addresses are refused (`source_blocked`).",
    "x-description-tr": "Bir imajı (ör. `nginx:1.27`, `ghcr.io/gyro-ornek/uygulama:1.0`) `docker push` gerekmeden ortamın Gyro imaj deposuna kopyalar. Yalnız https depolar; çok mimarili imajlarda yalnız linux/amd64 kopyalanır. `repo` (varsayılan: kaynak adının son parçası) ve `tag` (varsayılan: kaynak etiketi) kopyanın adıdır; var olan ad:etiket için `overwrite: true` gerekir. Özel imaj: `username` + `password` (token) yalnız bu kopya için kullanılır, saklanmaz, geri dönmez, API günlüğünde karartılır. Arka planda çalışır: GET .../registry/imports ile izleyin. Sınırlar: ortam başına aynı anda 1 (409 `import_running`), saatte 10 (429 `import_rate_limited`), 15 dakika, 128 katman, boyut deponuzdaki boş alanı aşamaz. İç/özel/Gyro altyapı adreslerine çözülen kaynaklar reddedilir (`source_blocked`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Container environment (service) id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "source"
        ],
        "properties": {
         "source": {
          "type": "string",
          "example": "nginx:1.27",
          "description": "source image (host/repo:tag or @sha256:...); docker.io when no host",
          "x-description-tr": "kaynak imaj (host/depo:etiket ya da @sha256:...); host yoksa docker.io"
         },
         "repo": {
          "type": "string",
          "example": "nginx",
          "description": "target name under your prefix (lowercase, max 3 levels)",
          "x-description-tr": "hedef ad (küçük harf, en çok 3 seviye)"
         },
         "tag": {
          "type": "string",
          "example": "1.27",
          "description": "target tag (default: source tag, `latest` for a digest)",
          "x-description-tr": "hedef etiket"
         },
         "username": {
          "type": "string",
          "description": "private source: username (not stored)",
          "x-description-tr": "özel kaynak: kullanıcı adı (saklanmaz)"
         },
         "password": {
          "type": "string",
          "format": "password",
          "description": "private source: token / password (not stored, redacted in logs)",
          "x-description-tr": "özel kaynak: token / parola (saklanmaz)"
         },
         "overwrite": {
          "type": "boolean",
          "default": false,
          "description": "replace an existing name:tag",
          "x-description-tr": "var olan ad:etiketin üzerine yaz"
         }
        }
       },
       "example": {
        "source": "ghcr.io/gyro-ornek/uygulama:1.0",
        "repo": "uygulama",
        "tag": "1.0"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "job": {
             "$ref": "#/components/schemas/ContainerImageImport"
            },
            "limits": {
             "type": "object"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     },
     "429": {
      "description": "import_rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "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."
       }
      }
     }
    }
   },
   "ContainerImageImport": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "imp-1a2b3c4d5e6f"
     },
     "source": {
      "type": "string",
      "example": "docker.io/library/nginx:1.27",
      "description": "normalised source (never contains credentials)"
     },
     "target": {
      "type": "string",
      "example": "registry.ist.gyrohosting.com/ab12cd/nginx:1.27",
      "description": "image reference to use in a service"
     },
     "repo": {
      "type": "string"
     },
     "tag": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "enum": [
       "running",
       "done",
       "failed"
      ]
     },
     "phase": {
      "type": "string",
      "enum": [
       "queued",
       "auth",
       "manifest",
       "layers",
       "finalize",
       "done"
      ]
     },
     "bytes_total": {
      "type": "integer"
     },
     "bytes_done": {
      "type": "integer"
     },
     "layers": {
      "type": "integer"
     },
     "layers_done": {
      "type": "integer"
     },
     "digest": {
      "type": "string"
     },
     "platform": {
      "type": "string",
      "example": "linux/amd64"
     },
     "private": {
      "type": "boolean",
      "description": "credentials were used (not stored)"
     },
     "error": {
      "type": "string",
      "description": "source_blocked, insecure_source, source_unauthorized, source_not_found, source_unreachable, source_tls, source_rate_limited, source_error, source_corrupt, platform_unsupported, not_an_image, unsupported_image, too_many_layers, manifest_too_large, registry_full, import_timeout, interrupted, import_failed"
     },
     "message": {
      "type": "string"
     },
     "started": {
      "type": "string",
      "format": "date-time"
     },
     "updated": {
      "type": "string",
      "format": "date-time"
     },
     "finished": {
      "type": "string",
      "format": "date-time"
     }
    }
   }
  },
  "responses": {
   "Validation": {
    "description": "Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Conflict": {
    "description": "State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)",
    "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"
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}