{
 "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}/pipelines/{pipeline}": {
   "get": {
    "tags": [
     "Containers"
    ],
    "operationId": "pipeline_get",
    "summary": "Get a pipeline",
    "x-summary-tr": "Pipeline'ı getir",
    "x-scope": "services_read",
    "description": "Settings, webhook address, build secret names (values never returned). ",
    "x-description-tr": "Ayarlar, webhook adresi, gizli değer adları (değerler dönmez). ",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Service id"
     },
     {
      "name": "pipeline",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Pipeline id (p + 8)"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ContainerPipeline"
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     }
    },
    "x-cli": {
     "command": "container pipeline get",
     "confirm": false
    }
   }
  }
 },
 "components": {
  "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"
      }
     }
    }
   }
  },
  "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."
       }
      }
     }
    }
   },
   "ContainerPipeline": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "p1a2b3c4d"
     },
     "name": {
      "type": "string",
      "example": "web"
     },
     "provider": {
      "type": "string",
      "enum": [
       "github",
       "gitlab",
       "gitea",
       "git",
       "archive"
      ],
      "description": "`archive`: no repository, builds only from uploaded archives"
     },
     "repo": {
      "type": "string",
      "example": "https://github.com/gyro-ornek/uygulama",
      "description": "https clone URL (no credentials) or SSH address (git@host:org/repo.git, ssh://user@host[:port]/path)"
     },
     "git_user": {
      "type": "string"
     },
     "branch": {
      "type": "string",
      "example": "main, release/*"
     },
     "tags": {
      "type": "string",
      "example": "v*"
     },
     "auto": {
      "type": "boolean"
     },
     "repo_file": {
      "type": "boolean"
     },
     "dockerfile": {
      "type": "string"
     },
     "context": {
      "type": "string"
     },
     "image": {
      "type": "string",
      "example": "web"
     },
     "targets": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "approval": {
      "type": "boolean"
     },
     "auto_rollback": {
      "type": "boolean"
     },
     "build_image": {
      "type": "string"
     },
     "commands": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "build_env": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     },
     "build_args": {
      "type": "object",
      "additionalProperties": {
       "type": "string"
      }
     },
     "cpu_m": {
      "type": "integer"
     },
     "memory_mi": {
      "type": "integer"
     },
     "timeout_min": {
      "type": "integer"
     },
     "verify_min": {
      "type": "integer"
     },
     "notify": {
      "type": "object",
      "additionalProperties": {
       "type": "boolean"
      }
     },
     "webhook_url": {
      "type": "string",
      "example": "https://ecs-api.ist.gyrohosting.com/hook/ab12cd/p1a2b3c4d"
     },
     "has_token": {
      "type": "boolean"
     },
     "secret_names": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "registry_image": {
      "type": "string",
      "example": "registry.ist.gyrohosting.com/ab12cd/web"
     },
     "last_run": {
      "$ref": "#/components/schemas/ContainerPipelineRun"
     },
     "created": {
      "type": "string",
      "format": "date-time"
     },
     "updated": {
      "type": "string",
      "format": "date-time"
     },
     "auth": {
      "type": "string",
      "enum": [
       "none",
       "token",
       "ssh",
       "archive"
      ],
      "description": "How the source is reached"
     },
     "ssh": {
      "type": "object",
      "description": "SSH repositories only",
      "properties": {
       "host": {
        "type": "string"
       },
       "port": {
        "type": "integer"
       },
       "user": {
        "type": "string"
       },
       "pinned": {
        "type": "boolean",
        "description": "GitHub / GitLab / Bitbucket: published host keys are pinned"
       },
       "host_key_trusted": {
        "type": "boolean"
       },
       "host_keys": {
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "type": {
           "type": "string"
          },
          "fingerprint": {
           "type": "string",
           "example": "SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU"
          }
         }
        }
       },
       "deploy_key": {
        "type": "object",
        "nullable": true,
        "properties": {
         "public_key": {
          "type": "string",
          "example": "ssh-ed25519 AAAAC3Nza... gyro-pipeline"
         },
         "fingerprint": {
          "type": "string"
         },
         "type": {
          "type": "string",
          "example": "ed25519"
         }
        }
       }
      }
     },
     "archive": {
      "type": "object",
      "properties": {
       "enabled": {
        "type": "boolean"
       },
       "max_bytes": {
        "type": "integer",
        "example": 209715200
       },
       "retention_hours": {
        "type": "integer",
        "example": 24
       }
      }
     },
     "build_target": {
      "type": "string",
      "description": "Dockerfile stage that is built (empty = last stage)",
      "x-description-tr": "Derlenen Dockerfile aşaması (boş = son aşama)"
     }
    }
   },
   "ContainerPipelineRun": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "rt0gbqcbw5r1"
     },
     "pipeline": {
      "type": "string"
     },
     "n": {
      "type": "integer",
      "description": "run number of the pipeline"
     },
     "trigger": {
      "type": "string",
      "enum": [
       "push",
       "tag",
       "manual",
       "api",
       "redeploy",
       "archive"
      ]
     },
     "ref": {
      "type": "string",
      "example": "refs/heads/main"
     },
     "sha": {
      "type": "string"
     },
     "short_sha": {
      "type": "string"
     },
     "message": {
      "type": "string"
     },
     "author": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "enum": [
       "queued",
       "preparing",
       "building",
       "awaiting_approval",
       "deploying",
       "verifying",
       "succeeded",
       "failed",
       "cancelled",
       "rolled_back",
       "skipped",
       "expired"
      ]
     },
     "step": {
      "type": "string",
      "enum": [
       "prepare",
       "queued_node",
       "starting",
       "clone",
       "steps",
       "build",
       "approval",
       "deploy",
       "verify"
      ]
     },
     "error": {
      "type": "string",
      "description": "repo_auth, repo_not_found, repo_unreachable, repo_blocked, ref_not_found, target_missing, clone_failed, commands_failed, build_failed, build_target_not_found (detail = the stage name), invalid_build_target, push_failed, timeout, out_of_memory, no_capacity, build_image_pull, deploy_unhealthy, deploy_timeout, deploy_failed, minutes_exhausted, pipeline_file_invalid, cancelled, rejected, approval_expired, internal, archive_invalid (detail says why: links, ../ paths, device files, > 20 000 files, > 2 GB unpacked, damaged), archive_download, upload_not_found, archive_format, archive_too_large, host_key_unconfirmed, host_key_mismatch, deploy_key_missing"
     },
     "image": {
      "type": "string",
      "example": "registry.ist.gyrohosting.com/ab12cd/web:1a2b3c4"
     },
     "digest": {
      "type": "string"
     },
     "deployed": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "service": {
         "type": "string"
        },
        "from_revision": {
         "type": "integer"
        },
        "to_revision": {
         "type": "integer"
        },
        "state": {
         "type": "string",
         "enum": [
          "pending",
          "running",
          "failing",
          "rolled_back",
          "missing"
         ]
        },
        "problem": {
         "type": "string"
        }
       }
      }
     },
     "build_seconds": {
      "type": "integer"
     },
     "billed_minutes": {
      "type": "integer"
     },
     "duration_seconds": {
      "type": "integer"
     },
     "created": {
      "type": "string",
      "format": "date-time"
     },
     "started": {
      "type": "string",
      "format": "date-time"
     },
     "finished": {
      "type": "string",
      "format": "date-time"
     },
     "deadline": {
      "type": "string",
      "format": "date-time",
      "description": "approval / health wait deadline"
     },
     "from_run": {
      "type": "string",
      "description": "redeploy: source run"
     },
     "archive": {
      "type": "string",
      "description": "upload id (archive runs)"
     },
     "archive_name": {
      "type": "string"
     },
     "archive_size": {
      "type": "integer"
     },
     "archive_format": {
      "type": "string",
      "enum": [
       "tar.gz",
       "zip"
      ]
     },
     "image_tag": {
      "type": "string",
      "description": "<sha7> for commits, arc-<upload> for archives"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}