{
 "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}/nics": {
   "post": {
    "tags": [
     "Private networks"
    ],
    "operationId": "attachServerNic",
    "summary": "Attach the server to a subnet",
    "x-summary-tr": "Sunucuyu subnete bağla",
    "x-scope": "cloud_write",
    "x-cli": {
     "command": "server nic attach"
    },
    "description": "Private network cards of a tr-ist-1 server. Attaching is hot (no restart): the card is ready in about 10-60 s on a running server (`state` attaching -> ready); on a stopped server the settings apply at boot. A server can join one VPC at a time (409 `other_vpc`), at most 3 cards. `ip` empty = automatic. ",
    "x-description-tr": "tr-ist-1 sunucusunun özel ağ kartları. Takma sıcak yapılır (yeniden başlatma yok): açık sunucuda yaklaşık 10-60 sn'de hazır (`state` attaching -> ready); kapalı sunucuda ayarlar açılışta uygulanır. Bir sunucu aynı anda tek VPC'ye bağlanır (409 `other_vpc`), en çok 3 kart. `ip` boş = otomatik. ",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Server id (tr-ist-1)"
     }
    ],
    "responses": {
     "202": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "server_id": {
             "type": "integer"
            },
            "nic": {
             "$ref": "#/components/schemas/ServerNic"
            },
            "task_id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "not_available (private networks are not enabled for this account yet) / forbidden (key limited to some servers)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "description": "conflict: limit_exceeded, vpc_in_use, subnet_in_use, last_subnet, gateway_disabled, gateway_in_use, port_in_use, already_attached, other_vpc, extra_ips, no_private_network, no_egress, already_off, already_on, last_network, no_billing_server, suspended, busy",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     },
     "503": {
      "description": "capacity / pool_exhausted (try again later)",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "subnet_id": {
          "type": "string"
         },
         "ip": {
          "type": "string"
         }
        },
        "required": [
         "subnet_id"
        ]
       }
      }
     }
    }
   }
  }
 },
 "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."
       }
      }
     }
    }
   },
   "ServerNic": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "vpc_id": {
      "type": "string"
     },
     "subnet_id": {
      "type": "string"
     },
     "subnet_name": {
      "type": "string"
     },
     "subnet_cidr": {
      "type": "string"
     },
     "ip": {
      "type": "string"
     },
     "gateway_ip": {
      "type": "string"
     },
     "mac": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "enum": [
       "attaching",
       "ready",
       "detaching",
       "error"
      ]
     },
     "error": {
      "type": "string"
     }
    }
   }
  },
  "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"
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}