{
 "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/security-groups/{sg}/confirm": {
   "post": {
    "tags": [
     "Security groups"
    ],
    "operationId": "confirmSecurityGroup",
    "summary": "Make the running rule trial permanent",
    "x-summary-tr": "Kural denemesini kalıcı yap",
    "x-scope": "cloud_write",
    "x-cli": {
     "command": "security-group confirm"
    },
    "responses": {
     "200": {
      "description": "Group",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/SecurityGroup"
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     }
    }
   },
   "parameters": [
    {
     "name": "sg",
     "in": "path",
     "required": true,
     "schema": {
      "type": "string",
      "pattern": "^sg-[a-f0-9]{8}$"
     }
    }
   ]
  }
 },
 "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"
      }
     }
    }
   },
   "Unauthorized": {
    "description": "Missing, invalid or revoked key",
    "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."
       }
      }
     }
    }
   },
   "SecurityGroup": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "example": "sg-1a2b3c4d"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "enum": [
       "unused",
       "applying",
       "active",
       "trial"
      ]
     },
     "trial_seconds_left": {
      "type": "integer",
      "description": "Seconds until an unconfirmed trial reverts (also during `applying`), else 0"
     },
     "rules": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/SecurityGroupRule"
      }
     },
     "servers": {
      "type": "array",
      "items": {
       "type": "integer"
      },
      "description": "Your servers the group is attached to"
     },
     "created_at": {
      "type": "string"
     },
     "trial": {
      "type": "boolean",
      "description": "A rule change is running as a 5 minute trial (also while it is still being applied, `status: applying`); confirm with POST .../confirm"
     }
    }
   },
   "SecurityGroupRule": {
    "type": "object",
    "required": [
     "type"
    ],
    "description": "Allow rule (security groups never deny; stateful: replies pass automatically).",
    "x-description-tr": "İzin kuralı (güvenlik grupları engellemez; bağlantı durumu izlenir, yanıtlar kendiliğinden geçer).",
    "properties": {
     "id": {
      "type": "string",
      "pattern": "^gfr-[a-f0-9]{8}$",
      "description": "Rule id (keep it when you edit a rule; omit for a new rule)"
     },
     "direction": {
      "type": "string",
      "enum": [
       "in",
       "out"
      ],
      "default": "in",
      "description": "in = to your servers; out = new connections from your servers (network servers only)"
     },
     "type": {
      "type": "string",
      "enum": [
       "ssh",
       "http",
       "https",
       "rdp",
       "mysql",
       "postgresql",
       "mssql",
       "redis",
       "mongodb",
       "smtp",
       "smtps",
       "imaps",
       "dns_udp",
       "dns_tcp",
       "all_tcp",
       "all_udp",
       "all_icmp",
       "all",
       "custom_tcp",
       "custom_udp"
      ],
      "description": "Fixes protocol and port; custom_tcp / custom_udp take `port`"
     },
     "protocol": {
      "type": "string",
      "readOnly": true,
      "enum": [
       "tcp",
       "udp",
       "icmp",
       "all"
      ]
     },
     "port": {
      "type": "string",
      "description": "For custom_tcp / custom_udp: 8080 or 8000-8100. Read: the port of the type, `all` for all ports",
      "example": "8080"
     },
     "source": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "maxItems": 50,
      "description": "IPv4 / CIDR list; [\"0.0.0.0/0\"] = anywhere. For out: the remote address",
      "example": [
       "203.0.113.10/32"
      ]
     },
     "description": {
      "type": "string",
      "maxLength": 60
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}