2026-07-15 11:33:00 +08:00
|
|
|
|
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
|
|
|
|
package docs
|
|
|
|
|
|
|
|
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
|
|
|
|
|
|
|
|
const docTemplate = `{
|
|
|
|
|
|
"schemes": {{ marshal .Schemes }},
|
|
|
|
|
|
"swagger": "2.0",
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"description": "{{escape .Description}}",
|
|
|
|
|
|
"title": "{{.Title}}",
|
|
|
|
|
|
"termsOfService": "http://swagger.io/terms/",
|
|
|
|
|
|
"contact": {
|
|
|
|
|
|
"name": "API Support",
|
|
|
|
|
|
"url": "http://www.swagger.io/support",
|
|
|
|
|
|
"email": "support@swagger.io"
|
|
|
|
|
|
},
|
|
|
|
|
|
"license": {
|
|
|
|
|
|
"name": "Apache 2.0",
|
|
|
|
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
|
|
|
|
},
|
|
|
|
|
|
"version": "{{.Version}}"
|
|
|
|
|
|
},
|
|
|
|
|
|
"host": "{{.Host}}",
|
|
|
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
|
|
|
"paths": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"/auth/api/v1/delivery/mysql": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "创建一个 MySQL 交付任务,调度器会自动分配主机、调用 AWX 执行部署",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"delivery"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "提交 MySQL 一键交付",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "幂等键(防重复提交,最长 128 字符)",
|
|
|
|
|
|
"name": "Idempotency-Key",
|
|
|
|
|
|
"in": "header",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "交付参数",
|
|
|
|
|
|
"name": "body",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/service.MySQLDeliveryInput"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "幂等重放(相同 Idempotency-Key 已存在)",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"202": {
|
|
|
|
|
|
"description": "任务已创建",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "参数错误",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "未授权",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/auth/api/v1/delivery/quotas": {
|
|
|
|
|
|
"put": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "管理员为指定业务线 + 部署目标设置资源配额",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"delivery"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "创建或更新资源配额",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"description": "配额参数",
|
|
|
|
|
|
"name": "body",
|
|
|
|
|
|
"in": "body",
|
|
|
|
|
|
"required": true,
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/handler.quotaPayload"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "配额已更新",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"$ref": "#/definitions/model.ResourceQuota"
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "参数错误",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "未授权",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/auth/api/v1/delivery/targets": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"description": "从 AWX 动态返回可用 Job Template 及其 Inventory hosts",
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"delivery"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取可用部署目标",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "组件过滤,例如 mysql",
|
|
|
|
|
|
"name": "component",
|
|
|
|
|
|
"in": "query"
|
2026-07-23 12:05:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "items: 部署目标数组",
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "内部错误",
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/auth/api/v1/delivery/tasks": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "返回当前用户可见的交付任务列表(管理员可见全部)",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"delivery"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取交付任务列表",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"format": "int64",
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"description": "业务线 ID 过滤",
|
|
|
|
|
|
"name": "business_line_id",
|
|
|
|
|
|
"in": "query"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "items: 任务数组",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "未授权",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/auth/api/v1/delivery/tasks/{id}": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "返回指定任务的详细信息及事件流",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"delivery"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "获取交付任务详情",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "任务 ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "task + events",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "未授权",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"404": {
|
|
|
|
|
|
"description": "任务不存在",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/auth/api/v1/delivery/tasks/{id}/cancel": {
|
|
|
|
|
|
"post": {
|
|
|
|
|
|
"security": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"BearerAuth": []
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"description": "取消一个正在执行或等待中的交付任务",
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"delivery"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "取消交付任务",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "string",
|
|
|
|
|
|
"description": "任务 ID",
|
|
|
|
|
|
"name": "id",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "ok: true",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "未授权",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"409": {
|
|
|
|
|
|
"description": "无法取消(状态冲突)",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"additionalProperties": true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-07-15 11:33:00 +08:00
|
|
|
|
"/ping": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "检查服务器是否正常运行",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"系统"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "健康检查",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"time": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/test/401": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "模拟返回 HTTP 401 未授权错误",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"测试"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "测试 401 错误",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"401": {
|
|
|
|
|
|
"description": "Unauthorized",
|
|
|
|
|
|
"schema": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/test/403": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "模拟返回 HTTP 403 禁止访问错误",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"测试"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "测试 403 错误",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"403": {
|
|
|
|
|
|
"description": "Forbidden",
|
|
|
|
|
|
"schema": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/test/500": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "模拟返回 HTTP 500 服务器内部错误",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"测试"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "测试 500 错误",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"500": {
|
|
|
|
|
|
"description": "Internal Server Error",
|
|
|
|
|
|
"schema": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/test/error/{code}": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "根据错误码返回对应的业务错误响应",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"测试"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "测试业务错误响应",
|
|
|
|
|
|
"parameters": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "integer",
|
|
|
|
|
|
"description": "业务错误码 (10001-10099: 认证相关, 20001-20099: 任务相关)",
|
|
|
|
|
|
"name": "code",
|
|
|
|
|
|
"in": "path",
|
|
|
|
|
|
"required": true
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"details": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"400": {
|
|
|
|
|
|
"description": "Bad Request",
|
|
|
|
|
|
"schema": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/test/paginated": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "测试返回分页数据的统一响应格式",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"测试"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "测试分页响应",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.PaginatedData"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"type": "array",
|
|
|
|
|
|
"items": {
|
|
|
|
|
|
"type": "object"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/test/success": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "测试返回成功的统一响应格式",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"测试"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "测试成功响应",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
|
|
|
|
|
"allOf": [
|
|
|
|
|
|
{
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"role": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"username": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"/test/timeout": {
|
|
|
|
|
|
"get": {
|
|
|
|
|
|
"description": "模拟请求超时(15秒延迟,超过前端 10s timeout)",
|
|
|
|
|
|
"consumes": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"produces": [
|
|
|
|
|
|
"application/json"
|
|
|
|
|
|
],
|
|
|
|
|
|
"tags": [
|
|
|
|
|
|
"测试"
|
|
|
|
|
|
],
|
|
|
|
|
|
"summary": "测试超时响应",
|
|
|
|
|
|
"responses": {
|
|
|
|
|
|
"200": {
|
|
|
|
|
|
"description": "OK",
|
|
|
|
|
|
"schema": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"408": {
|
|
|
|
|
|
"description": "Request Timeout",
|
|
|
|
|
|
"schema": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"$ref": "#/definitions/response.Response"
|
2026-07-15 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"definitions": {
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"handler.quotaPayload": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"business_line_id",
|
|
|
|
|
|
"cpu_milli",
|
|
|
|
|
|
"instance_limit",
|
|
|
|
|
|
"memory_mi",
|
|
|
|
|
|
"storage_gi",
|
|
|
|
|
|
"target_id"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"business_line_id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"cpu_milli": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"instance_limit": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"memory_mi": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"storage_gi": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"target_id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"model.ResourceQuota": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"business_line_id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"cpu_milli": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"created_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"instance_limit": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"memory_mi": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"storage_gi": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"target_id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"updated_at": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"response.PaginatedData": {
|
2026-07-15 11:33:00 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"items": {},
|
|
|
|
|
|
"total": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"response.Response": {
|
2026-07-15 11:33:00 +08:00
|
|
|
|
"type": "object",
|
|
|
|
|
|
"properties": {
|
|
|
|
|
|
"code": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"data": {},
|
2026-07-15 11:33:00 +08:00
|
|
|
|
"details": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"message": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-07-23 12:05:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
"service.MySQLDeliveryInput": {
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
"required": [
|
|
|
|
|
|
"business_line_id",
|
|
|
|
|
|
"cpu_milli",
|
|
|
|
|
|
"instance_name",
|
|
|
|
|
|
"memory_mi",
|
|
|
|
|
|
"namespace",
|
|
|
|
|
|
"storage_gi",
|
|
|
|
|
|
"target_id"
|
|
|
|
|
|
],
|
|
|
|
|
|
"properties": {
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"binlog_expire_logs_seconds": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"business_line_id": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"character_set": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"collation": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"cpu_milli": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"data_disk": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"innodb_flush_log_at_trx_commit": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"innodb_io_capacity": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"innodb_redo_log_capacity": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"instance_name": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"long_query_time": {
|
|
|
|
|
|
"type": "number"
|
|
|
|
|
|
},
|
|
|
|
|
|
"lower_case_table_names": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"max_binlog_size": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"max_connections": {
|
|
|
|
|
|
"description": "高级参数(选填,零值视为未设置)",
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"memory_mi": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"mysql_port": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"mysql_version": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"namespace": {
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"storage_gi": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
2026-07-27 15:19:44 +08:00
|
|
|
|
"sync_binlog": {
|
|
|
|
|
|
"type": "integer"
|
|
|
|
|
|
},
|
|
|
|
|
|
"target_host": {
|
|
|
|
|
|
"description": "调度控制(选填):点名候选池内主机跳过自动选机,端口/配额/实机守卫照常执行",
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
2026-07-23 12:05:21 +08:00
|
|
|
|
"target_id": {
|
|
|
|
|
|
"type": "integer"
|
2026-07-27 15:19:44 +08:00
|
|
|
|
},
|
|
|
|
|
|
"timezone": {
|
|
|
|
|
|
"description": "数据库配置(选填,缺省由 playbook 基线兜底)",
|
|
|
|
|
|
"type": "string"
|
|
|
|
|
|
},
|
|
|
|
|
|
"topology": {
|
|
|
|
|
|
"type": "string"
|
2026-07-23 12:05:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-07-15 11:33:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"securityDefinitions": {
|
|
|
|
|
|
"BearerAuth": {
|
|
|
|
|
|
"description": "请输入 Bearer Token(例如:Bearer xxx)",
|
|
|
|
|
|
"type": "apiKey",
|
|
|
|
|
|
"name": "Authorization",
|
|
|
|
|
|
"in": "header"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}`
|
|
|
|
|
|
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
|
|
|
var SwaggerInfo = &swag.Spec{
|
|
|
|
|
|
Version: "1.0",
|
2026-07-15 13:30:59 +08:00
|
|
|
|
Host: "",
|
2026-07-15 11:33:00 +08:00
|
|
|
|
BasePath: "/api/v1",
|
|
|
|
|
|
Schemes: []string{},
|
|
|
|
|
|
Title: "xinfra API",
|
|
|
|
|
|
Description: "xinfra 平台后端 API 文档",
|
|
|
|
|
|
InfoInstanceName: "swagger",
|
|
|
|
|
|
SwaggerTemplate: docTemplate,
|
|
|
|
|
|
LeftDelim: "{{",
|
|
|
|
|
|
RightDelim: "}}",
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
|
|
|
}
|