{ "schemes": [ "http" ], "swagger": "2.0", "info": { "description": "一键虚拟化管理平台API接口文档", "title": "OneClickVirt API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "url": "http://www.swagger.io/support", "email": "support@swagger.io" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" }, "version": "1.0" }, "host": "localhost:8888", "basePath": "/api/v1", "paths": { "/admin/announcements": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统公告列表(分页)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取公告列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新公告", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建公告", "parameters": [ { "description": "创建公告请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateAnnouncementRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/announcements/batch-delete": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除公告", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量删除公告", "parameters": [ { "description": "批量操作请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchAnnouncementRequest" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/announcements/batch-status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量更新公告状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量更新公告状态", "parameters": [ { "description": "批量状态更新请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchUpdateStatusRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/announcements/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新公告信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新公告", "parameters": [ { "type": "integer", "description": "公告ID", "name": "id", "in": "path", "required": true }, { "description": "更新公告请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateAnnouncementRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员删除公告", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除公告", "parameters": [ { "type": "integer", "description": "公告ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/api-tokens": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取所有用户的API Token列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "API Token管理" ], "summary": "管理员获取API Token列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/api-tokens/:id": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员硬删除任意API Token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "API Token管理" ], "summary": "管理员删除API Token", "parameters": [ { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/api-tokens/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量硬删除多个API Token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "API Token管理" ], "summary": "管理员批量删除API Token", "parameters": [ { "description": "包含ids数组的请求体", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/block-rules": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取屏蔽规则s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取屏蔽规则s", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "获取屏蔽规则s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取屏蔽规则s失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建屏蔽规则", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建屏蔽规则", "responses": { "200": { "description": "创建屏蔽规则成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建屏蔽规则失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/block-rules/agent-providers": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Agent Enabled Providers", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取Agent Enabled Providers", "responses": { "200": { "description": "获取Agent Enabled Providers成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Agent Enabled Providers失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/block-rules/applications": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取屏蔽规则 Applications", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取屏蔽规则 Applications", "responses": { "200": { "description": "获取屏蔽规则 Applications成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取屏蔽规则 Applications失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/block-rules/apply": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建应用屏蔽规则s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "应用屏蔽规则s", "responses": { "200": { "description": "应用屏蔽规则s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "应用屏蔽规则s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/block-rules/remove": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建Remove 屏蔽规则 Applications", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "Remove 屏蔽规则 Applications", "responses": { "200": { "description": "Remove 屏蔽规则 Applications成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "Remove 屏蔽规则 Applications失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/block-rules/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取屏蔽规则", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取屏蔽规则", "responses": { "200": { "description": "获取屏蔽规则成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取屏蔽规则失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新屏蔽规则", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新屏蔽规则", "responses": { "200": { "description": "更新屏蔽规则成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新屏蔽规则失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除屏蔽规则", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除屏蔽规则", "responses": { "200": { "description": "删除屏蔽规则成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除屏蔽规则失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/configuration-tasks": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取配置任务列表,支持分页和筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取配置任务列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "type": "string", "description": "任务类型", "name": "taskType", "in": "query" }, { "type": "string", "description": "任务状态", "name": "status", "in": "query" }, { "type": "integer", "description": "执行者ID", "name": "executorId", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ConfigurationTaskListResponse" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/configuration-tasks/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定配置任务的详细信息,包括完整日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取配置任务详情", "parameters": [ { "type": "integer", "description": "任务ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ConfigurationTaskDetailResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "任务不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/configuration-tasks/{id}/cancel": { "post": { "security": [ { "BearerAuth": [] } ], "description": "取消正在运行的配置任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "取消配置任务", "parameters": [ { "type": "integer", "description": "任务ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "取消成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "任务不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "取消失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取管理员后台首页的统计数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取管理员仪表板", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/database/stats": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取详细的数据库连接池统计信息", "produces": [ "application/json" ], "tags": [ "Health" ], "summary": "数据库统计信息", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/admin/domains": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取管理员 Get 域名s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Get 域名s", "responses": { "200": { "description": "管理员 Get 域名s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Get 域名s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/domains/sync-proxies": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建管理员 Sync 域名 Proxies", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Sync 域名 Proxies", "responses": { "200": { "description": "管理员 Sync 域名 Proxies成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Sync 域名 Proxies失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/domains/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新管理员 Update 域名", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Update 域名", "responses": { "200": { "description": "管理员 Update 域名成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Update 域名失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除管理员 Delete 域名", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Delete 域名", "responses": { "200": { "description": "管理员 Delete 域名成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Delete 域名失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/domains/{id}/sync": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建管理员 Sync 域名 Proxy", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Sync 域名 Proxy", "responses": { "200": { "description": "管理员 Sync 域名 Proxy成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Sync 域名 Proxy失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/group-info": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取管理员 组 信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取管理员 组 信息", "responses": { "200": { "description": "获取管理员 组 信息成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取管理员 组 信息失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新管理员 组 信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新管理员 组 信息", "responses": { "200": { "description": "更新管理员 组 信息成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新管理员 组 信息失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/groups": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取管理员 组s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取管理员 组s", "responses": { "200": { "description": "获取管理员 组s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取管理员 组s失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建管理员 组", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建管理员 组", "responses": { "200": { "description": "创建管理员 组成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建管理员 组失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/groups/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新管理员 组", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新管理员 组", "responses": { "200": { "description": "更新管理员 组成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新管理员 组失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除管理员 组", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除管理员 组", "responses": { "200": { "description": "删除管理员 组成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除管理员 组失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instance-type-permissions": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取实例类型最低等级要求配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取实例类型权限配置", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新实例类型最低等级要求配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新实例类型权限配置", "parameters": [ { "description": "权限配置参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateInstanceTypePermissionsRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取系统中所有实例的列表,支持分页和过滤", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取实例列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "实例名称", "name": "name", "in": "query" }, { "type": "string", "description": "实例状态", "name": "status", "in": "query" }, { "type": "string", "description": "节点名称", "name": "providerName", "in": "query" }, { "type": "string", "description": "所有者名称", "name": "ownerName", "in": "query" }, { "type": "string", "description": "实例类型", "name": "instance_type", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/batch-action": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量对实例执行启动、停止、重启、重置、删除等操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员批量执行实例操作", "parameters": [ { "description": "批量操作请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchInstanceActionRequest" } } ], "responses": { "200": { "description": "批量操作已处理", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.BatchInstanceActionResponse" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/freeze": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建冻结实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "冻结实例", "responses": { "200": { "description": "冻结实例成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "冻结实例失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/set-expiry": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建设置实例 Expiry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "设置实例 Expiry", "responses": { "200": { "description": "设置实例 Expiry成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "设置实例 Expiry失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/transfer": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建管理员 Transfer 实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Transfer 实例", "responses": { "200": { "description": "管理员 Transfer 实例成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Transfer 实例失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/unfreeze": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建解冻实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "解冻实例", "responses": { "200": { "description": "解冻实例成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "解冻实例失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取指定实例的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取实例详情", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新实例", "responses": { "200": { "description": "更新实例成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新实例失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] }, { "BearerAuth": [] } ], "description": "删除删除实例\n删除删除实例", "consumes": [ "application/json", "application/json" ], "produces": [ "application/json", "application/json" ], "tags": [ "管理员管理", "Provider管理" ], "summary": "删除实例", "responses": { "200": { "description": "删除实例成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除实例失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/action": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员对实例执行启动、停止、重启等操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员执行实例操作", "parameters": [ { "type": "string", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "操作请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.InstanceActionRequest" } } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/egress": { "get": { "security": [ { "BearerAuth": [] } ], "description": "返回节点能力、脱敏配置、绑定、fail-closed执行状态和流量计数", "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "获取实例独立出口状态", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数或配置错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权访问实例", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "保存控制端期望状态,下发节点Agent并执行fail-closed协调", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "设置实例独立出口", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "出口配置与绑定", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/agent.InstanceEgressBindRequest" } } ], "responses": { "200": { "description": "配置已保存", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求、网络模式或Agent能力不支持", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权访问实例", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "持久化待清理标记,删除Agent绑定并重新协调", "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "解除实例独立出口", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "default": true, "description": "是否立即应用", "name": "apply", "in": "query" } ], "responses": { "200": { "description": "解绑结果", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数或节点配置错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权访问实例", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/egress/dependencies": { "post": { "security": [ { "BearerAuth": [] } ], "description": "在已启用自动安装保护的节点Agent上安装native或WireGuard依赖集", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "安装实例出口依赖", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "依赖集(native或wireguard)", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.InstanceEgressDependencyRequest" } } ], "responses": { "200": { "description": "依赖安装与能力检查结果", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "依赖集或Agent安装保护无效", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权访问实例", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/egress/reconcile": { "post": { "security": [ { "BearerAuth": [] } ], "description": "从控制端期望状态恢复Agent配置并返回路由计划结果", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "协调实例独立出口", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "协调参数", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.InstanceEgressReconcileRequest" } } ], "responses": { "200": { "description": "协调结果", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数或期望状态错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权访问实例", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/monitoring/resources": { "get": { "description": "获取指定实例的CPU/内存资源监控指标", "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "获取实例资源监控数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "查询时间范围小时数(默认24)", "name": "hours", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/password/{taskId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "通过任务ID获取实例重置后的新密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员获取实例重置后的新密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.GetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例或任务不存在", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/port-mappings": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取指定实例的所有端口映射", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "获取实例端口映射", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员重置指定实例的登录密码,创建异步任务执行密码重置操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员重置实例密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "重置实例密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ResetInstancePasswordRequest" } } ], "responses": { "200": { "description": "任务创建成功,返回任务ID", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ResetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/sftp/download": { "get": { "description": "下载管理员实例上的远程文件", "produces": [ "application/octet-stream" ], "tags": [ "管理员/实例" ], "summary": "管理员实例SFTP下载", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程文件路径", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } } } } }, "/admin/instances/{id}/sftp/list": { "get": { "description": "列出管理员实例远程目录文件", "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "管理员实例SFTP目录列表", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程路径", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/sftp/upload": { "post": { "description": "上传本地文件到管理员实例远程目录", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "管理员实例SFTP上传", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "formData" }, { "type": "file", "description": "上传文件", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/sftp/upload/abort": { "post": { "description": "清理实例指定 uploadId 对应临时分片文件,允许重传", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "管理员实例SFTP上传中断清理", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "上传ID", "name": "uploadId", "in": "formData", "required": true }, { "type": "string", "description": "远程目标文件路径", "name": "targetPath", "in": "formData" }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "formData" }, { "type": "string", "description": "文件名", "name": "filename", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/sftp/upload/status": { "get": { "description": "查询实例分片上传进度,用于断点续传", "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "管理员实例SFTP上传状态", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "上传ID", "name": "uploadId", "in": "query", "required": true }, { "type": "string", "description": "远程目标文件路径", "name": "targetPath", "in": "query" }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "query" }, { "type": "string", "description": "文件名", "name": "filename", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/share-links": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建管理员 实例 共享", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建管理员 实例 共享", "responses": { "200": { "description": "创建管理员 实例 共享成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建管理员 实例 共享失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/snapshots": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取实例 快照s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取实例 快照s", "responses": { "200": { "description": "获取实例 快照s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取实例 快照s失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建实例 快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建实例 快照", "responses": { "200": { "description": "创建实例 快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建实例 快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/instances/{id}/ssh": { "get": { "description": "管理员通过WebSocket建立到任意实例的SSH连接", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员/实例" ], "summary": "管理员WebSocket SSH连接", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "101": { "description": "Switching Protocols", "schema": { "type": "string" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取系统中的邀请码列表,支持分页和查询", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "获取邀请码列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "keyword", "in": "query" }, { "type": "string", "description": "状态筛选", "name": "status", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新的邀请码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "创建邀请码", "parameters": [ { "description": "创建邀请码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateInviteCodeRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除指定的邀请码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "批量删除邀请码", "parameters": [ { "description": "批量删除邀请码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchDeleteInviteCodesRequest" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/export": { "get": { "security": [ { "BearerAuth": [] } ], "description": "导出选中的邀请码为文本格式(每行一个)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "导出邀请码", "parameters": [ { "type": "array", "items": { "type": "integer" }, "collectionFormat": "csv", "description": "邀请码ID列表,不传则导出全部", "name": "ids", "in": "query" } ], "responses": { "200": { "description": "导出成功,返回邀请码列表", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/generate": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量生成邀请码,可指定数量和权限等级", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "批量生成邀请码", "parameters": [ { "description": "生成邀请码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateInviteCodeRequest" } } ], "responses": { "200": { "description": "生成成功,返回邀请码列表", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/invite-codes/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员删除指定的邀请码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "邀请码管理" ], "summary": "删除邀请码", "parameters": [ { "type": "integer", "description": "邀请码ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/kyc": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取管理员 Get 实名认证 列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Get 实名认证 列表", "responses": { "200": { "description": "管理员 Get 实名认证 列表成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Get 实名认证 列表失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/kyc/{id}/review": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新管理员 Review 实名认证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Review 实名认证", "responses": { "200": { "description": "管理员 Review 实名认证成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Review 实名认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/logs/cleanup": { "post": { "security": [ { "BearerAuth": [] } ], "description": "根据配置的保留天数清理旧的日志文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "清理旧日志文件", "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/logs/content": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取日志 Content", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取日志 Content", "responses": { "200": { "description": "获取日志 Content成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取日志 Content失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/logs/dates": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取日志 Dates", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取日志 Dates", "responses": { "200": { "description": "获取日志 Dates成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取日志 Dates失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/logs/files": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有日志文件的信息,包括按日期分割的日志文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "获取日志文件列表", "responses": { "200": { "description": "success", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/log.LogFileInfo" } } } } ] } } } } }, "/admin/logs/read": { "get": { "security": [ { "BearerAuth": [] } ], "description": "读取指定日志文件的内容,支持指定返回行数", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "读取日志文件内容", "parameters": [ { "type": "string", "description": "日志文件名", "name": "filename", "in": "query", "required": true }, { "type": "integer", "description": "返回行数,默认100行", "name": "lines", "in": "query" } ], "responses": { "200": { "description": "success", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } } } } }, "/admin/monitoring/audit-logs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户操作审计日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取操作审计日志", "parameters": [ { "type": "integer", "description": "用户ID", "name": "user_id", "in": "query" }, { "type": "string", "description": "操作类型", "name": "action", "in": "query" }, { "type": "string", "description": "开始时间", "name": "start_time", "in": "query" }, { "type": "string", "description": "结束时间", "name": "end_time", "in": "query" }, { "type": "integer", "default": 100, "description": "返回条数", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "偏移量", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/monitoring/health": { "get": { "security": [ { "BearerAuth": [] } ], "description": "检查各个组件的健康状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统监控" ], "summary": "获取系统健康检查", "responses": { "200": { "description": "检查成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检查失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/monitoring/logs": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统运行日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "监控管理" ], "summary": "获取系统日志", "parameters": [ { "enum": [ "info", "warn", "error", "debug" ], "type": "string", "description": "日志级别", "name": "level", "in": "query" }, { "type": "integer", "default": 100, "description": "返回条数", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "偏移量", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/monitoring/metrics": { "get": { "security": [ { "BearerAuth": [] } ], "description": "返回Prometheus格式的系统监控指标,用于监控系统集成", "consumes": [ "application/json" ], "produces": [ "text/plain" ], "tags": [ "系统监控" ], "summary": "获取Prometheus格式的指标", "responses": { "200": { "description": "Prometheus指标数据", "schema": { "type": "string" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/monitoring/provider": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取节点的监控和性能数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统监控" ], "summary": "获取节点监控数据", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/admin/monitoring/system": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取服务器的CPU、内存、磁盘、网络等系统资源使用情况", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统监控" ], "summary": "获取系统统计信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/system.SystemStats" } } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/performance/history": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取性能 历史", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取性能 历史", "responses": { "200": { "description": "获取性能 历史成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取性能 历史失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/performance/metrics": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取性能 指标", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取性能 指标", "responses": { "200": { "description": "获取性能 指标成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取性能 指标失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取端口映射列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "获取端口映射列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "type": "integer", "description": "实例ID", "name": "instanceId", "in": "query" }, { "type": "string", "description": "协议类型", "name": "protocol", "in": "query" }, { "type": "string", "description": "状态", "name": "status", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新的端口映射(异步执行)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "创建端口映射", "parameters": [ { "description": "创建端口映射请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreatePortMappingRequest" } } ], "responses": { "200": { "description": "创建成功,返回任务ID", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除端口映射(仅支持删除手动添加的端口,区间映射的端口不能删除)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "批量删除端口映射", "parameters": [ { "description": "批量删除端口映射请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchDeletePortMappingRequest" } } ], "responses": { "200": { "description": "删除任务已创建", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings/repair": { "post": { "security": [ { "BearerAuth": [] } ], "description": "预览或创建后台任务,将控制端数据库中的端口映射重新应用到节点。执行时必须提供确认词 REBUILD。", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Admin-Port-Mapping" ], "summary": "按数据库记录重建端口转发", "parameters": [ { "description": "修复参数", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.RepairPortMappingsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/common.Response" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings/sync": { "post": { "security": [ { "BearerAuth": [] } ], "description": "先使用 dryRun 预览,再提交 includedPortIds 创建后台任务,检测并清理孤立的端口映射。为每个Provider创建独立的同步任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Admin-Port-Mapping" ], "summary": "同步端口映射", "parameters": [ { "description": "同步参数(可选指定Provider IDs)", "name": "data", "in": "body", "schema": { "$ref": "#/definitions/admin.SyncPortMappingsTaskRequest" } } ], "responses": { "200": { "description": "同步任务已创建", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/port-mappings/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "管理员删除端口映射(仅支持删除手动添加的端口,区间映射的端口不能删除)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "删除端口映射", "parameters": [ { "type": "integer", "description": "端口映射ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除任务已创建", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/ports/check": { "post": { "security": [ { "BearerAuth": [] } ], "description": "检查指定Provider上的端口或端口段是否可用", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "检查端口可用性", "parameters": [ { "description": "检查端口可用性请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CheckPortAvailabilityRequest" } } ], "responses": { "200": { "description": "检查成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.CheckPortAvailabilityResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检查失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/auto-configure": { "post": { "security": [ { "BearerAuth": [] } ], "description": "自动配置Provider,支持检查历史记录和防重复执行", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "自动配置Provider", "parameters": [ { "description": "自动配置请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.AutoConfigureRequest" } } ], "responses": { "200": { "description": "配置响应", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.AutoConfigureResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "配置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/traffic-monitor": { "post": { "security": [ { "BearerAuth": [] } ], "description": "批量启用、删除或检测Provider下所有实例的流量监控", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "流量监控管理" ], "summary": "流量监控操作", "parameters": [ { "description": "操作请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.TrafficMonitorOperationRequest" } } ], "responses": { "200": { "description": "操作成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/traffic-monitor/latest": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider的最新流量监控任务(用于显示运行中的任务)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "流量监控管理" ], "summary": "获取Provider的最新流量监控任务", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query", "required": true } ], "responses": { "200": { "description": "查询成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TrafficMonitorTask" } } } ] } }, "404": { "description": "没有任务", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/traffic-monitor/tasks": { "get": { "security": [ { "BearerAuth": [] } ], "description": "查询流量监控操作任务列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "流量监控管理" ], "summary": "获取流量监控任务列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "type": "string", "description": "任务类型", "name": "taskType", "in": "query" }, { "type": "string", "description": "任务状态", "name": "status", "in": "query" } ], "responses": { "200": { "description": "查询成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/traffic-monitor/tasks/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定任务的详细信息和输出日志", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "流量监控管理" ], "summary": "获取流量监控任务详情", "parameters": [ { "type": "integer", "description": "任务ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "查询成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TrafficMonitorTask" } } } ] } }, "404": { "description": "任务不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/port-config": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新Provider的端口映射配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "更新Provider端口配置", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "description": "Provider端口配置请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ProviderPortConfigRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/provider/{id}/port-usage": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取Provider的端口使用统计", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "端口映射管理" ], "summary": "获取Provider端口使用情况", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Provider 列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取Provider 列表", "responses": { "200": { "description": "获取Provider 列表成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Provider 列表失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建Provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建Provider", "responses": { "200": { "description": "创建Provider成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建Provider失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/check-endpoint": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取检查Provider Endpoint", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "检查Provider Endpoint", "responses": { "200": { "description": "检查Provider Endpoint成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检查Provider Endpoint失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/check-name": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取检查Provider Name", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "检查Provider Name", "responses": { "200": { "description": "检查Provider Name成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检查Provider Name失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/export-configs": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建导出Provider 配置s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "导出Provider 配置s", "responses": { "200": { "description": "导出Provider 配置s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "导出Provider 配置s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/export-csv": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取导出Providers CSV", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "导出Providers CSV", "responses": { "200": { "description": "导出Providers CSV成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "导出Providers CSV失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/freeze": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建冻结Provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "冻结Provider", "responses": { "200": { "description": "冻结Provider成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "冻结Provider失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/freeze-manual": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建冻结Provider Manual", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "冻结Provider Manual", "responses": { "200": { "description": "冻结Provider Manual成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "冻结Provider Manual失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/import-csv": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建导入Providers CSV", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "导入Providers CSV", "responses": { "200": { "description": "导入Providers CSV成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "导入Providers CSV失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/local/detect": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取检测Local Provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "检测Local Provider", "responses": { "200": { "description": "检测Local Provider成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检测Local Provider失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/set-expiry": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建设置Provider Expiry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "设置Provider Expiry", "responses": { "200": { "description": "设置Provider Expiry成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "设置Provider Expiry失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/unfreeze": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建解冻Provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "解冻Provider", "responses": { "200": { "description": "解冻Provider成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "解冻Provider失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/unfreeze-manual": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建解冻Provider Manual", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "解冻Provider Manual", "responses": { "200": { "description": "解冻Provider Manual成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "解冻Provider Manual失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Provider 详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取Provider 详情", "responses": { "200": { "description": "获取Provider 详情成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Provider 详情失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新Provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新Provider", "responses": { "200": { "description": "更新Provider成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新Provider失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "创建持久化后台任务清理Provider及其关联资源;force=true时允许强制清理", "tags": [ "Provider管理" ], "summary": "提交Provider删除任务", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "default": false, "description": "是否强制删除;仅清理数据库,宿主机实例、出口规则和隧道可能残留", "name": "force", "in": "query" } ], "responses": { "200": { "description": "Provider删除任务已提交", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.Task" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权操作该Provider", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "已有冲突任务或任务池暂停接收", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/agent-secret": { "post": { "description": "为 agent 连接模式的 Provider 生成新的鉴权密钥(仅首次),后续调用只返回已有密钥。密钥一旦创建即写死,需删除Provider重建才能刷新。", "produces": [ "application/json" ], "tags": [ "admin/providers" ], "summary": "生成或获取 Provider 的 Agent 密钥", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/admin/providers/{id}/auto-configure-stream": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建自动配置Provider Stream", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "自动配置Provider Stream", "responses": { "200": { "description": "自动配置Provider Stream成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "自动配置Provider Stream失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/block-status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Provider Block 状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取Provider Block 状态", "responses": { "200": { "description": "获取Provider Block 状态成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Provider Block 状态失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/checkin-config": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取管理员 Get 签到 配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Get 签到 配置", "responses": { "200": { "description": "管理员 Get 签到 配置成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Get 签到 配置失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新管理员 Update 签到 配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Update 签到 配置", "responses": { "200": { "description": "管理员 Update 签到 配置成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Update 签到 配置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/cleanup-orphans": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建后台任务,强制单向删除远程服务器上存在但数据库中不存在的实例(主控数据库为权威来源,需双重确认)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Provider管理" ], "summary": "清理孤儿实例", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "清理任务已提交", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/detect-gpus": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取检测GP Us", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "检测GP Us", "responses": { "200": { "description": "检测GP Us成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "检测GP Us失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/discover": { "post": { "security": [ { "BearerAuth": [] } ], "description": "扫描Provider上所有已存在的实例,返回实例列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Provider管理" ], "summary": "发现Provider实例", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "发现成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/provider.DiscoveryResult" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/domain-config": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取域名 配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取域名 配置", "responses": { "200": { "description": "获取域名 配置成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取域名 配置失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新域名 配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新域名 配置", "responses": { "200": { "description": "更新域名 配置成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新域名 配置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/exec": { "post": { "description": "通过 SSH(SSH模式)或 Agent WebSocket(Agent模式)在节点上执行 shell 命令", "produces": [ "application/json" ], "tags": [ "admin/providers" ], "summary": "在 Provider 节点上执行命令", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "description": "命令(JSON: {\\", "name": "command", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": {} } }, "/admin/providers/{id}/fm/download": { "get": { "description": "通过 Agent 控制通道下载节点上的文件(Agent 模式专用)", "produces": [ "application/octet-stream" ], "tags": [ "管理员/Provider" ], "summary": "管理员 Agent 节点文件下载", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程文件路径", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } } } } }, "/admin/providers/{id}/fm/file": { "delete": { "description": "通过 Agent 控制通道删除节点上的文件或空目录(Agent 模式专用)", "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员 Agent 节点文件删除", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程文件路径", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/fm/list": { "get": { "description": "列出 Agent 节点指定路径下的文件和目录(Agent 模式专用)", "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员 Agent 节点文件列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程路径", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/fm/mkdir": { "post": { "description": "通过 Agent 控制通道在节点上创建目录(含父目录,Agent 模式专用)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员 Agent 节点创建目录", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "description": "路径", "name": "body", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/fm/upload": { "post": { "description": "通过 Agent 控制通道上传文件到节点(Agent 模式专用,最大 50 MB)", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员 Agent 节点文件上传", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "目标目录", "name": "targetDir", "in": "formData" }, { "type": "file", "description": "上传文件", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/generate-cert": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建生成Provider 证书", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "生成Provider 证书", "responses": { "200": { "description": "生成Provider 证书成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "生成Provider 证书失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/hardware-report": { "get": { "security": [ { "BearerAuth": [] } ], "tags": [ "Admin-Provider" ], "summary": "获取Provider硬件测试报告", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "tags": [ "Admin-Provider" ], "summary": "通过粘贴板URL保存Provider硬件报告", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "description": "请求体", "name": "data", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "Admin-Provider" ], "summary": "删除Provider硬件报告", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/health-check": { "post": { "security": [ { "BearerAuth": [] } ], "description": "兼容旧客户端;远端健康探测在管理员任务池中执行,请通过任务列表查看结果", "tags": [ "Provider管理" ], "summary": "提交Provider健康检查任务(兼容路由)", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "健康检查任务已提交", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.Task" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "已有同类任务", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/health-check-task": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建持久化后台任务执行远端健康探测与资源刷新", "tags": [ "Provider管理" ], "summary": "提交Provider健康检查任务", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "健康检查任务已提交", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.Task" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "已有同类任务", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/import": { "post": { "security": [ { "BearerAuth": [] } ], "description": "将发现的实例导入到系统中进行管理", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Provider管理" ], "summary": "导入Provider实例", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "description": "导入选项", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/provider.ImportOptions" } } ], "responses": { "200": { "description": "导入成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/provider.ImportResult" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv4-pool": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取指定服务商的IPv4地址池(分页)", "tags": [ "服务商管理" ], "summary": "获取IPv4地址池", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 100, "description": "每页数量", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "向指定服务商的IPv4地址池中追加IP(每行一个IP或CIDR)", "tags": [ "服务商管理" ], "summary": "设置IPv4地址池", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "description": "地址列表(每行一个IP/CIDR,可含注释行)", "name": "body", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "设置成功", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "清空指定服务商地址池中所有未分配的IP地址", "tags": [ "服务商管理" ], "summary": "清空未分配IPv4地址", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "清空成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv4-pool/{entry_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "删除单个IPv4地址", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "地址条目ID", "name": "entry_id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-pool": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取指定服务商的IPv6地址池(分页)", "tags": [ "服务商管理" ], "summary": "获取IPv6地址池", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 100, "description": "每页数量", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "向指定服务商的IPv6地址池中追加离散地址或CIDR网段", "tags": [ "服务商管理" ], "summary": "设置IPv6地址池", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "description": "IPv6地址或CIDR列表", "name": "body", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "设置成功", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "清空指定服务商地址池中所有未分配的IPv6地址和无绑定网段", "tags": [ "服务商管理" ], "summary": "清空未分配IPv6地址", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "清空成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-pool/sync": { "post": { "security": [ { "BearerAuth": [] } ], "description": "读取指定服务商节点上的IPv6地址文件并与主控地址池对账", "tags": [ "服务商管理" ], "summary": "同步节点IPv6地址文件", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "description": "可选的节点IPv6文件绝对路径", "name": "body", "in": "body", "schema": { "type": "object" } } ], "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-pool/{entry_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "删除单个IPv6地址条目", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "地址条目ID", "name": "entry_id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-tunnels": { "get": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "获取Provider IPv6隧道", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "新增Provider IPv6隧道", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "description": "IPv6隧道配置", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ipv6tunnel.CreateRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-tunnels/check": { "post": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "检查Provider IPv6隧道状态", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "检查完成", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-tunnels/detect-local-ipv4": { "post": { "security": [ { "BearerAuth": [] } ], "description": "按隧道服务端IPv4查询节点路由的src字段;未提供服务端时查询默认IPv4出站路由。", "tags": [ "服务商管理" ], "summary": "自动识别IPv6隧道客户端IPv4", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "description": "可选的隧道服务端IPv4", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/ipv6tunnel.DetectLocalIPv4Request" } } ], "responses": { "200": { "description": "识别成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-tunnels/{tunnel_id}": { "put": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "更新Provider IPv6隧道", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "隧道ID", "name": "tunnel_id", "in": "path", "required": true }, { "description": "IPv6隧道配置", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ipv6tunnel.Config" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "删除Provider IPv6隧道", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "隧道ID", "name": "tunnel_id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-tunnels/{tunnel_id}/disable": { "post": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "禁用Provider IPv6隧道", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "隧道ID", "name": "tunnel_id", "in": "path", "required": true } ], "responses": { "200": { "description": "禁用成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/ipv6-tunnels/{tunnel_id}/enable": { "post": { "security": [ { "BearerAuth": [] } ], "tags": [ "服务商管理" ], "summary": "启用Provider IPv6隧道", "parameters": [ { "type": "integer", "description": "服务商ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "隧道ID", "name": "tunnel_id", "in": "path", "required": true } ], "responses": { "200": { "description": "启用成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/agent": { "post": { "description": "将监控Agent部署到指定节点主机(耗时最長十分钟)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "部署监控Agent", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true }, { "description": "部署参数(version可选)", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/admin.DeployAgentRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "description": "从指定节点主机卸载监控Agent", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "卸载监控Agent", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/agent-monitors": { "get": { "description": "直接从 Agent读取监控器列表;Agent模式节点回读数据库缓存", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "获取Agent监控列表(实时)", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "description": "每页条数", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/clear": { "delete": { "description": "清除指定节点下所有Agent监控记录及资源指标", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "清空节点监控器", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/config": { "get": { "description": "获取指定节点的监控配置", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "获取监控配置", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "description": "更新指定节点的监控配置,如果Agent已安装则同步配置到远程Agent", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "更新监控配置", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true }, { "description": "监控配置", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateMonitoringConfigRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/monitors": { "get": { "description": "获取指定节点下所有Agent监控记录,支持分页", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "获取节点监控列表(DB)", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "description": "每页条数", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/resources": { "get": { "description": "获取节点下所有实例的最新资源使用汇总", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "获取节点资源汇总", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/status": { "get": { "description": "检查指定节点的监控Agent运行状态、版本与监控数量", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "获取Agent状态", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/sync": { "post": { "description": "创建后台任务确保所有运行中实例均有监控器,并清理失效的监控记录", "produces": [ "application/json" ], "tags": [ "管理员/节点" ], "summary": "同步节点监控器", "parameters": [ { "type": "integer", "description": "节点ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/sync/latest": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Latest Provider 监控 Sync 任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取Latest Provider 监控 Sync 任务", "responses": { "200": { "description": "获取Latest Provider 监控 Sync 任务成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Latest Provider 监控 Sync 任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/monitoring/sync/{taskId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Provider 监控 Sync 任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取Provider 监控 Sync 任务", "responses": { "200": { "description": "获取Provider 监控 Sync 任务成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Provider 监控 Sync 任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/orphaned": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取Provider上已存在但未被系统纳管的实例列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Provider管理" ], "summary": "获取未纳管实例", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/provider.DiscoveredInstance" } } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/sftp/download": { "get": { "description": "下载管理员连接到节点宿主机上的远程文件", "produces": [ "application/octet-stream" ], "tags": [ "管理员/Provider" ], "summary": "管理员节点SFTP下载", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程文件路径", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } } } } }, "/admin/providers/{id}/sftp/list": { "get": { "description": "列出管理员连接到节点宿主机后的远程目录文件", "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员节点SFTP目录列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程路径", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/sftp/upload": { "post": { "description": "上传本地文件到管理员连接到节点宿主机上的远程目录", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员节点SFTP上传", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "formData" }, { "type": "file", "description": "上传文件", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/sftp/upload/abort": { "post": { "description": "清理节点宿主机指定 uploadId 对应临时分片文件,允许重传", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员节点SFTP上传中断清理", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "上传ID", "name": "uploadId", "in": "formData", "required": true }, { "type": "string", "description": "远程目标文件路径", "name": "targetPath", "in": "formData" }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "formData" }, { "type": "string", "description": "文件名", "name": "filename", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/sftp/upload/status": { "get": { "description": "查询节点宿主机分片上传进度,用于断点续传", "produces": [ "application/json" ], "tags": [ "管理员/Provider" ], "summary": "管理员节点SFTP上传状态", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "上传ID", "name": "uploadId", "in": "query", "required": true }, { "type": "string", "description": "远程目标文件路径", "name": "targetPath", "in": "query" }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "query" }, { "type": "string", "description": "文件名", "name": "filename", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/stopped-containers": { "get": { "description": "通过SSH或Agent连接到LXD/Incus/Docker/Podman/Containerd/Orbstack节点,返回可作为复制源的容器名称列表", "produces": [ "application/json" ], "tags": [ "admin/providers" ], "summary": "获取节点上可用于复制模式的源容器列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/admin/providers/{id}/sync-check": { "post": { "security": [ { "BearerAuth": [] } ], "description": "比较数据库实例与Provider远程实例,检测新增、删除和变化的实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Provider管理" ], "summary": "检查实例同步", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "检查成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/provider.InstanceSyncReport" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/sync-instances": { "post": { "security": [ { "BearerAuth": [] } ], "description": "为已开启非纯净节点发现的Provider创建持久化后台同步任务", "tags": [ "Provider管理" ], "summary": "提交节点实例同步任务", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步任务已提交", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.Task" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "已有同类任务", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{id}/terminal": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取管理员 Provider 终端", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 Provider 终端", "responses": { "200": { "description": "管理员 Provider 终端成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 Provider 终端失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/providers/{provider_id}/traffic/history": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider的历史流量数据,支持5分钟到24小时的灵活时间范围", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "流量管理-管理员" ], "summary": "获取Provider流量历史", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "provider_id", "in": "path", "required": true }, { "type": "string", "default": "1h", "description": "时间范围: 5m, 10m, 15m, 30m, 45m, 1h, 6h, 12h, 24h", "name": "period", "in": "query" }, { "type": "integer", "default": 0, "description": "数据点间隔(分钟),0表示自动选择", "name": "interval", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/monitoring.ProviderTrafficHistory" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/quota/users/{userId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取用户 配额 信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取用户 配额 信息", "responses": { "200": { "description": "获取用户 配额 信息成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取用户 配额 信息失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/redemption-codes": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取兑换码列表,支持分页和筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "兑换码管理" ], "summary": "获取兑换码列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "兑换码关键字", "name": "code", "in": "query" }, { "type": "string", "description": "状态筛选", "name": "status", "in": "query" }, { "type": "integer", "description": "节点ID筛选", "name": "providerId", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/redemption-codes/batch-create": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量创建兑换码,触发后台实例创建任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "兑换码管理" ], "summary": "批量创建兑换码", "parameters": [ { "description": "批量创建请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchCreateRedemptionCodesRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/redemption-codes/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除兑换码(硬删除)及关联实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "兑换码管理" ], "summary": "批量删除兑换码", "parameters": [ { "description": "批量删除请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchDeleteRedemptionCodesRequest" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/redemption-codes/export": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员导出指定兑换码的字符串列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "兑换码管理" ], "summary": "导出兑换码", "parameters": [ { "description": "导出请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ExportRedemptionCodesRequest" } } ], "responses": { "200": { "description": "导出成功", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshot-batches": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建批量Create 实例 快照s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量Create 实例 快照s", "responses": { "200": { "description": "批量Create 实例 快照s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "批量Create 实例 快照s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshot-schedules": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取快照 计划s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取快照 计划s", "responses": { "200": { "description": "获取快照 计划s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取快照 计划s失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建快照 计划", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建快照 计划", "responses": { "200": { "description": "创建快照 计划成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建快照 计划失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshot-schedules/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新快照 计划", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新快照 计划", "responses": { "200": { "description": "更新快照 计划成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新快照 计划失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除快照 计划", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除快照 计划", "responses": { "200": { "description": "删除快照 计划成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除快照 计划失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshot-tasks/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取快照 任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取快照 任务", "responses": { "200": { "description": "获取快照 任务成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取快照 任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshots": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取快照 列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取快照 列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" } ], "responses": { "200": { "description": "获取快照 列表成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取快照 列表失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshots/download/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取下载快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "下载快照", "responses": { "200": { "description": "下载快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "下载快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshots/overview": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取快照 概览", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取快照 概览", "responses": { "200": { "description": "获取快照 概览成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取快照 概览失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshots/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除快照", "responses": { "200": { "description": "删除快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/snapshots/{id}/restore": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建恢复快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "恢复快照", "responses": { "200": { "description": "恢复快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "恢复快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/storage/cleanup": { "post": { "security": [ { "BearerAuth": [] } ], "description": "清理临时目录中的所有文件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "清理临时文件", "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/storage/info": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取存储目录结构和状态信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "获取存储目录信息", "responses": { "200": { "description": "success", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/admin/storage/init": { "post": { "security": [ { "BearerAuth": [] } ], "description": "重新创建所有必要的存储目录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "重新初始化存储目录", "responses": { "200": { "description": "success", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system-images": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统镜像列表,支持分页和过滤条件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统镜像管理" ], "summary": "获取系统镜像列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "enum": [ "proxmox", "lxd", "incus", "docker" ], "type": "string", "description": "提供商类型", "name": "providerType", "in": "query" }, { "enum": [ "vm", "container" ], "type": "string", "description": "实例类型", "name": "instanceType", "in": "query" }, { "enum": [ "amd64", "arm64", "s390x" ], "type": "string", "description": "架构", "name": "architecture", "in": "query" }, { "enum": [ "active", "inactive" ], "type": "string", "description": "状态", "name": "status", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "search", "in": "query" }, { "type": "string", "description": "操作系统类型", "name": "osType", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建新的系统镜像配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统镜像管理" ], "summary": "创建系统镜像", "parameters": [ { "description": "创建系统镜像请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/system.CreateSystemImageRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "镜像名称已存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system-images/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建批量Delete System 镜像s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量Delete System 镜像s", "responses": { "200": { "description": "批量Delete System 镜像s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "批量Delete System 镜像s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system-images/batch-status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新批量Update System 镜像 状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量Update System 镜像 状态", "responses": { "200": { "description": "批量Update System 镜像 状态成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "批量Update System 镜像 状态失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system-images/sync": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建同步System 镜像s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "同步System 镜像s", "responses": { "200": { "description": "同步System 镜像s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "同步System 镜像s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system-images/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新System 镜像", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新System 镜像", "responses": { "200": { "description": "更新System 镜像成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新System 镜像失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除System 镜像", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除System 镜像", "responses": { "200": { "description": "删除System 镜像成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除System 镜像失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system/check-updates": { "get": { "security": [ { "BearerAuth": [] } ], "description": "根据部署模式返回在线升级能力;Docker、Compose、源码和未知模式仅展示人工命令。", "produces": [ "application/json" ], "tags": [ "系统更新" ], "summary": "查看更新能力和版本", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system/restart": { "post": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "系统更新" ], "summary": "重启主控服务", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system/rollback": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统更新" ], "summary": "在线回退", "parameters": [ { "description": "目标版本", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/update.UpdateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system/rollback-versions": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "系统更新" ], "summary": "查看回退版本", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system/update": { "post": { "security": [ { "BearerAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统更新" ], "summary": "在线升级", "parameters": [ { "description": "目标版本,留空表示最新版本", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/update.UpdateRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/system/update-status": { "get": { "security": [ { "BearerAuth": [] } ], "produces": [ "application/json" ], "tags": [ "系统更新" ], "summary": "查看更新任务状态", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有用户的任务列表,支持分页和筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取管理员任务列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "type": "string", "description": "用户名", "name": "username", "in": "query" }, { "type": "string", "description": "任务类型", "name": "taskType", "in": "query" }, { "type": "string", "description": "任务状态", "name": "status", "in": "query" }, { "type": "string", "description": "实例类型", "name": "instanceType", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.AdminTaskListResponse" } } } ] } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/force-stop": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员强制停止运行中的任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "强制停止任务", "parameters": [ { "description": "强制停止任务请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ForceStopTaskRequest" } } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/overall-stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有任务的总体统计信息,包括各种状态的任务数量", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取任务总体统计信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TaskStatsResponse" } } } ] } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/pool-status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取任务池是否接受新任务以及当前队列排空状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取任务池全局状态", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TaskPoolStatusResponse" } } } ] } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "超级管理员开启/关闭任务池新任务入口,关闭后不会再新增 pending 任务,但已有任务继续执行", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新任务池全局开关", "parameters": [ { "description": "任务池开关请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.TaskPoolControlRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TaskPoolStatusResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统任务统计信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取任务统计", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.TaskStatsResponse" } } } ] } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/{taskId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "管理员获取指定任务的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取任务详情", "parameters": [ { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.AdminTaskDetailResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "任务不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/tasks/{taskId}/cancel": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员取消指定用户的任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员取消用户任务", "parameters": [ { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/batch-manage": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "批量设置或解除用户的流量限制", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "批量管理流量限制", "parameters": [ { "description": "批量流量限制管理请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/traffic.BatchManageTrafficLimitRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/batch-sync": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "批量触发用户流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "批量同步用户流量", "parameters": [ { "description": "批量同步流量请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/traffic.BatchSyncTrafficRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/manage": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "手动设置或解除用户/Provider的流量限制", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "管理流量限制", "parameters": [ { "description": "流量限制管理请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/traffic.ManageTrafficLimitRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/overview": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取整个系统的流量使用情况概览", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取系统流量概览", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/provider/{providerId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定Provider的流量使用情况", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取Provider流量统计", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/all": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发全系统所有实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步全系统流量数据", "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/instance/{instance_id}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发指定实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步单个实例的流量数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/provider/{provider_id}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发指定Provider所有实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步Provider所有实例的流量数据", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "provider_id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/sync/user/{user_id}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "立即触发指定用户所有实例的流量数据同步", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员-流量同步" ], "summary": "手动同步用户所有实例的流量数据", "parameters": [ { "type": "integer", "description": "用户ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "同步成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/user/{userId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定用户的流量使用情况", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取用户流量统计", "parameters": [ { "type": "integer", "description": "用户ID", "name": "userId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/user/{userId}/clear": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "删除指定用户的所有历史流量记录,用于重新计数", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "清空用户流量记录", "parameters": [ { "type": "integer", "description": "用户ID", "name": "userId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/traffic/users/rank": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取系统中所有用户的流量使用排行榜,支持分页和搜索", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员流量" ], "summary": "获取用户流量排行榜", "parameters": [ { "type": "integer", "description": "页码,默认1", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量,默认10", "name": "pageSize", "in": "query" }, { "type": "string", "description": "按用户名搜索", "name": "username", "in": "query" }, { "type": "string", "description": "按昵称搜索", "name": "nickname", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统中所有用户的列表(分页)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "获取用户列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "用户名搜索", "name": "username", "in": "query" }, { "type": "string", "description": "昵称搜索", "name": "nickname", "in": "query" }, { "type": "string", "description": "邮箱搜索", "name": "email", "in": "query" }, { "type": "string", "description": "用户状态", "name": "status", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员创建新用户账户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "创建用户", "parameters": [ { "description": "创建用户请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.CreateUserRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/batch-delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量删除用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员批量删除用户", "parameters": [ { "description": "批量删除用户请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchDeleteUsersRequest" } } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/batch-level": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量更新多个用户的等级", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "批量更新用户等级", "parameters": [ { "description": "批量更新用户等级请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchUpdateUserLevelRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/batch-status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员批量更新用户状态(启用/禁用)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员批量更新用户状态", "parameters": [ { "description": "批量更新用户状态请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.BatchUpdateUserStatusRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/set-expiry": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建设置用户 Expiry", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "设置用户 Expiry", "responses": { "200": { "description": "设置用户 Expiry成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "设置用户 Expiry失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新用户", "responses": { "200": { "description": "更新用户成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新用户失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "删除用户", "responses": { "200": { "description": "删除用户成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除用户失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/level": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新指定用户的等级", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新用户等级", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "更新用户等级请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateUserLevelRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/login-as": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建管理员 日志in As 用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员 日志in As 用户", "responses": { "200": { "description": "管理员 日志in As 用户成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "管理员 日志in As 用户失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员强制重置指定用户的登录密码,系统自动生成符合安全策略的新密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员强制重置用户密码", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "重置密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ResetUserPasswordRequest" } } ], "responses": { "200": { "description": "重置成功,返回新密码", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/admin.ResetUserPasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "重置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/reset-password-notify": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员重置指定用户的登录密码,系统自动生成符合安全策略的新密码并发送到用户绑定的通信渠道", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "管理员重置用户密码并发送到用户通信渠道", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "重置密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.ResetUserPasswordRequest" } } ], "responses": { "200": { "description": "重置成功,新密码已发送到用户绑定的通信渠道", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "用户不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "重置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/admin/users/{id}/status": { "put": { "security": [ { "BearerAuth": [] } ], "description": "管理员更新用户状态(启用/禁用)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员管理" ], "summary": "更新用户状态", "parameters": [ { "type": "integer", "description": "用户ID", "name": "id", "in": "path", "required": true }, { "description": "更新用户状态请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/admin.UpdateUserStatusRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/captcha": { "get": { "description": "生成图片验证码用于用户验证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "获取验证码", "parameters": [ { "type": "integer", "default": 120, "description": "验证码宽度", "name": "width", "in": "query" }, { "type": "integer", "default": 40, "description": "验证码高度", "name": "height", "in": "query" } ], "responses": { "200": { "description": "验证码生成成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/forgot-password": { "post": { "description": "发送密码重置邮件", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "忘记密码", "parameters": [ { "description": "忘记密码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.ForgotPasswordRequest" } } ], "responses": { "200": { "description": "重置邮件发送成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/login": { "post": { "description": "用户登录接口,验证用户名密码并返回JWT token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "用户登录", "parameters": [ { "description": "登录请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.LoginRequest" } } ], "responses": { "200": { "description": "登录成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/logout": { "post": { "security": [ { "BearerAuth": [] } ], "description": "撤销当前用户的JWT token并登出", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "用户登出", "responses": { "200": { "description": "登出成功", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未认证", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/oauth2/callback": { "get": { "description": "处理OAuth2提供商的回调", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证" ], "summary": "OAuth2回调", "parameters": [ { "type": "string", "description": "授权码", "name": "code", "in": "query", "required": true }, { "type": "string", "description": "状态令牌", "name": "state", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/auth/oauth2/login": { "get": { "description": "跳转到OAuth2提供商的授权页面", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证" ], "summary": "OAuth2登录", "parameters": [ { "type": "string", "description": "提供商名称(如linuxdo)", "name": "provider", "in": "query" }, { "type": "integer", "description": "提供商ID", "name": "provider_id", "in": "query" } ], "responses": { "302": { "description": "重定向到OAuth2授权页面", "schema": { "type": "string" } } } } }, "/auth/register": { "post": { "description": "创建新用户账户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "用户注册", "parameters": [ { "description": "注册请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.RegisterRequest" } } ], "responses": { "200": { "description": "注册成功,返回用户信息和token", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "请求参数错误或注册失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/reset-password": { "post": { "description": "使用重置令牌自动生成新密码并通过用户绑定的通信渠道发送", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "重置密码", "parameters": [ { "description": "重置密码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.ResetPasswordRequest" } } ], "responses": { "200": { "description": "密码重置成功,新密码已发送到绑定的通信渠道", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/auth/send-verify-code": { "post": { "description": "向指定的邮箱/Telegram/QQ发送登录验证码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "认证管理" ], "summary": "发送验证码", "parameters": [ { "description": "发送验证码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.SendVerifyCodeRequest" } } ], "responses": { "200": { "description": "验证码发送成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/config": { "get": { "security": [ { "BearerAuth": [] } ], "description": "根据用户权限返回相应的配置信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "配置管理" ], "summary": "获取系统配置", "parameters": [ { "enum": [ "public", "user", "admin" ], "type": "string", "default": "user", "description": "配置范围", "name": "scope", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": {} } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "根据用户权限更新相应的配置信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "配置管理" ], "summary": "更新系统配置", "parameters": [ { "description": "配置更新请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/config.UnifiedConfigRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "权限不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/dashboard/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统总体统计信息,包括用户数、实例数等", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "仪表板" ], "summary": "获取仪表板统计数据", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/health": { "get": { "description": "检查数据库连接和系统状态", "produces": [ "application/json" ], "tags": [ "Health" ], "summary": "系统健康检查", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/oauth2/presets": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有可用的OAuth2预设配置(linuxdo, idcflare, github, generic)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取OAuth2预设配置", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "$ref": "#/definitions/oauth2.PresetConfig" } } } } ] } } } } }, "/oauth2/presets/{name}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定名称的OAuth2预设配置详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取指定预设配置", "parameters": [ { "enum": [ "linuxdo", "idcflare", "github", "generic" ], "type": "string", "description": "预设名称", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth2.PresetConfig" } } } ] } } } } }, "/oauth2/providers": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取所有OAuth2提供商(包括禁用的)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取OAuth2提供商列表", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/oauth2.OAuth2Provider" } } } } ] } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建新的OAuth2提供商配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "创建OAuth2提供商", "parameters": [ { "description": "提供商配置", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth2.CreateProviderRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth2.OAuth2Provider" } } } ] } } } } }, "/oauth2/providers/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定OAuth2提供商的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取OAuth2提供商详情", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth2.OAuth2Provider" } } } ] } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "更新OAuth2提供商配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "更新OAuth2提供商", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true }, { "description": "更新内容", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth2.UpdateProviderRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除OAuth2提供商(如有用户使用则无法删除)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "删除OAuth2提供商", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/oauth2/providers/{id}/reset-count": { "post": { "security": [ { "BearerAuth": [] } ], "description": "重置OAuth2提供商的注册计数", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "重置注册计数", "parameters": [ { "type": "integer", "description": "提供商ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取系统中配置的所有虚拟化提供者", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取所有Provider", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } } } } }, "/provider/connect": { "post": { "security": [ { "BearerAuth": [] } ], "description": "连接到虚拟化提供者(如Docker、LXD、Proxmox等)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "连接虚拟化Provider", "parameters": [ { "description": "连接参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oneclickvirt_service_provider.ConnectProviderRequest" } } ], "responses": { "200": { "description": "连接成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "连接失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/{id}/capabilities": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider支持的功能和实例类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取Provider能力", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/{id}/instances": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider下的所有实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取实例列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "在指定Provider上创建新的虚拟机或容器实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "创建实例", "parameters": [ { "enum": [ "docker", "lxd", "incus", "proxmox" ], "type": "string", "description": "Provider类型", "name": "type", "in": "path", "required": true }, { "description": "创建实例请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oneclickvirt_service_provider.CreateInstanceRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/provider/{id}/status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider的连接状态和支持的实例类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "虚拟化管理" ], "summary": "获取Provider状态", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "404": { "description": "Provider不存在", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/providers": { "get": { "security": [ { "BearerAuth": [] }, { "BearerAuth": [] } ], "description": "获取获取Providers\n获取获取Providers", "consumes": [ "application/json", "application/json" ], "produces": [ "application/json", "application/json" ], "tags": [ "Provider管理", "系统管理" ], "summary": "获取Providers", "responses": { "200": { "description": "获取Providers成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Providers失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/providers/{id}/instances": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Provider管理" ], "summary": "创建实例", "responses": { "200": { "description": "创建实例成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "Provider资源或配额不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建实例失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/providers/{id}/instances/{name}": { "delete": { "security": [ { "BearerAuth": [] }, { "BearerAuth": [] } ], "description": "删除删除实例\n删除删除实例", "consumes": [ "application/json", "application/json" ], "produces": [ "application/json", "application/json" ], "tags": [ "管理员管理", "Provider管理" ], "summary": "删除实例", "responses": { "200": { "description": "删除实例成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除实例失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/providers/{id}/status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Provider 状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Provider管理" ], "summary": "获取Provider 状态", "responses": { "200": { "description": "获取Provider 状态成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Provider 状态失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/announcements": { "get": { "description": "获取获取系统公告", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取系统公告", "responses": { "200": { "description": "获取系统公告成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取系统公告失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/init": { "post": { "description": "进行系统的初始化设置,创建管理员和默认用户", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "初始化系统", "parameters": [ { "description": "初始化请求参数", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "初始化成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误或系统已初始化", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "初始化失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/init-progress": { "get": { "description": "轮询此接口获取系统初始化的实时进度,status 为 success 时初始化完成", "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "获取系统初始化进度", "responses": { "200": { "description": "进度信息", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/init/check": { "get": { "description": "检查系统是否需要进行初始化设置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "检查系统初始化状态", "responses": { "200": { "description": "检查成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/instance-shares/{token}": { "get": { "description": "获取获取共享d 实例 详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 详情", "responses": { "200": { "description": "获取共享d 实例 详情成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 详情失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/action": { "post": { "description": "创建共享d 实例 操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d 实例 操作", "responses": { "200": { "description": "共享d 实例 操作成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d 实例 操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/exec": { "get": { "description": "获取共享d 执行 Web Socket", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d 执行 Web Socket", "responses": { "200": { "description": "共享d 执行 Web Socket成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d 执行 Web Socket失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/images/filtered": { "get": { "description": "获取获取共享d 实例 镜像s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 镜像s", "responses": { "200": { "description": "获取共享d 实例 镜像s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 镜像s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/monitoring": { "get": { "description": "获取获取共享d 实例 监控ing", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 监控ing", "responses": { "200": { "description": "获取共享d 实例 监控ing成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 监控ing失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/monitoring/resources": { "get": { "description": "获取获取共享d 实例 资源 监控ing", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 资源 监控ing", "responses": { "200": { "description": "获取共享d 实例 资源 监控ing成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 资源 监控ing失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/password/{taskId}": { "get": { "description": "获取获取共享d 实例 New 密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 New 密码", "responses": { "200": { "description": "获取共享d 实例 New 密码成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 New 密码失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/ports": { "get": { "description": "获取获取共享d 实例 Ports", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 Ports", "responses": { "200": { "description": "获取共享d 实例 Ports成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 Ports失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/reset-password": { "put": { "description": "更新Reset 共享d 实例 密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "Reset 共享d 实例 密码", "responses": { "200": { "description": "Reset 共享d 实例 密码成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "Reset 共享d 实例 密码失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/sftp/download": { "get": { "description": "获取共享d SFTP Download", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d SFTP Download", "responses": { "200": { "description": "共享d SFTP Download成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d SFTP Download失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/sftp/list": { "get": { "description": "获取共享d SFTP 列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d SFTP 列表", "responses": { "200": { "description": "共享d SFTP 列表成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d SFTP 列表失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/sftp/upload": { "post": { "description": "创建共享d SFTP Upload", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d SFTP Upload", "responses": { "200": { "description": "共享d SFTP Upload成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d SFTP Upload失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/sftp/upload/abort": { "post": { "description": "创建共享d SFTP Upload Abort", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d SFTP Upload Abort", "responses": { "200": { "description": "共享d SFTP Upload Abort成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d SFTP Upload Abort失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/sftp/upload/status": { "get": { "description": "获取共享d SFTP Upload 状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d SFTP Upload 状态", "responses": { "200": { "description": "共享d SFTP Upload 状态成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d SFTP Upload 状态失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/snapshots": { "get": { "description": "获取获取共享d 实例 快照s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 快照s", "responses": { "200": { "description": "获取共享d 实例 快照s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 快照s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/snapshots/{snapshotId}/download": { "get": { "description": "获取下载共享d 快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "下载共享d 快照", "responses": { "200": { "description": "下载共享d 快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "下载共享d 快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/ssh": { "get": { "description": "获取共享d SSH Web Socket", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "共享d SSH Web Socket", "responses": { "200": { "description": "共享d SSH Web Socket成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "共享d SSH Web Socket失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/instance-shares/{token}/traffic/detail": { "get": { "description": "获取获取共享d 实例 流量 详情", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取共享d 实例 流量 详情", "responses": { "200": { "description": "获取共享d 实例 流量 详情成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取共享d 实例 流量 详情失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/oauth2/providers": { "get": { "description": "获取所有启用的OAuth2提供商(公开接口)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "OAuth2" ], "summary": "获取启用的OAuth2提供商", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "additionalProperties": true } } } } ] } } } } }, "/public/providers/{id}/hardware-report": { "get": { "tags": [ "Public" ], "summary": "获取Provider硬件报告(用户端)", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/recommended-db-type": { "get": { "description": "根据系统架构获取推荐的数据库类型", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "获取推荐的数据库类型", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/register-config": { "get": { "description": "获取注册页面所需的配置信息(不需要认证)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "获取注册配置信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/system-config": { "get": { "description": "获取系统公开配置信息(不需要认证),如默认语言等,从内存配置读取", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统配置" ], "summary": "获取公开的系统配置信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } } } } }, "/public/system-images/available": { "get": { "description": "获取获取可用系统镜像", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "公开接口" ], "summary": "获取可用系统镜像", "responses": { "200": { "description": "获取可用系统镜像成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取可用系统镜像失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/public/test-db-connection": { "post": { "description": "测试数据库连接是否可用,用于初始化前验证数据库配置", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "系统初始化" ], "summary": "测试数据库连接", "parameters": [ { "description": "数据库连接参数", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "连接成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "连接失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/resources/virtualization/providers": { "get": { "security": [ { "BearerAuth": [] }, { "BearerAuth": [] } ], "description": "获取获取Providers\n获取获取Providers", "consumes": [ "application/json", "application/json" ], "produces": [ "application/json", "application/json" ], "tags": [ "Provider管理", "系统管理" ], "summary": "获取Providers", "responses": { "200": { "description": "获取Providers成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Providers失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/active-reservations": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的所有活跃资源预留记录", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户的活跃资源预留", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/resource.ResourceReservation" } } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/api-tokens": { "get": { "security": [ { "BearerAuth": [] } ], "description": "用户获取自己的API Token列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "API Token管理" ], "summary": "获取API Token列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "用户创建自己的API访问令牌", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "API Token管理" ], "summary": "创建API Token", "parameters": [ { "description": "创建Token请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.ApiTokenCreateRequest" } } ], "responses": { "200": { "description": "创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/auth.ApiTokenCreateResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/api-tokens/:id": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "用户硬删除自己的API Token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "API Token管理" ], "summary": "删除API Token", "parameters": [ { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "删除成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/checkin": { "post": { "security": [ { "BearerAuth": [] } ], "description": "为单个实例执行签到续期", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/签到续期" ], "summary": "用户签到续期", "parameters": [ { "description": "签到请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/checkin.DoCheckinRequest" } } ], "responses": { "200": { "description": "签到成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/checkin/batch": { "post": { "security": [ { "BearerAuth": [] } ], "description": "为多个实例执行签到续期,最多 50 个实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/签到续期" ], "summary": "批量签到续期", "parameters": [ { "description": "批量签到请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/checkin.BatchCheckinRequest" } } ], "responses": { "200": { "description": "签到成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/checkin.BatchCheckinResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/checkin/batch-checkin": { "post": { "security": [ { "BearerAuth": [] } ], "description": "为多个实例执行签到续期,最多 50 个实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/签到续期" ], "summary": "批量签到续期", "parameters": [ { "description": "批量签到请求", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/checkin.BatchCheckinRequest" } } ], "responses": { "200": { "description": "签到成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/checkin.BatchCheckinResult" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/checkin/code/{instance_id}": { "post": { "security": [ { "BearerAuth": [] } ], "description": "为指定实例生成签到续期所需的验证码或 PoW challenge", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/签到续期" ], "summary": "获取签到验证挑战", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/checkin/eligible-instances": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取Eligible 签到 实例s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取Eligible 签到 实例s", "responses": { "200": { "description": "获取Eligible 签到 实例s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取Eligible 签到 实例s失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/checkin/records": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的签到续期记录,支持分页和筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/签到续期" ], "summary": "获取签到记录", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "开始日期 YYYY-MM-DD", "name": "startDate", "in": "query" }, { "type": "string", "description": "结束日期 YYYY-MM-DD", "name": "endDate", "in": "query" }, { "type": "integer", "description": "实例ID", "name": "instanceId", "in": "query" }, { "enum": [ "all", "success", "failed" ], "type": "string", "description": "结果筛选", "name": "result", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/checkin/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户签到次数、连续签到、最长连续签到和累计续期天数", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/签到续期" ], "summary": "获取签到统计", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/checkin.CheckinStats" } } } ] } }, "401": { "description": "认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/dashboard": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的仪表板数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户仪表板", "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/domains": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取用户 域名s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户 域名s", "responses": { "200": { "description": "获取用户 域名s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取用户 域名s失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建用户 域名", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "创建用户 域名", "responses": { "200": { "description": "创建用户 域名成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建用户 域名失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/domains/{id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新更新用户 域名", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "更新用户 域名", "responses": { "200": { "description": "更新用户 域名成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新用户 域名失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除用户 域名", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "删除用户 域名", "responses": { "200": { "description": "删除用户 域名成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除用户 域名失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/images": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以使用的系统镜像列表,支持按Provider和实例类型过滤", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取系统镜像列表", "parameters": [ { "type": "string", "description": "Provider类型", "name": "providerType", "in": "query" }, { "type": "integer", "description": "Provider ID", "name": "providerId", "in": "query" }, { "enum": [ "container", "vm" ], "type": "string", "description": "实例类型", "name": "instanceType", "in": "query" }, { "type": "string", "description": "架构", "name": "architecture", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/user.SystemImageResponse" } } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/images/filtered": { "get": { "security": [ { "BearerAuth": [] } ], "description": "根据Provider ID和实例类型获取匹配的系统镜像列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取过滤后的系统镜像列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "provider_id", "in": "query", "required": true }, { "enum": [ "container", "vm" ], "type": "string", "description": "实例类型", "name": "instance_type", "in": "query", "required": true }, { "enum": [ "amd64", "arm64" ], "type": "string", "description": "架构类型", "name": "architecture", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/user.SystemImageResponse" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/info": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户信息", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "用户未授权", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instance-config": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取可用的镜像、规格等实例创建配置选项", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例配置选项", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.InstanceConfigResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instance-type-permissions": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以创建的实例类型权限配置,基于用户配额和Provider能力", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例类型权限配置", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的所有实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户实例列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "实例状态", "name": "status", "in": "query" }, { "type": "string", "description": "实例类型", "name": "type", "in": "query" }, { "type": "string", "description": "节点名称", "name": "providerName", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "用户创建新的虚拟机或容器实例(异步处理)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "创建实例", "parameters": [ { "description": "创建实例请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.CreateInstanceRequest" } } ], "responses": { "200": { "description": "任务创建成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "409": { "description": "Provider资源或用户配额不足", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/action": { "post": { "security": [ { "BearerAuth": [] } ], "description": "对用户实例执行操作(启动、停止、重启等)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "实例操作", "parameters": [ { "description": "实例操作请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.InstanceActionRequest" } } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/batch-action": { "post": { "security": [ { "BearerAuth": [] } ], "description": "对当前用户的多个实例批量执行启动、停止、重启、重置、删除等操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "批量实例操作", "parameters": [ { "description": "批量实例操作请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.BatchInstanceActionRequest" } } ], "responses": { "200": { "description": "批量操作已处理", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.BatchInstanceActionResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户实例的详细信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户实例详情", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.UserInstanceDetailResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/exec": { "get": { "description": "通过WebSocket建立到容器的交互式终端连接(exec)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/实例" ], "summary": "WebSocket Container Exec", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "101": { "description": "Switching Protocols", "schema": { "type": "string" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/monitoring": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户实例的监控数据,包括流量统计信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例监控数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.InstanceMonitoringResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/monitoring/resources": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取实例 资源 监控ing", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例 资源 监控ing", "responses": { "200": { "description": "获取实例 资源 监控ing成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取实例 资源 监控ing失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/monitoring/status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取实例 监控ing 状态", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例 监控ing 状态", "responses": { "200": { "description": "获取实例 监控ing 状态成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取实例 监控ing 状态失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/password/{taskId}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "通过任务ID获取实例重置后的新密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例重置后的新密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.GetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "任务不存在或未完成", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/ports": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定实例的端口映射信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例端口映射", "parameters": [ { "type": "string", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "用户重置自己实例的登录密码,创建异步任务执行密码重置操作", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "用户重置实例密码", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "description": "重置实例密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ResetInstancePasswordRequest" } } ], "responses": { "200": { "description": "任务创建成功,返回任务ID", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.ResetInstancePasswordResponse" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "实例不存在或无权限", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建任务失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/sftp/download": { "get": { "description": "下载用户实例上的远程文件", "produces": [ "application/octet-stream" ], "tags": [ "用户/实例" ], "summary": "用户实例SFTP下载", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程文件路径", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } } } } }, "/user/instances/{id}/sftp/list": { "get": { "description": "列出用户实例远程目录文件", "produces": [ "application/json" ], "tags": [ "用户/实例" ], "summary": "用户实例SFTP目录列表", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程路径", "name": "path", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/sftp/upload": { "post": { "description": "上传本地文件到用户实例远程目录", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "用户/实例" ], "summary": "用户实例SFTP上传", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "formData" }, { "type": "file", "description": "上传文件", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/sftp/upload/abort": { "post": { "description": "清理指定 uploadId 对应的临时分片文件,允许重传", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "用户/实例" ], "summary": "用户实例SFTP上传中断清理", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "上传ID", "name": "uploadId", "in": "formData", "required": true }, { "type": "string", "description": "远程目标文件路径", "name": "targetPath", "in": "formData" }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "formData" }, { "type": "string", "description": "文件名", "name": "filename", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/sftp/upload/status": { "get": { "description": "查询分片上传进度,用于断点续传", "produces": [ "application/json" ], "tags": [ "用户/实例" ], "summary": "用户实例SFTP上传状态", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "上传ID", "name": "uploadId", "in": "query", "required": true }, { "type": "string", "description": "远程目标文件路径", "name": "targetPath", "in": "query" }, { "type": "string", "description": "远程目标目录", "name": "targetDir", "in": "query" }, { "type": "string", "description": "文件名", "name": "filename", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/share-links": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建用户 实例 共享", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "创建用户 实例 共享", "responses": { "200": { "description": "创建用户 实例 共享成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建用户 实例 共享失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/snapshots": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取用户 实例 快照s", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户 实例 快照s", "responses": { "200": { "description": "获取用户 实例 快照s成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取用户 实例 快照s失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建创建用户 实例 快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "创建用户 实例 快照", "responses": { "200": { "description": "创建用户 实例 快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "创建用户 实例 快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/snapshots/upload": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建上传用户 快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "上传用户 快照", "responses": { "200": { "description": "上传用户 快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "上传用户 快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/ssh": { "get": { "description": "通过WebSocket建立到实例的SSH连接", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户/实例" ], "summary": "WebSocket SSH连接", "parameters": [ { "type": "integer", "description": "实例ID", "name": "id", "in": "path", "required": true } ], "responses": { "101": { "description": "Switching Protocols", "schema": { "type": "string" } }, "400": { "description": "请求参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未授权", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/vnc": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户 实例 VNC 信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "用户 实例 VNC 信息", "responses": { "200": { "description": "用户 实例 VNC 信息成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "用户 实例 VNC 信息失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{id}/vnc/ws": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户 实例 VNC Web Socket", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "用户 实例 VNC Web Socket", "responses": { "200": { "description": "用户 实例 VNC Web Socket成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "用户 实例 VNC Web Socket失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{instance_id}/pmacct/query": { "get": { "security": [ { "BearerAuth": [] } ], "description": "查询实例的pmacct流量数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "查询实例pmacct流量数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true } ], "responses": { "200": { "description": "查询成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/monitoring.PmacctSummary" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问该实例", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "查询失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{instance_id}/pmacct/summary": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取用户实例的pmacct流量汇总信息,包括今日、本月和总流量统计", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取实例pmacct流量汇总", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/monitoring.PmacctSummary" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "403": { "description": "无权限访问该实例", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "实例不存在", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/instances/{instance_id}/traffic/history": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定实例的历史流量数据,支持5分钟到24小时的灵活时间范围", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "流量管理" ], "summary": "获取实例流量历史", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instance_id", "in": "path", "required": true }, { "type": "string", "default": "1h", "description": "时间范围: 5m, 10m, 15m, 30m, 45m, 1h, 6h, 12h, 24h", "name": "period", "in": "query" }, { "type": "integer", "default": 0, "description": "数据点间隔(分钟),0表示自动选择,可选: 5, 10, 15, 30, 60", "name": "interval", "in": "query" }, { "type": "boolean", "default": false, "description": "是否包含已归档数据(重置前的历史记录)", "name": "includeArchived", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/monitoring.InstanceTrafficHistory" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/kyc": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取获取用户 实名认证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户 实名认证", "responses": { "200": { "description": "获取用户 实名认证成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "获取用户 实名认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "创建提交用户 实名认证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "提交用户 实名认证", "responses": { "200": { "description": "提交用户 实名认证成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "提交用户 实名认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/kyc/alipay": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建提交Alipay 实名认证", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "提交Alipay 实名认证", "responses": { "200": { "description": "提交Alipay 实名认证成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "提交Alipay 实名认证失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/kyc/alipay/result": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取查询Alipay 实名认证 Result", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "查询Alipay 实名认证 Result", "responses": { "200": { "description": "查询Alipay 实名认证 Result成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "查询Alipay 实名认证 Result失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/limits": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的配额限制信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户配额限制", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/user.UserLimitsResponse" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "修改当前用户的登录密码", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "修改密码", "parameters": [ { "description": "修改密码请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ChangePasswordRequest" } } ], "responses": { "200": { "description": "修改成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "修改失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/port-mappings": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前登录用户的所有端口映射", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户端口映射列表", "parameters": [ { "type": "integer", "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "description": "每页数量", "name": "limit", "in": "query" }, { "type": "string", "description": "搜索关键字", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/profile": { "put": { "security": [ { "BearerAuth": [] } ], "description": "更新当前用户的个人资料信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "更新个人信息", "parameters": [ { "description": "更新个人信息请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdateProfileRequest" } } ], "responses": { "200": { "description": "更新成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "更新失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/provider/available": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以申领的节点列表,根据资源使用情况筛选", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取可用节点列表", "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/user.AvailableProviderResponse" } } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/provider/{id}/capabilities": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider支持的实例类型和架构信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取Provider能力信息", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/provider/{id}/gpus": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取指定Provider最后一次GPU检测的缓存结果(持久化存储),供用户申请时选择GPU设备", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取Provider GPU/NPU设备列表", "parameters": [ { "type": "integer", "description": "Provider ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "GPU列表", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object" } } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "404": { "description": "Provider不存在或无缓存数据", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/redemption-codes/redeem": { "post": { "security": [ { "BearerAuth": [] } ], "description": "通过兑换码获取对应的云实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户实例管理" ], "summary": "兑换码兑换", "parameters": [ { "description": "兑换码请求 {\\", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "兑换成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "未登录", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/reset-password": { "put": { "security": [ { "BearerAuth": [] } ], "description": "用户重置自己的登录密码,系统自动生成符合安全策略的新密码,并通过绑定的通信渠道发送", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "用户重置自己的密码", "parameters": [ { "description": "重置密码请求参数(可为空对象)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ResetPasswordRequest" } } ], "responses": { "200": { "description": "重置成功,新密码已发送到绑定的通信渠道", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "重置失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/resources/available": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户可以申领的资源列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取可申领资源", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "资源类型", "name": "resourceType", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/resources/claim": { "post": { "security": [ { "BearerAuth": [] } ], "description": "用户申领可用的资源实例", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "申领资源", "parameters": [ { "description": "申领资源请求参数", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.ClaimResourceRequest" } } ], "responses": { "200": { "description": "申领成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "申领失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/snapshots/{id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "删除删除用户 快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "删除用户 快照", "responses": { "200": { "description": "删除用户 快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "删除用户 快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/snapshots/{id}/download": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取下载用户 快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "下载用户 快照", "responses": { "200": { "description": "下载用户 快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "下载用户 快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/snapshots/{id}/restore": { "post": { "security": [ { "BearerAuth": [] } ], "description": "创建恢复用户 快照", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "恢复用户 快照", "responses": { "200": { "description": "恢复用户 快照成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "恢复用户 快照失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/tasks": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的任务列表", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "获取用户任务列表", "parameters": [ { "type": "integer", "default": 1, "description": "页码", "name": "page", "in": "query" }, { "type": "integer", "default": 10, "description": "每页数量", "name": "pageSize", "in": "query" }, { "type": "string", "description": "任务类型", "name": "taskType", "in": "query" }, { "type": "string", "description": "任务状态", "name": "status", "in": "query" }, { "type": "string", "description": "节点ID", "name": "providerId", "in": "query" } ], "responses": { "200": { "description": "获取成功", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "object" } } } ] } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "服务器内部错误", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/tasks/{taskId}/cancel": { "post": { "security": [ { "BearerAuth": [] } ], "description": "用户取消自己的等待中任务", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户管理" ], "summary": "取消用户任务", "parameters": [ { "type": "integer", "description": "任务ID", "name": "taskId", "in": "path", "required": true } ], "responses": { "200": { "description": "操作成功", "schema": { "$ref": "#/definitions/common.Response" } }, "400": { "description": "参数错误", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "用户未登录", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "操作失败", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/traffic/history": { "get": { "security": [ { "BearerAuth": [] } ], "description": "获取当前用户的历史流量数据,支持5分钟到24小时的灵活时间范围", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "流量管理" ], "summary": "获取用户流量历史", "parameters": [ { "type": "string", "default": "1h", "description": "时间范围: 5m, 10m, 15m, 30m, 45m, 1h, 6h, 12h, 24h", "name": "period", "in": "query" }, { "type": "integer", "default": 0, "description": "数据点间隔(分钟),0表示自动选择", "name": "interval", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/common.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/monitoring.UserTrafficHistory" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/common.Response" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/common.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/traffic/instance/{instanceId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定实例的详细流量统计信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取实例流量详情", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instanceId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/traffic/instances": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取用户所有实例的流量使用汇总信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取用户所有实例流量汇总", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/traffic/limit-status": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取用户的流量限制状态和受限实例信息", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取流量限制状态", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/traffic/overview": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "基于pmacct获取用户流量使用情况概览", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取用户流量概览", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/user/traffic/pmacct/{instanceId}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "获取指定实例的原始pmacct统计数据", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户流量" ], "summary": "获取原始pmacct数据", "parameters": [ { "type": "integer", "description": "实例ID", "name": "instanceId", "in": "path", "required": true }, { "type": "string", "description": "网络接口名称", "name": "interface", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/common.Response" } } } } }, "/ws/agent": { "get": { "description": "Rust Agent 通过此端点主动连回控制端,支持内网穿透模式", "tags": [ "agent" ], "summary": "Agent 反向 WebSocket 连接入口", "parameters": [ { "type": "string", "description": "Agent 鉴权密钥", "name": "secret", "in": "query", "required": true } ], "responses": {} } } }, "definitions": { "admin.AdminTaskDetailResponse": { "type": "object", "properties": { "canForceStop": { "type": "boolean" }, "cancelReason": { "description": "取消原因", "type": "string" }, "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "errorMessage": { "type": "string" }, "id": { "type": "integer" }, "instanceId": { "type": "integer" }, "instanceName": { "type": "string" }, "instanceType": { "type": "string" }, "instance_id": { "description": "兼容旧脚本/接口字段", "type": "integer" }, "isForceStoppable": { "type": "boolean" }, "preallocatedBandwidth": { "description": "预分配的带宽(Mbps)", "type": "integer" }, "preallocatedCpu": { "description": "预分配的实例配置信息", "type": "integer" }, "preallocatedDisk": { "description": "预分配的磁盘(MB)", "type": "integer" }, "preallocatedMemory": { "description": "预分配的内存(MB)", "type": "integer" }, "progress": { "type": "integer" }, "progressLogs": { "description": "进度日志(JSON数组)", "type": "string" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "remainingTime": { "description": "剩余时间(秒)", "type": "integer" }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "statusMessage": { "type": "string" }, "taskData": { "description": "任务数据(JSON格式)", "type": "string" }, "taskType": { "type": "string" }, "timeoutDuration": { "type": "integer" }, "userId": { "type": "integer" }, "userName": { "type": "string" }, "uuid": { "type": "string" } } }, "admin.AdminTaskListResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/admin.AdminTaskResponse" } }, "page": { "type": "integer" }, "pageSize": { "type": "integer" }, "total": { "type": "integer" } } }, "admin.AdminTaskResponse": { "type": "object", "properties": { "canForceStop": { "type": "boolean" }, "cancelReason": { "description": "取消原因", "type": "string" }, "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "errorMessage": { "type": "string" }, "id": { "type": "integer" }, "instanceId": { "type": "integer" }, "instanceName": { "type": "string" }, "instanceType": { "type": "string" }, "instance_id": { "description": "兼容旧脚本/接口字段", "type": "integer" }, "isForceStoppable": { "type": "boolean" }, "preallocatedBandwidth": { "description": "预分配的带宽(Mbps)", "type": "integer" }, "preallocatedCpu": { "description": "预分配的实例配置信息", "type": "integer" }, "preallocatedDisk": { "description": "预分配的磁盘(MB)", "type": "integer" }, "preallocatedMemory": { "description": "预分配的内存(MB)", "type": "integer" }, "progress": { "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "remainingTime": { "description": "剩余时间(秒)", "type": "integer" }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "statusMessage": { "type": "string" }, "taskType": { "type": "string" }, "timeoutDuration": { "type": "integer" }, "userId": { "type": "integer" }, "userName": { "type": "string" }, "uuid": { "type": "string" } } }, "admin.AutoConfigureRequest": { "type": "object", "required": [ "providerId" ], "properties": { "force": { "description": "是否强制执行(即使有正在运行的任务)", "type": "boolean" }, "providerId": { "type": "integer" }, "showHistory": { "description": "是否显示历史记录", "type": "boolean" } } }, "admin.AutoConfigureResponse": { "type": "object", "properties": { "canProceed": { "type": "boolean" }, "historyTasks": { "description": "历史任务", "type": "array", "items": { "$ref": "#/definitions/admin.ConfigurationTaskResponse" } }, "message": { "type": "string" }, "runningTask": { "description": "当前运行的任务", "allOf": [ { "$ref": "#/definitions/admin.ConfigurationTaskResponse" } ] }, "status": { "type": "string" }, "streamUrl": { "description": "实时流URL", "type": "string" }, "taskId": { "type": "integer" } } }, "admin.BatchAnnouncementRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "integer" } } } }, "admin.BatchCreateRedemptionCodesRequest": { "type": "object", "required": [ "count", "instanceType", "providerId" ], "properties": { "bandwidthId": { "type": "string" }, "count": { "type": "integer", "maximum": 100, "minimum": 1 }, "cpuId": { "type": "string" }, "creationMode": { "description": "复制模式(LXD/Incus 与 Docker/Podman/Containerd/Orbstack 容器节点)", "type": "string" }, "diskId": { "type": "string" }, "gpuDeviceIds": { "description": "GPU设备ID列表(逗号分隔),为空则附加所有GPU", "type": "string" }, "gpuEnabled": { "description": "GPU直通配置(LXD/Incus 原生支持,Docker/Podman/Containerd/Orbstack 尽力通过运行参数附加)", "type": "boolean" }, "imageId": { "type": "integer" }, "instanceType": { "type": "string", "enum": [ "container", "vm" ] }, "memoryId": { "type": "string" }, "providerId": { "type": "integer" }, "remark": { "type": "string" }, "sourceContainer": { "description": "复制模式下的源容器名称(仅 copy 模式)", "type": "string" } } }, "admin.BatchDeleteInviteCodesRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "admin.BatchDeletePortMappingRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "admin.BatchDeleteRedemptionCodesRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "admin.BatchDeleteUsersRequest": { "type": "object", "required": [ "userIds" ], "properties": { "userIds": { "type": "array", "items": { "type": "integer" } } } }, "admin.BatchInstanceActionRequest": { "type": "object", "required": [ "action", "instanceIds" ], "properties": { "action": { "type": "string" }, "instanceIds": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "admin.BatchInstanceActionResponse": { "type": "object", "properties": { "action": { "type": "string" }, "failCount": { "type": "integer" }, "results": { "type": "array", "items": { "$ref": "#/definitions/admin.BatchInstanceActionResult" } }, "successCount": { "type": "integer" }, "total": { "type": "integer" } } }, "admin.BatchInstanceActionResult": { "type": "object", "properties": { "error": { "type": "string" }, "instanceId": { "type": "integer" }, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "admin.BatchUpdateStatusRequest": { "type": "object", "required": [ "ids" ], "properties": { "ids": { "type": "array", "items": { "type": "integer" } }, "status": { "type": "integer", "maximum": 1, "minimum": 0 } } }, "admin.BatchUpdateUserLevelRequest": { "type": "object", "required": [ "userIds" ], "properties": { "level": { "type": "integer", "maximum": 99, "minimum": 1 }, "userIds": { "type": "array", "items": { "type": "integer" } } } }, "admin.BatchUpdateUserStatusRequest": { "type": "object", "required": [ "userIds" ], "properties": { "status": { "type": "integer", "maximum": 1, "minimum": 0 }, "userIds": { "type": "array", "items": { "type": "integer" } } } }, "admin.CheckPortAvailabilityRequest": { "type": "object", "required": [ "hostPort", "protocol", "providerId" ], "properties": { "hostPort": { "description": "要检查的主机端口(起始端口)", "type": "integer", "maximum": 65535, "minimum": 1 }, "mappingType": { "description": "映射位置,默认节点侧", "type": "string", "enum": [ "node", "controller" ] }, "portCount": { "description": "端口数量(默认1,检查端口段时使用)", "type": "integer", "maximum": 1500, "minimum": 1 }, "protocol": { "description": "协议类型", "type": "string", "enum": [ "tcp", "udp", "both" ] }, "providerId": { "description": "Provider ID", "type": "integer" } } }, "admin.CheckPortAvailabilityResponse": { "type": "object", "properties": { "available": { "description": "是否所有端口都可用", "type": "boolean" }, "availablePorts": { "description": "可用的端口列表", "type": "array", "items": { "type": "integer" } }, "message": { "description": "检查结果描述", "type": "string" }, "portRange": { "description": "端口范围描述(如 \"10000-10009\")", "type": "string" }, "suggestion": { "description": "建议(如果有冲突,提供替代方案)", "type": "string" }, "unavailablePorts": { "description": "不可用的端口列表", "type": "array", "items": { "type": "integer" } } } }, "admin.ConfigurationTaskDetailResponse": { "type": "object", "properties": { "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "duration": { "description": "格式化的时长,如 \"2m30s\"", "type": "string" }, "errorMessage": { "type": "string" }, "executorId": { "type": "integer" }, "executorName": { "type": "string" }, "id": { "type": "integer" }, "logOutput": { "description": "完整日志", "type": "string" }, "logSummary": { "type": "string" }, "progress": { "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "providerType": { "type": "string" }, "resultData": { "description": "结果数据", "type": "object", "additionalProperties": true }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "success": { "type": "boolean" }, "taskType": { "type": "string" }, "updatedAt": { "type": "string" } } }, "admin.ConfigurationTaskListResponse": { "type": "object", "properties": { "list": { "type": "array", "items": { "$ref": "#/definitions/admin.ConfigurationTaskResponse" } }, "total": { "type": "integer" } } }, "admin.ConfigurationTaskResponse": { "type": "object", "properties": { "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "duration": { "description": "格式化的时长,如 \"2m30s\"", "type": "string" }, "errorMessage": { "type": "string" }, "executorId": { "type": "integer" }, "executorName": { "type": "string" }, "id": { "type": "integer" }, "logSummary": { "type": "string" }, "progress": { "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "providerType": { "type": "string" }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "success": { "type": "boolean" }, "taskType": { "type": "string" }, "updatedAt": { "type": "string" } } }, "admin.CreateAnnouncementRequest": { "type": "object", "required": [ "content", "title", "type" ], "properties": { "content": { "type": "string" }, "contentHtml": { "type": "string" }, "endTime": { "type": "string" }, "isSticky": { "type": "boolean" }, "priority": { "type": "integer" }, "startTime": { "type": "string" }, "title": { "type": "string" }, "type": { "description": "限制类型", "type": "string", "enum": [ "homepage", "topbar" ] } } }, "admin.CreateInviteCodeRequest": { "type": "object", "required": [ "count" ], "properties": { "code": { "description": "自定义邀请码,如果为空则自动生成", "type": "string" }, "count": { "type": "integer", "maximum": 100, "minimum": 1 }, "expiresAt": { "type": "string" }, "length": { "description": "邀请码长度,仅在自动生成时有效", "type": "integer" }, "maxUses": { "type": "integer" }, "remark": { "type": "string" } } }, "admin.CreatePortMappingRequest": { "type": "object", "required": [ "guestPort", "instanceId", "protocol" ], "properties": { "description": { "description": "端口用途描述", "type": "string" }, "guestPort": { "description": "起始端口", "type": "integer", "maximum": 65535, "minimum": 1 }, "hostPort": { "description": "可选,不指定则自动分配,指定时作为起始端口", "type": "integer" }, "instanceId": { "type": "integer" }, "internalHost": { "description": "控制端转发目标地址(容器IP)", "type": "string" }, "mappingType": { "description": "\"node\"(默认)或 \"controller\"(控制端转发)", "type": "string", "enum": [ "node", "controller" ] }, "portCount": { "description": "端口数量,默认1(单端口),最多1500个", "type": "integer", "maximum": 1500, "minimum": 1 }, "protocol": { "description": "协议类型", "type": "string", "enum": [ "tcp", "udp", "both" ] } } }, "admin.CreateUserRequest": { "type": "object", "required": [ "password", "userType", "username" ], "properties": { "email": { "type": "string" }, "level": { "type": "integer" }, "nickname": { "type": "string" }, "password": { "type": "string" }, "phone": { "type": "string" }, "qq": { "type": "string" }, "roleId": { "type": "integer" }, "status": { "type": "integer" }, "telegram": { "type": "string" }, "totalQuota": { "type": "integer" }, "userType": { "type": "string" }, "username": { "type": "string" } } }, "admin.DeployAgentRequest": { "type": "object", "properties": { "version": { "type": "string" } } }, "admin.ExportRedemptionCodesRequest": { "type": "object", "properties": { "fields": { "description": "要导出的字段列表,为空则导出所有字段", "type": "array", "items": { "type": "string" } }, "ids": { "description": "为空则导出所有", "type": "array", "items": { "type": "integer" } }, "lang": { "description": "语言: zh-CN, en-US", "type": "string" } } }, "admin.ForceStopTaskRequest": { "type": "object", "required": [ "taskId" ], "properties": { "reason": { "description": "强制停止原因", "type": "string" }, "taskId": { "type": "integer" } } }, "admin.GetInstancePasswordResponse": { "type": "object", "properties": { "newPassword": { "type": "string" }, "resetTime": { "type": "integer" } } }, "admin.InstanceActionRequest": { "type": "object", "required": [ "action" ], "properties": { "action": { "type": "string" }, "image": { "type": "string" } } }, "admin.InstanceEgressDependencyRequest": { "type": "object", "properties": { "package_set": { "type": "string" } } }, "admin.InstanceEgressReconcileRequest": { "type": "object", "properties": { "apply": { "type": "boolean" } } }, "admin.ProviderPortConfigRequest": { "type": "object", "properties": { "defaultPortCount": { "description": "每个实例默认映射端口数量", "type": "integer", "maximum": 1500, "minimum": 1 }, "fixedPorts": { "description": "固定实例内端口,22强制保留", "type": "array", "items": { "type": "integer" } }, "networkType": { "description": "网络配置类型", "type": "string", "enum": [ "nat_ipv4", "nat_ipv4_ipv6", "dedicated_ipv4", "dedicated_ipv4_ipv6", "ipv6_only", "no_port_mapping" ] }, "portRangeEnd": { "description": "端口映射范围结束", "type": "integer", "maximum": 65535, "minimum": 1024 }, "portRangeStart": { "description": "端口映射范围起始", "type": "integer", "maximum": 65535, "minimum": 1024 } } }, "admin.RepairPortMappingsRequest": { "type": "object", "properties": { "confirmation": { "type": "string" }, "dryRun": { "type": "boolean" }, "portIds": { "type": "array", "items": { "type": "integer" } }, "providerIds": { "type": "array", "items": { "type": "integer" } } } }, "admin.ResetInstancePasswordRequest": { "type": "object" }, "admin.ResetInstancePasswordResponse": { "type": "object", "properties": { "taskId": { "description": "异步任务ID", "type": "integer" } } }, "admin.ResetUserPasswordRequest": { "type": "object" }, "admin.ResetUserPasswordResponse": { "type": "object", "properties": { "newPassword": { "description": "生成的新密码", "type": "string" } } }, "admin.SyncPortMappingsTaskRequest": { "type": "object", "properties": { "dryRun": { "description": "仅生成预览,不创建同步任务", "type": "boolean" }, "excludedPortIds": { "description": "预览后取消勾选的端口ID", "type": "array", "items": { "type": "integer" } }, "includedPortIds": { "description": "预览后确认删除的端口ID;执行同步时必填", "type": "array", "items": { "type": "integer" } }, "providerIds": { "description": "指定要同步的Provider IDs(为空则同步所有)", "type": "array", "items": { "type": "integer" } } } }, "admin.Task": { "type": "object", "properties": { "canForceStop": { "description": "控制标志", "type": "boolean" }, "cancelReason": { "description": "任务取消的原因", "type": "string" }, "completedAt": { "description": "任务完成时间", "type": "string" }, "createdAt": { "description": "任务创建时间", "type": "string" }, "errorMessage": { "description": "错误和状态信息", "type": "string" }, "estimatedDuration": { "description": "预计执行时长(秒)", "type": "integer" }, "id": { "description": "基础字段", "type": "integer" }, "instanceId": { "description": "关联的实例ID(可选,用于实例相关任务)", "type": "integer" }, "isForceStoppable": { "description": "是否允许被强制停止", "type": "boolean" }, "preallocatedBandwidth": { "description": "预分配的带宽(Mbps)", "type": "integer" }, "preallocatedCpu": { "description": "预分配的实例配置信息(用于显示和排队估算)", "type": "integer" }, "preallocatedDisk": { "description": "预分配的磁盘(MB)", "type": "integer" }, "preallocatedMemory": { "description": "预分配的内存(MB)", "type": "integer" }, "progress": { "description": "任务执行进度百分比(0-100)", "type": "integer" }, "progressLogs": { "description": "进度日志(每次调用 UpdateTaskProgress 时追加,JSON 格式)", "type": "string" }, "provider": { "description": "关联对象", "allOf": [ { "$ref": "#/definitions/oneclickvirt_model_provider.Provider" } ] }, "providerId": { "description": "执行任务的Provider ID(可为空)", "type": "integer" }, "startedAt": { "description": "时间信息", "type": "string" }, "status": { "description": "任务状态:pending, processing, running, completed, failed, cancelling, cancelled, timeout", "type": "string" }, "statusMessage": { "description": "当前状态的描述信息", "type": "string" }, "taskData": { "description": "任务执行所需的数据(JSON格式)", "type": "string" }, "taskType": { "description": "任务基本信息", "type": "string" }, "timeoutDuration": { "description": "任务超时时间(秒,默认30分钟)", "type": "integer" }, "updatedAt": { "description": "任务更新时间", "type": "string" }, "userId": { "description": "关联信息", "type": "integer" }, "uuid": { "description": "任务唯一标识符", "type": "string" } } }, "admin.TaskPoolControlRequest": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "message": { "type": "string" } } }, "admin.TaskPoolStatusResponse": { "type": "object", "properties": { "acceptingNewTasks": { "type": "boolean" }, "activeTasks": { "type": "integer" }, "canRestartController": { "type": "boolean" }, "configurationPendingTasks": { "type": "integer" }, "configurationRunningTasks": { "type": "integer" }, "drainComplete": { "type": "boolean" }, "enabled": { "type": "boolean" }, "message": { "type": "string" }, "pendingTasks": { "type": "integer" }, "runningTasks": { "type": "integer" }, "state": { "type": "string" }, "updatedAt": { "type": "string" } } }, "admin.TaskStatsResponse": { "type": "object", "properties": { "cancelledTasks": { "type": "integer" }, "completedTasks": { "type": "integer" }, "configPendingTasks": { "type": "integer" }, "configRunningTasks": { "type": "integer" }, "failedTasks": { "type": "integer" }, "pendingTasks": { "type": "integer" }, "processingTasks": { "type": "integer" }, "runningTasks": { "type": "integer" }, "timeoutTasks": { "type": "integer" }, "totalTasks": { "type": "integer" } } }, "admin.TrafficMonitorOperationRequest": { "type": "object", "required": [ "operation", "providerId" ], "properties": { "operation": { "description": "enable: 批量启用, disable: 批量删除, detect: 批量检测", "type": "string", "enum": [ "enable", "disable", "detect" ] }, "providerId": { "type": "integer" } } }, "admin.TrafficMonitorTask": { "type": "object", "properties": { "adminTaskId": { "description": "统一任务列表中的任务ID", "type": "integer" }, "completedAt": { "description": "任务完成时间", "type": "string" }, "createdAt": { "type": "string" }, "errorMsg": { "description": "错误信息", "type": "string" }, "failedCount": { "description": "失败数量", "type": "integer" }, "id": { "type": "integer" }, "message": { "description": "当前状态消息", "type": "string" }, "output": { "description": "详细输出日志", "type": "string" }, "progress": { "description": "进度 0-100", "type": "integer" }, "providerId": { "description": "Provider ID", "type": "integer" }, "startedAt": { "description": "任务开始时间", "type": "string" }, "status": { "description": "状态: pending, running, completed, failed", "type": "string" }, "successCount": { "description": "成功数量", "type": "integer" }, "taskType": { "description": "任务类型: enable_all, disable_all, detect_all", "type": "string" }, "totalCount": { "description": "总实例数", "type": "integer" }, "updatedAt": { "type": "string" } } }, "admin.UpdateAnnouncementRequest": { "type": "object", "properties": { "content": { "type": "string" }, "contentHtml": { "type": "string" }, "endTime": { "type": "string" }, "id": { "type": "integer" }, "isSticky": { "type": "boolean" }, "priority": { "type": "integer" }, "startTime": { "type": "string" }, "status": { "type": "integer" }, "title": { "type": "string" }, "type": { "type": "string", "enum": [ "homepage", "topbar" ] } } }, "admin.UpdateInstanceTypePermissionsRequest": { "type": "object", "properties": { "minLevelForContainer": { "type": "integer", "maximum": 99, "minimum": 0 }, "minLevelForDeleteContainer": { "type": "integer", "maximum": 99, "minimum": 0 }, "minLevelForDeleteVM": { "type": "integer", "maximum": 99, "minimum": 0 }, "minLevelForResetContainer": { "type": "integer", "maximum": 99, "minimum": 0 }, "minLevelForResetVM": { "type": "integer", "maximum": 99, "minimum": 0 }, "minLevelForVM": { "type": "integer", "maximum": 99, "minimum": 0 } } }, "admin.UpdateMonitoringConfigRequest": { "type": "object", "properties": { "agent_port": { "type": "integer" }, "collect_interval": { "type": "integer" }, "extra_exclude_cidrs_v4": { "type": "string" }, "extra_exclude_cidrs_v6": { "type": "string" }, "monitoring_mode": { "type": "string" }, "resource_collect_interval": { "type": "integer" }, "traffic_collect_method": { "description": "\"nft\" or \"ipt\"", "type": "string" } } }, "admin.UpdateUserLevelRequest": { "type": "object", "properties": { "level": { "type": "integer", "maximum": 99, "minimum": 1 } } }, "admin.UpdateUserStatusRequest": { "type": "object", "properties": { "status": { "type": "integer", "maximum": 1, "minimum": 0 } } }, "agent.EgressProfileRequest": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "fail_closed": { "type": "boolean" }, "gateway": { "type": "string" }, "id": { "type": "string" }, "mark": { "type": "integer" }, "mode": { "type": "string" }, "public_ipv4": { "type": "string" }, "public_ipv6": { "type": "string" }, "route_table": { "type": "integer" }, "tunnel_interface": { "type": "string" }, "tunnel_type": { "type": "string" }, "wireguard": { "$ref": "#/definitions/agent.EgressWireGuardRequest" } } }, "agent.EgressWireGuardRequest": { "type": "object", "properties": { "addresses": { "type": "array", "items": { "type": "string" } }, "allowed_ips": { "type": "array", "items": { "type": "string" } }, "endpoint": { "type": "string" }, "managed": { "type": "boolean" }, "mtu": { "type": "integer" }, "peer_public_key": { "type": "string" }, "persistent_keepalive": { "type": "integer" }, "preshared_key": { "type": "string" }, "private_key": { "type": "string" } } }, "agent.InstanceEgressBindRequest": { "type": "object", "properties": { "apply": { "type": "boolean" }, "enabled": { "type": "boolean" }, "interface": { "type": "string" }, "interface_v4": { "type": "string" }, "interface_v6": { "type": "string" }, "profile": { "$ref": "#/definitions/agent.EgressProfileRequest" }, "source": { "type": "string" }, "sources": { "type": "array", "items": { "type": "string" } } } }, "auth.ApiTokenCreateRequest": { "type": "object", "required": [ "name" ], "properties": { "expireDays": { "description": "过期天数(0=永久有效)", "type": "integer" }, "name": { "description": "Token名称", "type": "string" }, "scopes": { "description": "权限范围限制", "type": "array", "items": { "type": "string" } } } }, "auth.ApiTokenCreateResponse": { "type": "object", "properties": { "expiresAt": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "token": { "description": "仅在创建时返回完整Token", "type": "string" }, "tokenPrefix": { "description": "Token前缀(用于列表显示)", "type": "string" } } }, "auth.ForgotPasswordRequest": { "type": "object", "required": [ "email" ], "properties": { "captcha": { "type": "string" }, "captchaId": { "type": "string" }, "email": { "type": "string", "example": "user@example.com" }, "userType": { "type": "string" } } }, "auth.LoginRequest": { "type": "object", "required": [ "password", "username" ], "properties": { "captcha": { "description": "图形验证码", "type": "string" }, "captchaId": { "description": "图形验证码ID", "type": "string" }, "loginType": { "description": "登录类型", "type": "string", "enum": [ "username", "email", "telegram", "qq" ] }, "password": { "description": "密码登录时必填", "type": "string", "example": "password" }, "target": { "description": "验证码登录时的目标", "type": "string" }, "userType": { "description": "用户类型", "type": "string", "enum": [ "admin", "user" ] }, "username": { "description": "用户名登录时必填", "type": "string", "example": "admin" }, "verifyCode": { "description": "验证码登录时的验证码", "type": "string" } } }, "auth.RegisterRequest": { "type": "object", "required": [ "password", "username" ], "properties": { "captcha": { "type": "string" }, "captchaId": { "type": "string" }, "email": { "type": "string", "example": "user@example.com" }, "inviteCode": { "type": "string", "example": "INVITE123" }, "nickname": { "type": "string", "example": "昵称" }, "password": { "type": "string", "example": "password123" }, "phone": { "type": "string", "example": "13800138000" }, "qq": { "type": "string" }, "registerType": { "description": "注册类型,前端兼容字段", "type": "string" }, "telegram": { "type": "string" }, "username": { "type": "string", "example": "user123" } } }, "auth.ResetPasswordRequest": { "type": "object", "required": [ "token" ], "properties": { "token": { "type": "string" } } }, "auth.SendVerifyCodeRequest": { "type": "object", "required": [ "target", "type" ], "properties": { "captcha": { "description": "图形验证码(可选,根据配置)", "type": "string" }, "captchaId": { "description": "图形验证码ID(可选,根据配置)", "type": "string" }, "target": { "description": "目标: 邮箱地址/TG用户名或ID/QQ号", "type": "string" }, "type": { "description": "验证码类型: email, telegram, qq", "type": "string" } } }, "checkin.BatchCheckinItemResult": { "type": "object", "properties": { "instanceId": { "type": "integer" }, "message": { "type": "string" }, "newExpiry": { "type": "string" }, "success": { "type": "boolean" } } }, "checkin.BatchCheckinRequest": { "type": "object", "required": [ "instanceIds" ], "properties": { "challenge": { "type": "string", "maxLength": 128 }, "code": { "type": "string", "maxLength": 128 }, "instanceIds": { "type": "array", "maxItems": 50, "minItems": 1, "items": { "type": "integer" } }, "nonce": { "type": "string", "maxLength": 64 }, "token": { "type": "string", "maxLength": 512 } } }, "checkin.BatchCheckinResult": { "type": "object", "properties": { "details": { "type": "array", "items": { "$ref": "#/definitions/checkin.BatchCheckinItemResult" } }, "failed": { "type": "integer" }, "success": { "type": "integer" }, "total": { "type": "integer" } } }, "checkin.CheckinStats": { "type": "object", "properties": { "currentStreak": { "type": "integer" }, "lastCheckinDate": { "type": "string" }, "longestStreak": { "type": "integer" }, "thisMonthCheckins": { "type": "integer" }, "totalCheckins": { "type": "integer" }, "totalRenewalDays": { "type": "integer" } } }, "checkin.DoCheckinRequest": { "type": "object", "required": [ "instanceId" ], "properties": { "challenge": { "description": "PoW challenge", "type": "string", "maxLength": 128 }, "code": { "description": "内置验证码", "type": "string", "maxLength": 128 }, "instanceId": { "type": "integer" }, "nonce": { "description": "PoW nonce", "type": "string", "maxLength": 64 }, "token": { "description": "第三方captcha token (turnstile/recaptcha/hcaptcha)", "type": "string", "maxLength": 512 } } }, "common.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "message": { "type": "string" }, "msg": { "type": "string" } } }, "config.UnifiedConfigRequest": { "type": "object", "required": [ "config", "scope" ], "properties": { "config": { "type": "object", "additionalProperties": true }, "scope": { "description": "public, user, admin", "type": "string" } } }, "ipv6tunnel.Config": { "type": "object", "properties": { "defaultRoute": { "type": "boolean" }, "interfaceName": { "type": "string" }, "localIpv4": { "type": "string" }, "localIpv6": { "type": "string" }, "mode": { "type": "string" }, "mtu": { "type": "integer" }, "name": { "type": "string" }, "remoteIpv4": { "type": "string" }, "remoteIpv6": { "type": "string" }, "routeMetric": { "type": "integer" }, "routedCidr": { "type": "string" }, "ttl": { "type": "integer" } } }, "ipv6tunnel.CreateRequest": { "type": "object", "properties": { "defaultRoute": { "type": "boolean" }, "enabled": { "type": "boolean" }, "interfaceName": { "type": "string" }, "localIpv4": { "type": "string" }, "localIpv6": { "type": "string" }, "mode": { "type": "string" }, "mtu": { "type": "integer" }, "name": { "type": "string" }, "remoteIpv4": { "type": "string" }, "remoteIpv6": { "type": "string" }, "routeMetric": { "type": "integer" }, "routedCidr": { "type": "string" }, "ttl": { "type": "integer" } } }, "ipv6tunnel.DetectLocalIPv4Request": { "type": "object", "properties": { "remoteIpv4": { "type": "string" } } }, "log.LogFileInfo": { "type": "object", "properties": { "date": { "description": "日期字段,格式为 YYYY-MM-DD", "type": "string" }, "mod_time": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "size": { "type": "integer" } } }, "monitoring.InstanceTrafficHistory": { "type": "object", "properties": { "created_at": { "type": "string" }, "day": { "description": "日", "type": "integer" }, "hour": { "description": "小时(0-23),0表示日度汇总", "type": "integer" }, "id": { "type": "integer" }, "instance_id": { "description": "实例ID", "type": "integer" }, "month": { "description": "月", "type": "integer" }, "provider_id": { "description": "Provider ID", "type": "integer" }, "record_time": { "description": "记录时间", "type": "string" }, "total_used": { "description": "总流量", "type": "number" }, "traffic_in": { "description": "流量数据 (单位: MB)", "type": "number" }, "traffic_out": { "description": "出站流量", "type": "number" }, "updated_at": { "type": "string" }, "user_id": { "description": "用户ID", "type": "integer" }, "year": { "description": "时间维度\n添加唯一约束,防止重复聚合\nday=0, hour=0 表示月度汇总(用于快速查询缓存)", "type": "integer" } } }, "monitoring.PmacctSummary": { "type": "object", "properties": { "all_time": { "description": "总流量", "allOf": [ { "$ref": "#/definitions/monitoring.PmacctTrafficRecord" } ] }, "history": { "description": "历史记录", "type": "array", "items": { "$ref": "#/definitions/monitoring.PmacctTrafficRecord" } }, "instance_id": { "type": "integer" }, "mapped_ip": { "type": "string" }, "mapped_ipv6": { "type": "string" }, "this_month": { "description": "本月流量", "allOf": [ { "$ref": "#/definitions/monitoring.PmacctTrafficRecord" } ] }, "today": { "description": "今日流量", "allOf": [ { "$ref": "#/definitions/monitoring.PmacctTrafficRecord" } ] } } }, "monitoring.PmacctTrafficRecord": { "type": "object", "properties": { "created_at": { "type": "string" }, "day": { "description": "日期", "type": "integer" }, "hour": { "description": "小时", "type": "integer" }, "id": { "type": "integer" }, "instance_id": { "description": "实例ID", "type": "integer" }, "mapped_ip": { "description": "映射的公网IP地址", "type": "string" }, "minute": { "description": "分钟(0, 5, 10, ..., 55)", "type": "integer" }, "month": { "description": "月份", "type": "integer" }, "provider_id": { "description": "Provider ID", "type": "integer" }, "provider_type": { "description": "Provider类型", "type": "string" }, "record_time": { "description": "元数据", "type": "string" }, "rx_bytes": { "description": "流量统计数据 (单位: 字节)", "type": "integer" }, "timestamp": { "description": "时间维度(支持5分钟精度)\nyear和month添加到复合索引中,提升月度查询性能\n添加timestamp到复合索引以支持范围查询", "type": "string" }, "total_bytes": { "description": "总流量字节数", "type": "integer" }, "tx_bytes": { "description": "发送字节数(出站流量)", "type": "integer" }, "updated_at": { "type": "string" }, "user_id": { "description": "用户ID(冗余存储,避免JOIN)", "type": "integer" }, "year": { "description": "年份", "type": "integer" } } }, "monitoring.ProviderTrafficHistory": { "type": "object", "properties": { "created_at": { "type": "string" }, "day": { "description": "日", "type": "integer" }, "hour": { "description": "小时(0-23),0表示日度汇总", "type": "integer" }, "id": { "type": "integer" }, "instance_count": { "description": "实例统计", "type": "integer" }, "month": { "description": "月", "type": "integer" }, "provider_id": { "description": "Provider ID", "type": "integer" }, "record_time": { "description": "记录时间", "type": "string" }, "total_used": { "description": "总流量", "type": "number" }, "traffic_in": { "description": "流量数据 (单位: MB)", "type": "number" }, "traffic_out": { "description": "出站流量", "type": "number" }, "updated_at": { "type": "string" }, "year": { "description": "时间维度", "type": "integer" } } }, "monitoring.UserTrafficHistory": { "type": "object", "properties": { "created_at": { "type": "string" }, "day": { "description": "日", "type": "integer" }, "hour": { "description": "小时(0-23),0表示日度汇总", "type": "integer" }, "id": { "type": "integer" }, "instance_count": { "description": "实例统计", "type": "integer" }, "month": { "description": "月", "type": "integer" }, "record_time": { "description": "记录时间", "type": "string" }, "total_used": { "description": "总流量", "type": "number" }, "traffic_in": { "description": "流量数据 (单位: MB)", "type": "number" }, "traffic_out": { "description": "出站流量", "type": "number" }, "updated_at": { "type": "string" }, "user_id": { "description": "用户ID", "type": "integer" }, "year": { "description": "时间维度", "type": "integer" } } }, "oauth2.CreateProviderRequest": { "type": "object", "required": [ "authUrl", "clientId", "clientSecret", "displayName", "name", "providerType", "redirectUrl", "tokenUrl", "userInfoUrl" ], "properties": { "authUrl": { "type": "string" }, "avatarField": { "type": "string" }, "clientId": { "type": "string" }, "clientSecret": { "type": "string" }, "defaultLevel": { "type": "integer" }, "displayName": { "type": "string" }, "emailField": { "type": "string" }, "enabled": { "type": "boolean" }, "levelMapping": { "type": "object", "additionalProperties": { "type": "integer" } }, "maxRegistrations": { "type": "integer" }, "name": { "type": "string" }, "nicknameField": { "type": "string" }, "providerType": { "description": "preset 或 generic", "type": "string", "enum": [ "preset", "generic" ] }, "redirectUrl": { "type": "string" }, "sort": { "type": "integer" }, "tokenUrl": { "type": "string" }, "trustLevelField": { "type": "string" }, "userIdField": { "type": "string" }, "userInfoUrl": { "type": "string" }, "usernameField": { "type": "string" } } }, "oauth2.OAuth2Provider": { "type": "object", "properties": { "authUrl": { "description": "OAuth2授权地址", "type": "string" }, "avatarField": { "description": "头像字段映射", "type": "string" }, "clientId": { "description": "OAuth2配置", "type": "string" }, "clientSecret": { "description": "OAuth2客户端密钥", "type": "string" }, "createdAt": { "type": "string" }, "currentRegistrations": { "description": "当前注册数量", "type": "integer" }, "defaultLevel": { "description": "默认等级(当没有等级映射或无法提取等级时使用)", "type": "integer" }, "displayName": { "description": "显示名称", "type": "string" }, "emailField": { "description": "邮箱字段映射", "type": "string" }, "enabled": { "description": "是否启用", "type": "boolean" }, "id": { "type": "integer" }, "levelMapping": { "description": "等级映射(JSON字符串,如 {\"0\":1,\"1\":2,\"2\":3})\n映射外部信任等级到系统用户等级", "type": "string" }, "maxRegistrations": { "description": "注册限制", "type": "integer" }, "name": { "description": "基础信息", "type": "string" }, "nicknameField": { "description": "可选字段映射", "type": "string" }, "providerType": { "description": "提供商类型(preset:预设, generic:通用)", "type": "string" }, "redirectUrl": { "description": "OAuth2回调地址", "type": "string" }, "sort": { "description": "显示顺序", "type": "integer" }, "tokenUrl": { "description": "OAuth2令牌地址", "type": "string" }, "totalUsers": { "description": "统计信息", "type": "integer" }, "trustLevelField": { "description": "信任等级字段映射(可选,如LinuxDo的trust_level)", "type": "string" }, "updatedAt": { "type": "string" }, "userIdField": { "description": "字段映射(支持嵌套字段,如 user.profile.name)", "type": "string" }, "userInfoUrl": { "description": "OAuth2用户信息地址", "type": "string" }, "usernameField": { "description": "用户名字段映射", "type": "string" } } }, "oauth2.PresetConfig": { "type": "object", "properties": { "authURL": { "type": "string" }, "avatarField": { "type": "string" }, "defaultLevel": { "type": "integer" }, "displayName": { "type": "string" }, "emailField": { "type": "string" }, "levelMapping": { "type": "object", "additionalProperties": { "type": "integer" } }, "name": { "type": "string" }, "nicknameField": { "type": "string" }, "providerType": { "type": "string" }, "scopes": { "type": "array", "items": { "type": "string" } }, "tokenURL": { "type": "string" }, "trustLevelField": { "type": "string" }, "userIDField": { "type": "string" }, "userInfoURL": { "type": "string" }, "usernameField": { "type": "string" } } }, "oauth2.UpdateProviderRequest": { "type": "object", "properties": { "authUrl": { "type": "string" }, "avatarField": { "type": "string" }, "clientId": { "type": "string" }, "clientSecret": { "type": "string" }, "defaultLevel": { "type": "integer" }, "displayName": { "type": "string" }, "emailField": { "type": "string" }, "enabled": { "type": "boolean" }, "levelMapping": { "type": "object", "additionalProperties": { "type": "integer" } }, "maxRegistrations": { "type": "integer" }, "name": { "type": "string" }, "nicknameField": { "type": "string" }, "providerType": { "type": "string", "enum": [ "preset", "generic" ] }, "redirectUrl": { "type": "string" }, "sort": { "type": "integer" }, "tokenUrl": { "type": "string" }, "trustLevelField": { "type": "string" }, "userIdField": { "type": "string" }, "userInfoUrl": { "type": "string" }, "usernameField": { "type": "string" } } }, "oneclickvirt_model_provider.Instance": { "type": "object", "properties": { "bandwidth": { "description": "网络带宽(Mbps)", "type": "integer" }, "cpu": { "description": "资源配置", "type": "integer" }, "createdAt": { "description": "实例创建时间", "type": "string" }, "discoveredData": { "description": "发现时的脱敏原始数据(JSON格式,用于调试和审计)", "type": "string" }, "disk": { "description": "磁盘大小(MB)", "type": "integer" }, "egressProfileId": { "description": "EgressProfileID binds this instance to a node-side transparent egress\nprofile. The Rust Agent treats the binding as desired state and keeps\ntraffic fail-closed until the host route plan is reconciled successfully.", "type": "string" }, "expiresAt": { "description": "生命周期和冻结管理", "type": "string" }, "expiryStopped": { "description": "是否由过期策略自动停机,续期后可自动恢复", "type": "boolean" }, "expiryStoppedAt": { "description": "过期策略自动停机时间", "type": "string" }, "frozenAt": { "description": "冻结时间", "type": "string" }, "frozenReason": { "description": "冻结原因:expired(到期), node_frozen(节点冻结), manual(手动冻结)", "type": "string" }, "gpuDeviceIds": { "description": "GPU设备ID列表(逗号分隔)", "type": "string" }, "gpuEnabled": { "description": "GPU/NPU直通配置(从兑换码/导入时继承,用于展示和运维参考)", "type": "boolean" }, "hasPortConflict": { "description": "是否存在端口冲突", "type": "boolean" }, "id": { "description": "基础字段", "type": "integer" }, "image": { "description": "使用的镜像名称(多容器场景可包含多个镜像)", "type": "string" }, "importedAt": { "description": "导入时间", "type": "string" }, "instance_type": { "description": "实例类型:container, vm", "type": "string" }, "ipv6Address": { "description": "内网IPv6地址", "type": "string" }, "isFrozen": { "description": "是否被冻结(冻结后无法操作,除了删除)", "type": "boolean" }, "isImported": { "description": "实例导入相关字段", "type": "boolean" }, "isManualExpiry": { "description": "是否手动设置了过期时间(手动设置的优先级高于节点)", "type": "boolean" }, "maxTraffic": { "description": "流量统计(实例层面)", "type": "integer" }, "memory": { "description": "内存大小(MB)", "type": "integer" }, "name": { "description": "基本信息\n添加覆盖索引,包含常用查询字段", "type": "string" }, "network": { "description": "网络配置", "type": "string" }, "networkType": { "description": "创建时继承的网络类型(用于reset时恢复IPv6配置)", "type": "string" }, "npuDeviceIds": { "description": "NPU设备ID列表(逗号分隔)", "type": "string" }, "npuEnabled": { "description": "是否启用NPU直通", "type": "boolean" }, "osType": { "description": "系统信息", "type": "string" }, "password": { "description": "登录密码", "type": "string" }, "pmacctInterfaceV4": { "description": "pmacct 监控的IPv4网络接口名称", "type": "string" }, "pmacctInterfaceV6": { "description": "pmacct 监控的IPv6网络接口名称", "type": "string" }, "portConflictDetail": { "description": "端口冲突详情(JSON格式记录冲突端口信息)", "type": "string" }, "portRangeEnd": { "description": "端口映射范围结束", "type": "integer" }, "portRangeStart": { "description": "端口映射范围起始", "type": "integer" }, "privateIP": { "description": "内网/私有IPv4地址", "type": "string" }, "provider": { "description": "Provider名称", "type": "string" }, "providerId": { "description": "关联的Provider ID(与name组合唯一)", "type": "integer" }, "providerVmId": { "description": "虚拟化平台的可操作实例ID(VMID、容器ID、VMX路径或远端实例名)", "type": "string" }, "publicIP": { "description": "公网IPv4地址", "type": "string" }, "publicIPv6": { "description": "公网IPv6地址", "type": "string" }, "region": { "description": "所在地区", "type": "string" }, "sshHost": { "description": "管理员可选的SSH目标覆盖地址;为空时沿用既有端口映射/实例IP解析", "type": "string" }, "sshPort": { "description": "SSH访问端口", "type": "integer" }, "status": { "description": "实例状态:creating, running, stopped, failed等", "type": "string" }, "trafficLimitReason": { "description": "流量限制原因:instance(实例超限), user(用户超限), provider(Provider超限)", "type": "string" }, "trafficLimited": { "description": "是否因流量超限被限制", "type": "boolean" }, "trafficStopped": { "description": "是否由流量策略自动停机,解除限制后可自动恢复", "type": "boolean" }, "trafficStoppedAt": { "description": "流量策略自动停机时间", "type": "string" }, "updatedAt": { "description": "实例信息更新时间", "type": "string" }, "userId": { "description": "关联关系\n添加UserID索引以支持按用户查询", "type": "integer" }, "username": { "description": "访问凭据", "type": "string" }, "uuid": { "description": "实例唯一标识符", "type": "string" } } }, "oneclickvirt_model_provider.Provider": { "type": "object", "properties": { "agentConnectedAt": { "description": "Agent 本次连接建立时间(用于计算在线时长)", "type": "string" }, "agentHostname": { "description": "Agent 上报的主机名", "type": "string" }, "agentLastSeen": { "description": "Agent 最后心跳时间", "type": "string" }, "agentRemoteIP": { "description": "Agent 连接来源 IP(WebSocket 连接的 RemoteAddr)", "type": "string" }, "agentStatus": { "description": "Agent 在线状态:online / offline", "type": "string" }, "agentVersion": { "description": "Agent 上报的版本号", "type": "string" }, "allowClaim": { "description": "是否允许用户使用此Provider", "type": "boolean" }, "allowConcurrentTasks": { "description": "并发控制配置", "type": "boolean" }, "apiStatus": { "description": "API连接状态:online, offline, unknown", "type": "string" }, "architecture": { "description": "CPU架构:amd64, arm64, s390x等", "type": "string" }, "autoConfigured": { "description": "是否已经自动配置完成", "type": "boolean" }, "availableCpuCores": { "description": "可用资源统计(动态计算得出)", "type": "integer" }, "availableMemory": { "description": "可用的内存大小(NodeMemoryTotal - UsedMemory)", "type": "integer" }, "bridgeDedicatedV4": { "description": "独立IPv4网桥,仅proxmox+third_party时使用,对应vmbr0", "type": "string" }, "bridgeDedicatedV6": { "description": "独立IPv6网桥,仅proxmox+third_party时使用,对应vmbr2,可留空", "type": "string" }, "bridgeNAT": { "description": "NAT网桥(v4/v6 NAT),仅proxmox+third_party时使用,对应vmbr1", "type": "string" }, "caCertPath": { "description": "CA证书文件路径", "type": "string" }, "certFingerprint": { "description": "证书指纹", "type": "string" }, "certPath": { "description": "证书相关字段(用于TLS连接)", "type": "string" }, "city": { "description": "城市(可选)", "type": "string" }, "config": { "description": "额外配置信息(JSON格式)", "type": "string" }, "configBackupPath": { "description": "配置备份文件路径", "type": "string" }, "configVersion": { "description": "配置版本号", "type": "integer" }, "connectionType": { "description": "连接模式(agent 由 Rust Agent 主动连回控制端,local 直接管理本机 libvirt/QEMU)", "type": "string" }, "containerAllowNesting": { "description": "容器嵌套:允许在容器内运行容器", "type": "boolean" }, "containerCount": { "description": "当前运行的容器实例数量(缓存值,定期更新)", "type": "integer" }, "containerCpuAllowance": { "description": "CPU限制:例如 \"100%\" 或 \"50%\"", "type": "string" }, "containerDiskIoLimit": { "description": "磁盘IO限制:例如 \"10MB\" 或 \"100iops\"", "type": "string" }, "containerEnableLxcfs": { "description": "LXCFS资源视图:显示真实资源限制", "type": "boolean" }, "containerLimitCpu": { "description": "容器资源配额管理配置(Provider层面)\n这些配置决定该资源是否计入Provider总量预算,不影响实例创建时的资源参数设置\nfalse=允许超分配(不计入总量),true=严格限制(计入总量)", "type": "boolean" }, "containerLimitDisk": { "description": "容器硬盘是否计入Provider总量预算,默认true(严格限制)", "type": "boolean" }, "containerLimitMemory": { "description": "容器内存是否计入Provider总量预算,默认false(允许超分配)", "type": "boolean" }, "containerMaxProcesses": { "description": "最大进程数:0表示不限制", "type": "integer" }, "containerMemorySwap": { "description": "内存交换:允许使用swap空间", "type": "boolean" }, "containerPrivileged": { "description": "容器特殊配置选项(仅适用于 LXD 和 Incus 的容器实例)", "type": "boolean" }, "containerReadIoLimit": { "description": "磁盘读写 I/O 速率限制(Provider 默认值,按实例类型区分;空值表示不限制,后端 best-effort 应用)", "type": "string" }, "containerWriteIoLimit": { "description": "容器写速率限制,如 \"50MB\"", "type": "string" }, "container_enabled": { "description": "功能支持", "type": "boolean" }, "countCacheExpiry": { "description": "数量缓存过期时间(避免频繁查询数据库)", "type": "string" }, "country": { "description": "国家", "type": "string" }, "countryCode": { "description": "国家代码", "type": "string" }, "createdAt": { "description": "创建时间", "type": "string" }, "defaultInboundBandwidth": { "description": "带宽配置(Mbps为单位)", "type": "integer" }, "defaultOutboundBandwidth": { "description": "默认出站带宽限制(Mbps)", "type": "integer" }, "defaultPortCount": { "description": "端口映射配置", "type": "integer" }, "description": { "description": "Provider描述(管理员备注)", "type": "string" }, "discoveryAutoAdjust": { "description": "发现时是否自动调整配额", "type": "boolean" }, "discoveryAutoImport": { "description": "发现时是否自动导入", "type": "boolean" }, "discoveryOwnerUserId": { "description": "发现实例的归属用户 ID", "type": "integer" }, "enableCheckin": { "description": "签到续期开关(高级配置)", "type": "boolean" }, "enableDomainBinding": { "description": "域名绑定开关(高级配置)", "type": "boolean" }, "enableResourceMonitoring": { "description": "是否启用硬件资源监控(CPU/内存/磁盘),默认不启用", "type": "boolean" }, "enableTaskPolling": { "description": "是否启用任务轮询机制", "type": "boolean" }, "enableTrafficControl": { "description": "流量管理(MB为单位)", "type": "boolean" }, "enableVNC": { "description": "WebVNC 高级配置:默认关闭。仅对支持图形控制台的VM类Provider显示WebVNC按钮。", "type": "boolean" }, "endpoint": { "description": "SSH连接端点地址", "type": "string" }, "executionRule": { "description": "操作执行配置", "type": "string" }, "expiresAt": { "description": "Provider过期时间", "type": "string" }, "fixedPorts": { "description": "固定实例内端口,宿主机端口仍从端口池分配;22 强制保留", "type": "array", "items": { "type": "integer" } }, "frozenAt": { "description": "冻结时间", "type": "string" }, "frozenReason": { "description": "冻结原因", "type": "string" }, "gpuDeviceIds": { "description": "GPU设备ID列表(逗号分隔的PCI ID,如\"0,1\"),为空则附加所有GPU", "type": "string" }, "gpuEnabled": { "description": "GPU直通配置(仅适用于 LXD 和 Incus 节点)", "type": "boolean" }, "gpuInfo": { "description": "缓存GPU/NPU检测结果(JSON数组),供前端展示选择,免去每次检测", "type": "string" }, "groupDescription": { "description": "分组描述(Markdown源码,由前端/接口渲染为安全HTML)", "type": "string" }, "groupId": { "description": "所属节点分组ID(0=未分组)", "type": "integer" }, "groupName": { "description": "分组名称(普通管理员可自定义)", "type": "string" }, "hostName": { "description": "节点标识信息(用于区分多个hostname相同的节点)", "type": "string" }, "id": { "description": "基础字段", "type": "integer" }, "instanceDiscoveryEnabled": { "description": "非纯净节点实例发现配置。InstanceDiscoveryEnabled 是持久能力开关;\nPendingDiscovery 仅表示 Agent 尚未连接时仍有一次待入队的后台任务。", "type": "boolean" }, "instanceExpiryAction": { "description": "实例到期处置策略", "type": "string" }, "instanceExpiryExtendDays": { "description": "到期延期天数,仅extend模式生效", "type": "integer" }, "ipv4PortMappingMethod": { "description": "端口映射配置", "type": "string" }, "ipv6AddressFilePath": { "description": "节点侧IPv6地址/CIDR文件;为空时使用主控地址池或自动探测", "type": "string" }, "ipv6AddressFileSyncError": { "description": "最近同步错误;成功后清空", "type": "string" }, "ipv6AddressFileSyncedAt": { "description": "节点IPv6地址文件最近成功同步时间", "type": "string" }, "ipv6PortMappingMethod": { "description": "IPv6端口映射方式:device_proxy, iptables, native", "type": "string" }, "isFrozen": { "description": "是否被冻结(冻结后无法使用,除了删除操作)", "type": "boolean" }, "isManualExpiry": { "description": "是否手动设置了过期时间", "type": "boolean" }, "keyPath": { "description": "客户端私钥文件路径", "type": "string" }, "lastApiCheck": { "description": "最后一次API健康检查时间", "type": "string" }, "lastConfigUpdate": { "description": "最后一次配置更新时间", "type": "string" }, "lastSshCheck": { "description": "最后一次SSH健康检查时间", "type": "string" }, "levelLimits": { "description": "节点级别的等级限制配置(JSON格式存储)\n用于限制该节点上不同等级用户能创建的最大资源,与全局等级配置类似但仅对当前节点生效\n该字段会与用户全局等级限制进行比较,取两者的最小值作为实际限制", "type": "string" }, "maxConcurrentTasks": { "description": "最大并发任务数量", "type": "integer" }, "maxContainerInstances": { "description": "实例数量限制配置", "type": "integer" }, "maxInboundBandwidth": { "description": "最大入站带宽限制(Mbps)", "type": "integer" }, "maxOutboundBandwidth": { "description": "最大出站带宽限制(Mbps)", "type": "integer" }, "maxTraffic": { "description": "最大流量限制(默认1TB=1048576MB)", "type": "integer" }, "maxVMInstances": { "description": "最大虚拟机实例数量(0表示无限制)", "type": "integer" }, "name": { "description": "基本信息\nname已有uniqueIndex,type添加索引", "type": "string" }, "natSubnet": { "description": "NAT内网网段(CIDR,如 172.16.1.0/24),仅proxmox+third_party时使用", "type": "string" }, "networkType": { "description": "网络配置类型:nat_ipv4, nat_ipv4_ipv6, dedicated_ipv4, dedicated_ipv4_ipv6, ipv6_only", "type": "string" }, "nextAvailablePort": { "description": "下一个可用端口", "type": "integer" }, "nodeCpuCores": { "description": "节点硬件资源信息(通过SSH查询获得)", "type": "integer" }, "nodeDiskTotal": { "description": "节点总磁盘空间(MB)", "type": "integer" }, "nodeInstallType": { "description": "Proxmox 网桥配置(NodeInstallType == \"third_party\" 时生效,否则使用脚本安装的默认值)\n脚本安装(script)时固定使用:vmbr0(独立IPv4), vmbr1(NAT), vmbr2(独立IPv6)", "type": "string" }, "nodeMemoryPhysicalTotal": { "description": "节点物理内存大小(MB,不含Swap)", "type": "integer" }, "nodeMemorySwapTotal": { "description": "节点Swap大小(MB)", "type": "integer" }, "nodeMemoryTotal": { "description": "节点总内存大小(MB)", "type": "integer" }, "ownerAdminId": { "description": "普通管理员归属", "type": "integer" }, "pendingDiscovery": { "description": "是否有待入队的实例同步任务", "type": "boolean" }, "portIP": { "description": "端口映射使用的公网IP(非必填,若为空则使用Endpoint)", "type": "string" }, "portRangeEnd": { "description": "端口映射范围结束", "type": "integer" }, "portRangeStart": { "description": "端口映射范围起始", "type": "integer" }, "proxyAutoSync": { "description": "是否自动同步证书到节点", "type": "boolean" }, "proxyEnableHttp": { "description": "是否启用HTTP反向代理", "type": "boolean" }, "proxyEnableHttps": { "description": "是否启用HTTPS反向代理", "type": "boolean" }, "proxyHttpPort": { "description": "域名反向代理高级配置", "type": "integer" }, "proxyHttpsPort": { "description": "HTTPS反向代理监听端口(默认443)", "type": "integer" }, "proxySyncedAt": { "description": "证书最后同步时间", "type": "string" }, "proxyTlsCertPath": { "description": "TLS证书文件路径(节点上的绝对路径)", "type": "string" }, "proxyTlsKeyPath": { "description": "TLS私钥文件路径(节点上的绝对路径)", "type": "string" }, "pveKvmAvailable": { "description": "Proxmox节点是否支持KVM硬件加速(nil=未知,true=支持,false=不支持/仅QEMU软件模拟)", "type": "boolean" }, "redeemCodeOnly": { "description": "是否仅支持兑换码兑换(开启后用户申请界面隐藏常规配置表单)", "type": "boolean" }, "region": { "description": "地区", "type": "string" }, "resourceSynced": { "description": "资源信息是否已同步", "type": "boolean" }, "resourceSyncedAt": { "description": "资源信息最后同步时间", "type": "string" }, "sshConnectTimeout": { "description": "SSH连接配置", "type": "integer" }, "sshExecuteTimeout": { "description": "SSH命令执行超时时间(秒),默认300秒", "type": "integer" }, "sshPort": { "description": "SSH连接端口", "type": "integer" }, "sshStatus": { "description": "SSH连接状态:online, offline, unknown", "type": "string" }, "status": { "description": "状态和地理信息", "type": "string" }, "storagePool": { "description": "存储配置(所有Provider类型通用)", "type": "string" }, "storagePoolPath": { "description": "存储池实际挂载路径,用于准确获取硬盘大小", "type": "string" }, "supported_types": { "description": "支持的实例类型列表", "type": "string" }, "taskPollInterval": { "description": "任务调度配置", "type": "integer" }, "totalQuota": { "description": "总配额(传统字段,兼容性保留)", "type": "integer" }, "trafficAutoResetBatchSize": { "description": "流量自动重置批量大小,默认10个", "type": "integer" }, "trafficAutoResetInterval": { "description": "流量自动重置检查间隔(秒),默认1800秒(30分钟)", "type": "integer" }, "trafficCollectBatchSize": { "description": "流量采集批量大小,默认10个", "type": "integer" }, "trafficCollectInterval": { "description": "流量采集间隔(秒),采集后自动统计,默认300秒(5分钟)", "type": "integer" }, "trafficCountMode": { "description": "流量统计模式:both(双向), out(仅出向), in(仅入向)", "type": "string" }, "trafficLimitCheckBatchSize": { "description": "流量限制检测批量大小,默认10个", "type": "integer" }, "trafficLimitCheckInterval": { "description": "流量限制检测间隔(秒),默认600秒(10分钟)", "type": "integer" }, "trafficLimited": { "description": "是否因流量超限被限制", "type": "boolean" }, "trafficMultiplier": { "description": "流量计费倍率(例如:入向0.5倍,出向1倍)", "type": "number" }, "trafficOverLimitAction": { "description": "流量超限动作", "type": "string" }, "trafficQuotaVisible": { "description": "用户侧是否显示流量额度与用量", "type": "boolean" }, "trafficResetAt": { "description": "流量重置时间", "type": "string" }, "trafficResetDay": { "description": "每月流量重置日期,nil/0表示每月1日自然月重置", "type": "integer" }, "trafficSpeedLimitKbps": { "description": "限速值(Kbps), 仅speed_limit模式生效", "type": "integer" }, "trafficStatsMode": { "description": "流量统计性能配置", "type": "string" }, "trafficSyncMethod": { "description": "流量同步方式:pmacct(传统SSH采集), agent(Rust Agent采集)", "type": "string" }, "type": { "description": "Provider类型:docker, podman, containerd, orbstack, lxd, incus, proxmox, qemu, kubevirt, vmware", "type": "string" }, "updatedAt": { "description": "更新时间", "type": "string" }, "usedCpuCores": { "description": "资源占用统计(基于实际创建的实例计算)", "type": "integer" }, "usedDisk": { "description": "已占用的磁盘空间(MB)", "type": "integer" }, "usedInstances": { "description": "已使用的实例总数(ContainerCount + VMCount)", "type": "integer" }, "usedMemory": { "description": "已占用的内存大小(MB)", "type": "integer" }, "usedQuota": { "description": "配额管理", "type": "integer" }, "username": { "description": "SSH连接用户名", "type": "string" }, "uuid": { "description": "唯一标识符", "type": "string" }, "version": { "description": "虚拟化平台版本(如Proxmox版本)", "type": "string" }, "vmCount": { "description": "当前运行的虚拟机实例数量(缓存值,定期更新)", "type": "integer" }, "vmLimitCpu": { "description": "虚拟机资源配额管理配置(Provider层面)\n这些配置决定该资源是否计入Provider总量预算,不影响实例创建时的资源参数设置\nfalse=允许超分配(不计入总量),true=严格限制(计入总量)", "type": "boolean" }, "vmLimitDisk": { "description": "虚拟机硬盘是否计入Provider总量预算,默认true(严格限制)", "type": "boolean" }, "vmLimitMemory": { "description": "虚拟机内存是否计入Provider总量预算,默认true(严格限制)", "type": "boolean" }, "vmReadIoLimit": { "description": "虚拟机读速率限制,如 \"50MB\"", "type": "string" }, "vmWriteIoLimit": { "description": "虚拟机写速率限制,如 \"50MB\"", "type": "string" }, "vm_enabled": { "description": "是否支持虚拟机实例", "type": "boolean" }, "vncBasePort": { "description": "直连VNC端口基准,默认5900;实际端口可由实例发现数据覆盖", "type": "integer" }, "vncHost": { "description": "可选VNC宿主地址,留空使用Provider Endpoint/PortIP", "type": "string" } } }, "oneclickvirt_service_provider.ConnectProviderRequest": { "type": "object", "required": [ "host", "name", "password", "type", "username" ], "properties": { "cert_path": { "type": "string" }, "containerLimitCpu": { "description": "容器资源限制配置(Provider层面)", "type": "boolean" }, "containerLimitDisk": { "description": "容器是否限制硬盘大小", "type": "boolean" }, "containerLimitMemory": { "description": "容器是否限制内存大小", "type": "boolean" }, "container_enabled": { "type": "boolean" }, "host": { "type": "string" }, "key_path": { "type": "string" }, "levelLimits": { "description": "节点级别的等级限制配置\n用于限制该节点上不同等级用户能创建的最大资源", "type": "object", "additionalProperties": { "type": "object", "additionalProperties": true } }, "name": { "type": "string" }, "networkType": { "description": "网络配置类型", "type": "string" }, "password": { "type": "string" }, "port": { "description": "兼容旧的port字段", "type": "integer" }, "sshKey": { "description": "SSH私钥内容,优先于密码使用", "type": "string" }, "sshPort": { "description": "新的sshPort字段", "type": "integer" }, "token": { "description": "API Token,用于ProxmoxVE等", "type": "string" }, "type": { "type": "string" }, "username": { "type": "string" }, "vmLimitCpu": { "description": "虚拟机资源限制配置(Provider层面)", "type": "boolean" }, "vmLimitDisk": { "description": "虚拟机是否限制硬盘大小", "type": "boolean" }, "vmLimitMemory": { "description": "虚拟机是否限制内存大小", "type": "boolean" }, "vm_enabled": { "type": "boolean" } } }, "oneclickvirt_service_provider.CreateInstanceRequest": { "type": "object", "properties": { "allowNesting": { "description": "容器嵌套", "type": "boolean" }, "copyMode": { "description": "复制模式(LXD/Incus 与 Docker/Podman/Containerd/Orbstack 容器节点)", "type": "boolean" }, "copySourceName": { "description": "复制模式下的源容器名称", "type": "string" }, "cpu": { "type": "string" }, "cpuAllowance": { "description": "CPU限制", "type": "string" }, "disk": { "type": "string" }, "diskIoLimit": { "description": "磁盘IO限制", "type": "string" }, "enableLxcfs": { "description": "LXCFS资源视图", "type": "boolean" }, "env": { "type": "object", "additionalProperties": { "type": "string" } }, "gpuDeviceIds": { "description": "GPU设备ID列表(逗号分隔),为空则附加所有GPU", "type": "string" }, "gpuEnabled": { "description": "GPU直通配置(LXD/Incus 原生支持,Docker/Podman/Containerd/Orbstack 尽力通过运行参数附加)", "type": "boolean" }, "image": { "type": "string" }, "image_path": { "description": "镜像文件路径", "type": "string" }, "image_url": { "description": "镜像下载URL", "type": "string" }, "instance_type": { "description": "container 或 vm", "type": "string" }, "maxProcesses": { "description": "最大进程数", "type": "integer" }, "memory": { "type": "string" }, "memorySwap": { "description": "内存交换", "type": "boolean" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "network": { "type": "string" }, "ports": { "type": "array", "items": { "type": "string" } }, "privileged": { "description": "容器特殊配置选项(仅适用于 LXD 和 Incus 的容器实例)", "type": "boolean" }, "readIoLimit": { "description": "磁盘读取速率限制", "type": "string" }, "systemImageId": { "description": "系统镜像ID", "type": "integer" }, "use_cdn": { "description": "是否使用CDN加速下载镜像", "type": "boolean" }, "writeIoLimit": { "description": "磁盘写入速率限制", "type": "string" } } }, "provider.DiscoveredAccelerator": { "type": "object", "properties": { "bus": { "description": "总线地址(可选)", "type": "string" }, "id": { "description": "设备ID(如索引或PCI地址)", "type": "string" }, "kind": { "description": "gpu / npu", "type": "string" }, "name": { "description": "设备名称", "type": "string" }, "source": { "description": "来源:devices/lspci/nvidia-smi/npu-smi", "type": "string" }, "vendor": { "description": "厂商", "type": "string" } } }, "provider.DiscoveredInstance": { "type": "object", "properties": { "accelerators": { "type": "array", "items": { "$ref": "#/definitions/provider.DiscoveredAccelerator" } }, "cpu": { "description": "资源配置", "type": "integer" }, "disk": { "description": "磁盘大小(MB)", "type": "integer" }, "extraPorts": { "description": "其他开放端口(向后兼容)", "type": "array", "items": { "type": "integer" } }, "gpuDeviceIds": { "type": "string" }, "gpuEnabled": { "description": "硬件加速配置(主要用于 LXD/Incus 导入场景)", "type": "boolean" }, "image": { "description": "系统信息", "type": "string" }, "instanceType": { "description": "实例类型(container或vm)", "type": "string" }, "ipv6Address": { "description": "IPv6地址", "type": "string" }, "macAddress": { "description": "MAC地址", "type": "string" }, "memory": { "description": "内存大小(MB)", "type": "integer" }, "name": { "description": "实例名称", "type": "string" }, "npuDeviceIds": { "type": "string" }, "npuEnabled": { "type": "boolean" }, "osType": { "description": "操作系统类型", "type": "string" }, "portMappings": { "description": "完整的端口映射信息", "type": "array", "items": { "$ref": "#/definitions/provider.DiscoveredPortMapping" } }, "privateIP": { "description": "网络配置", "type": "string" }, "providerInstanceId": { "description": "虚拟化平台上的原始实例ID(如 Proxmox VMID/CTID)", "type": "string" }, "publicIP": { "description": "公网IPv4地址", "type": "string" }, "rawData": { "description": "原始数据(用于调试)" }, "sshPort": { "description": "SSH端口", "type": "integer" }, "status": { "description": "实例状态(running, stopped等)", "type": "string" }, "username": { "description": "导入时可用的SSH用户名", "type": "string" }, "uuid": { "description": "基本标识", "type": "string" } } }, "provider.DiscoveredPortMapping": { "type": "object", "properties": { "guestPort": { "description": "容器/虚拟机内部端口", "type": "integer" }, "hostPort": { "description": "宿主机端口", "type": "integer" }, "isSsh": { "description": "是否为SSH端口", "type": "boolean" }, "mappingMethod": { "description": "native, device_proxy, iptables", "type": "string" }, "protocol": { "description": "tcp, udp, both", "type": "string" } } }, "provider.DiscoveryResult": { "type": "object", "properties": { "alreadyManaged": { "description": "已纳管的实例数", "type": "integer" }, "discoveredAt": { "type": "string" }, "discoveredInstances": { "type": "array", "items": { "$ref": "#/definitions/provider.DiscoveredInstance" } }, "error": { "type": "string" }, "newInstances": { "description": "新发现的实例数", "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "providerType": { "type": "string" }, "totalCount": { "type": "integer" } } }, "provider.ImportOptions": { "type": "object", "properties": { "adminUserId": { "description": "管理员用户ID,导入的实例将分配给该用户", "type": "integer" }, "autoAdjustQuota": { "description": "是否自动调整quota", "type": "boolean" }, "instanceUuids": { "description": "要导入的实例UUID列表,为空表示全部导入", "type": "array", "items": { "type": "string" } }, "markConflicts": { "description": "是否标记端口冲突", "type": "boolean" }, "providerId": { "description": "Provider ID", "type": "integer" } } }, "provider.ImportResult": { "type": "object", "properties": { "errors": { "description": "错误列表", "type": "array", "items": { "type": "string" } }, "failedCount": { "description": "失败数", "type": "integer" }, "importedAt": { "type": "string" }, "importedDetails": { "description": "导入详情", "type": "array", "items": { "$ref": "#/definitions/provider.ImportedInstanceInfo" } }, "portConflicts": { "description": "端口冲突数", "type": "integer" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "quotaAdjusted": { "description": "是否调整了quota", "type": "boolean" }, "skippedCount": { "description": "跳过数(已存在)", "type": "integer" }, "successCount": { "description": "成功导入数", "type": "integer" }, "totalAttempted": { "description": "尝试导入的实例数", "type": "integer" } } }, "provider.ImportedInstanceInfo": { "type": "object", "properties": { "conflictDetail": { "type": "string" }, "error": { "type": "string" }, "hasPortConflict": { "type": "boolean" }, "instanceId": { "type": "integer" }, "name": { "type": "string" }, "status": { "description": "success, skipped, failed", "type": "string" }, "uuid": { "type": "string" } } }, "provider.InstanceChange": { "type": "object", "properties": { "instanceId": { "type": "integer" }, "name": { "type": "string" }, "newStatus": { "type": "string" }, "oldStatus": { "type": "string" }, "uuid": { "type": "string" } } }, "provider.InstanceSyncReport": { "type": "object", "properties": { "changedInstances": { "description": "状态变化实例", "type": "array", "items": { "$ref": "#/definitions/provider.InstanceChange" } }, "checkedAt": { "type": "string" }, "deletedInstances": { "description": "已删除实例", "type": "array", "items": { "$ref": "#/definitions/oneclickvirt_model_provider.Instance" } }, "newInstances": { "description": "新增实例", "type": "array", "items": { "$ref": "#/definitions/provider.DiscoveredInstance" } }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "totalDB": { "description": "数据库总实例数", "type": "integer" }, "totalRemote": { "description": "远程总实例数", "type": "integer" } } }, "resource.ResourceReservation": { "type": "object", "properties": { "bandwidth": { "description": "预留的带宽(Mbps)", "type": "integer" }, "cpu": { "description": "预留的CPU核心数", "type": "integer" }, "createdAt": { "type": "string" }, "disk": { "description": "预留的磁盘(MB)", "type": "integer" }, "expiresAt": { "description": "TTL管理", "type": "string" }, "id": { "type": "integer" }, "instanceType": { "description": "实例规格", "type": "string" }, "memory": { "description": "预留的内存(MB)", "type": "integer" }, "providerId": { "description": "Provider ID", "type": "integer" }, "sessionId": { "description": "会话标识,唯一主键", "type": "string" }, "updatedAt": { "type": "string" }, "userId": { "description": "核心标识字段", "type": "integer" }, "uuid": { "type": "string" } } }, "system.CPUStats": { "type": "object", "properties": { "cores": { "description": "CPU核心数", "type": "integer" }, "load_avg_1": { "description": "1分钟负载平均值", "type": "number" }, "load_avg_15": { "description": "15分钟负载平均值", "type": "number" }, "load_avg_5": { "description": "5分钟负载平均值", "type": "number" }, "usage": { "description": "CPU使用率", "type": "number" } } }, "system.CreateSystemImageRequest": { "type": "object", "required": [ "architecture", "instanceType", "minDiskMB", "minMemoryMB", "name", "providerType", "url" ], "properties": { "architecture": { "type": "string", "enum": [ "amd64", "arm64", "s390x" ] }, "checksum": { "type": "string" }, "description": { "type": "string" }, "instanceType": { "type": "string", "enum": [ "vm", "container" ] }, "minDiskMB": { "type": "integer", "minimum": 1 }, "minMemoryMB": { "type": "integer", "minimum": 1 }, "name": { "type": "string" }, "osType": { "type": "string" }, "osVersion": { "type": "string" }, "providerType": { "type": "string", "enum": [ "proxmox", "lxd", "incus", "docker", "podman", "containerd", "orbstack", "qemu", "kubevirt", "vmware", "virtualbox", "multipass", "vagrant" ] }, "size": { "type": "integer" }, "tags": { "type": "string" }, "url": { "type": "string" }, "useCdn": { "type": "boolean" } } }, "system.DatabaseStats": { "type": "object", "properties": { "connections": { "description": "当前连接数", "type": "integer" }, "max_connections": { "description": "最大连接数", "type": "integer" }, "queries_total": { "description": "总查询数", "type": "integer" }, "slow_queries": { "description": "慢查询数", "type": "integer" }, "uptime": { "description": "运行时间", "type": "string" } } }, "system.DiskStats": { "type": "object", "properties": { "free": { "description": "磁盘空闲", "type": "integer" }, "total": { "description": "磁盘总大小", "type": "integer" }, "usage": { "description": "磁盘使用率", "type": "number" }, "used": { "description": "磁盘已使用", "type": "integer" } } }, "system.MemoryStats": { "type": "object", "properties": { "free": { "description": "空闲内存", "type": "integer" }, "swap_total": { "description": "交换分区总大小", "type": "integer" }, "swap_used": { "description": "交换分区已使用", "type": "integer" }, "total": { "description": "总内存", "type": "integer" }, "usage": { "description": "内存使用率", "type": "number" }, "used": { "description": "已使用内存", "type": "integer" } } }, "system.NetworkStats": { "type": "object", "properties": { "bytes_received": { "description": "接收字节数", "type": "integer" }, "bytes_sent": { "description": "发送字节数", "type": "integer" }, "packets_recv": { "description": "接收包数", "type": "integer" }, "packets_sent": { "description": "发送包数", "type": "integer" } } }, "system.RuntimeStats": { "type": "object", "properties": { "gc_cycles": { "description": "GC循环次数", "type": "integer" }, "goroutines": { "description": "协程数量", "type": "integer" }, "heap_alloc": { "description": "堆内存分配", "type": "integer" }, "heap_idle": { "description": "堆内存空闲", "type": "integer" }, "heap_inuse": { "description": "堆内存使用中", "type": "integer" }, "heap_sys": { "description": "堆内存系统", "type": "integer" }, "last_gc": { "description": "最后GC时间", "type": "string" }, "uptime": { "description": "运行时间", "type": "string" } } }, "system.SystemStats": { "type": "object", "properties": { "cpu": { "$ref": "#/definitions/system.CPUStats" }, "database": { "$ref": "#/definitions/system.DatabaseStats" }, "disk": { "$ref": "#/definitions/system.DiskStats" }, "memory": { "$ref": "#/definitions/system.MemoryStats" }, "network": { "$ref": "#/definitions/system.NetworkStats" }, "runtime": { "$ref": "#/definitions/system.RuntimeStats" }, "timestamp": { "type": "string" } } }, "traffic.BatchManageTrafficLimitRequest": { "type": "object", "required": [ "action", "user_ids" ], "properties": { "action": { "description": "\"limit\" 或 \"unlimit\"", "type": "string" }, "reason": { "description": "限制原因(仅在action为limit时需要)", "type": "string" }, "user_ids": { "type": "array", "items": { "type": "integer" } } } }, "traffic.BatchSyncTrafficRequest": { "type": "object", "required": [ "user_ids" ], "properties": { "user_ids": { "type": "array", "items": { "type": "integer" } } } }, "traffic.ManageTrafficLimitRequest": { "type": "object", "required": [ "action", "target_id", "type" ], "properties": { "action": { "description": "\"limit\" 或 \"unlimit\"", "type": "string" }, "reason": { "description": "限制原因(仅在action为limit时需要)", "type": "string" }, "target_id": { "description": "目标用户ID或Provider ID", "type": "integer" }, "type": { "description": "\"user\" 或 \"provider\"", "type": "string" } } }, "update.UpdateRequest": { "type": "object", "properties": { "backupId": { "type": "string" }, "version": { "type": "string" } } }, "user.AvailableProviderResponse": { "type": "object", "properties": { "architecture": { "description": "CPU架构:amd64, arm64, s390x等", "type": "string" }, "availableContainerSlots": { "description": "可用容器槽位数,-1表示不限制", "type": "integer" }, "availableVMSlots": { "description": "可用虚拟机槽位数,-1表示不限制", "type": "integer" }, "city": { "type": "string" }, "connectionType": { "description": "连接类型:ssh/agent", "type": "string" }, "containerEnabled": { "type": "boolean" }, "country": { "type": "string" }, "countryCode": { "type": "string" }, "cpu": { "type": "integer" }, "cpuUsage": { "type": "number" }, "description": { "type": "string" }, "disk": { "description": "总硬盘空间(MB)", "type": "integer" }, "gpuEnabled": { "description": "是否启用GPU直通", "type": "boolean" }, "groupDescription": { "description": "分组描述(Markdown源码)", "type": "string" }, "groupDescriptionHtml": { "description": "分组描述安全HTML", "type": "string" }, "groupId": { "description": "分组ID", "type": "integer" }, "groupName": { "description": "分组名称", "type": "string" }, "id": { "type": "integer" }, "maxContainerInstances": { "description": "最大容器数量,0表示不限制", "type": "integer" }, "maxVMInstances": { "description": "最大虚拟机数量,0表示不限制", "type": "integer" }, "memory": { "description": "总内存(MB)", "type": "integer" }, "memoryUsage": { "type": "number" }, "name": { "type": "string" }, "networkType": { "description": "节点网络模式", "type": "string" }, "physicalMemory": { "description": "物理内存(MB)", "type": "integer" }, "redeemCodeOnly": { "description": "是否仅支持兑换码兑换", "type": "boolean" }, "region": { "type": "string" }, "status": { "type": "string" }, "swapMemory": { "description": "Swap内存(MB)", "type": "integer" }, "type": { "description": "虚拟化/Provider类型", "type": "string" }, "vmEnabled": { "type": "boolean" } } }, "user.BandwidthSpecResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "speedMbps": { "type": "integer" } } }, "user.BatchInstanceActionRequest": { "type": "object", "required": [ "action", "instanceIds" ], "properties": { "action": { "type": "string" }, "image": { "type": "string" }, "instanceIds": { "type": "array", "minItems": 1, "items": { "type": "integer" } } } }, "user.BatchInstanceActionResponse": { "type": "object", "properties": { "action": { "type": "string" }, "failCount": { "type": "integer" }, "results": { "type": "array", "items": { "$ref": "#/definitions/user.BatchInstanceActionResult" } }, "successCount": { "type": "integer" }, "total": { "type": "integer" } } }, "user.BatchInstanceActionResult": { "type": "object", "properties": { "error": { "type": "string" }, "instanceId": { "type": "integer" }, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "user.CPUSpecResponse": { "type": "object", "properties": { "cores": { "type": "integer" }, "id": { "type": "string" }, "name": { "type": "string" } } }, "user.ChangePasswordRequest": { "type": "object", "required": [ "newPassword", "oldPassword" ], "properties": { "newPassword": { "type": "string" }, "oldPassword": { "type": "string" } } }, "user.ClaimResourceRequest": { "type": "object", "required": [ "image", "instanceType", "name", "providerId" ], "properties": { "cpu": { "type": "integer" }, "disk": { "type": "integer" }, "image": { "type": "string" }, "instanceType": { "type": "string" }, "memory": { "type": "integer" }, "name": { "type": "string" }, "providerId": { "type": "integer" } } }, "user.CreateInstanceRequest": { "type": "object", "required": [ "bandwidthId", "cpuId", "diskId", "imageId", "memoryId", "providerId" ], "properties": { "bandwidthId": { "description": "带宽规格ID", "type": "string" }, "cpuId": { "description": "CPU规格ID", "type": "string" }, "description": { "description": "描述信息", "type": "string" }, "diskId": { "description": "磁盘规格ID", "type": "string" }, "gpuDeviceIds": { "description": "GPU设备ID列表(逗号分隔),为空则附加所有GPU", "type": "string" }, "gpuEnabled": { "description": "GPU直通配置(LXD/Incus 原生支持,Docker/Podman/Containerd/Orbstack 尽力通过运行参数附加)", "type": "boolean" }, "imageId": { "description": "镜像ID(从数据库获取)", "type": "integer" }, "memoryId": { "description": "内存规格ID", "type": "string" }, "providerId": { "description": "节点ID", "type": "integer" } } }, "user.DiskSpecResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "sizeMB": { "type": "integer" } } }, "user.GetInstancePasswordResponse": { "type": "object", "properties": { "newPassword": { "type": "string" }, "resetTime": { "type": "integer" } } }, "user.InstanceActionRequest": { "type": "object", "required": [ "action", "instanceId" ], "properties": { "action": { "type": "string" }, "image": { "type": "string" }, "instanceId": { "type": "integer" } } }, "user.InstanceConfigResponse": { "type": "object", "properties": { "bandwidthSpecs": { "description": "可用带宽规格列表", "type": "array", "items": { "$ref": "#/definitions/user.BandwidthSpecResponse" } }, "cpuSpecs": { "description": "可用CPU规格列表", "type": "array", "items": { "$ref": "#/definitions/user.CPUSpecResponse" } }, "diskSpecs": { "description": "可用磁盘规格列表", "type": "array", "items": { "$ref": "#/definitions/user.DiskSpecResponse" } }, "images": { "description": "可用镜像列表(从数据库获取)", "type": "array", "items": { "$ref": "#/definitions/user.SystemImageResponse" } }, "memorySpecs": { "description": "可用内存规格列表", "type": "array", "items": { "$ref": "#/definitions/user.MemorySpecResponse" } } } }, "user.InstanceMonitoringResponse": { "type": "object", "properties": { "trafficData": { "description": "CPUUsage float64 `json:\"cpuUsage\"` // 已移除:硬件资源使用率监控\nMemoryUsage float64 `json:\"memoryUsage\"` // 已移除:硬件资源使用率监控\nDiskUsage float64 `json:\"diskUsage\"` // 已移除:硬件资源使用率监控", "allOf": [ { "$ref": "#/definitions/user.TrafficData" } ] } } }, "user.MemorySpecResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "sizeMB": { "type": "integer" } } }, "user.ResetInstancePasswordRequest": { "type": "object" }, "user.ResetInstancePasswordResponse": { "type": "object", "properties": { "taskId": { "type": "integer" } } }, "user.ResetPasswordRequest": { "type": "object" }, "user.SystemImageResponse": { "type": "object", "properties": { "architecture": { "type": "string" }, "description": { "type": "string" }, "displayName": { "type": "string" }, "id": { "type": "integer" }, "imageUrl": { "type": "string" }, "instanceType": { "type": "string" }, "isActive": { "type": "boolean" }, "minDiskMB": { "type": "integer" }, "minMemoryMB": { "type": "integer" }, "name": { "type": "string" }, "osType": { "type": "string" }, "providerType": { "type": "string" }, "useCdn": { "type": "boolean" }, "version": { "type": "string" } } }, "user.TrafficData": { "type": "object", "properties": { "currentMonth": { "description": "当月已使用流量(MB)", "type": "integer" }, "history": { "description": "历史流量数据", "type": "array", "items": { "$ref": "#/definitions/user.TrafficHistoryItem" } }, "isLimited": { "description": "是否因流量超限被限制", "type": "boolean" }, "limitReason": { "description": "流量限制原因描述", "type": "string" }, "limitType": { "description": "流量限制类型: user, provider, both, unknown", "type": "string" }, "totalLimit": { "description": "流量限制(MB)", "type": "integer" }, "usagePercent": { "description": "使用百分比", "type": "number" }, "visible": { "description": "用户侧是否显示流量额度与用量", "type": "boolean" } } }, "user.TrafficHistoryItem": { "type": "object", "properties": { "lastSync": { "description": "最后同步时间", "type": "string" }, "month": { "description": "月份", "type": "integer" }, "totalUsed": { "description": "总使用流量(MB)", "type": "integer" }, "trafficIn": { "description": "入站流量(MB)", "type": "integer" }, "trafficOut": { "description": "出站流量(MB)", "type": "integer" }, "year": { "description": "年份", "type": "integer" } } }, "user.UpdateProfileRequest": { "type": "object", "properties": { "email": { "type": "string" }, "nickname": { "type": "string", "maxLength": 50 }, "phone": { "type": "string" }, "telegram": { "type": "string" } } }, "user.UserInstanceDetailResponse": { "type": "object", "properties": { "bandwidth": { "type": "integer" }, "cpu": { "type": "integer" }, "createdAt": { "type": "string" }, "disk": { "type": "integer" }, "expiresAt": { "description": "实例过期时间", "type": "string" }, "frozenReason": { "type": "string" }, "hasSshMapping": { "description": "是否有可用的SSH端口映射(支持Web SSH连接)", "type": "boolean" }, "id": { "type": "integer" }, "image": { "description": "当前使用的镜像名称", "type": "string" }, "instance_type": { "description": "实例类型:container, vm", "type": "string" }, "ipv4MappingType": { "description": "IPv4映射类型:nat(NAT共享IP), dedicated(独立IPv4地址) (已弃用,保留向后兼容)", "type": "string" }, "ipv6Address": { "description": "内网IPv6地址", "type": "string" }, "isFrozen": { "type": "boolean" }, "memory": { "type": "integer" }, "name": { "type": "string" }, "networkType": { "description": "网络配置类型:nat_ipv4, nat_ipv4_ipv6, dedicated_ipv4, dedicated_ipv4_ipv6, ipv6_only", "type": "string" }, "osType": { "type": "string" }, "password": { "type": "string" }, "portRangeEnd": { "description": "端口范围结束", "type": "integer" }, "portRangeStart": { "description": "端口范围起始", "type": "integer" }, "privateIP": { "description": "内网IPv4地址", "type": "string" }, "providerName": { "type": "string" }, "providerStatus": { "description": "Provider状态:active, inactive, partial", "type": "string" }, "providerType": { "description": "Provider虚拟化类型:docker, lxd, incus, proxmox", "type": "string" }, "provider_id": { "description": "Provider ID", "type": "integer" }, "publicIP": { "description": "公网IPv4地址", "type": "string" }, "publicIPv6": { "description": "公网IPv6地址", "type": "string" }, "relatedTask": { "description": "关联任务信息", "allOf": [ { "$ref": "#/definitions/user.UserTaskResponse" } ] }, "sshPort": { "type": "integer" }, "status": { "type": "string" }, "trafficLimitReason": { "description": "实例流量限制原因", "type": "string" }, "trafficLimited": { "description": "实例是否因流量限制", "type": "boolean" }, "trafficOperationLockLevel": { "description": "锁定层级:instance/user/provider", "type": "string" }, "trafficOperationLockMessage": { "description": "锁定提示", "type": "string" }, "trafficOperationLocked": { "description": "是否因实例/用户/节点流量超限锁定普通用户操作", "type": "boolean" }, "trafficQuotaVisible": { "description": "流量配额显示", "type": "boolean" }, "type": { "type": "string" }, "username": { "type": "string" } } }, "user.UserLimitsResponse": { "type": "object", "properties": { "containerCount": { "description": "容器数量", "type": "integer" }, "level": { "type": "integer" }, "maxBandwidth": { "description": "最大带宽(Mbps)", "type": "integer" }, "maxCpu": { "description": "最大CPU核心数", "type": "integer" }, "maxDisk": { "description": "最大磁盘(MB)", "type": "integer" }, "maxInstances": { "type": "integer" }, "maxMemory": { "description": "最大内存(MB)", "type": "integer" }, "maxSnapshots": { "description": "当前实例可用快照总槽位", "type": "integer" }, "maxSnapshotsPerInstance": { "description": "每个实例允许保留的快照数", "type": "integer" }, "maxTraffic": { "description": "最大流量(MB)", "type": "integer" }, "remainingSnapshots": { "description": "剩余快照槽位", "type": "integer" }, "usedBandwidth": { "description": "已使用带宽(Mbps)", "type": "integer" }, "usedCpu": { "description": "已使用CPU核心数", "type": "integer" }, "usedDisk": { "description": "已使用磁盘(MB)", "type": "integer" }, "usedInstances": { "type": "integer" }, "usedMemory": { "description": "已使用内存(MB)", "type": "integer" }, "usedSnapshots": { "description": "已使用快照数量", "type": "integer" }, "usedTraffic": { "description": "已使用流量(MB)", "type": "integer" }, "vmCount": { "description": "虚拟机数量", "type": "integer" } } }, "user.UserTaskResponse": { "type": "object", "properties": { "canCancel": { "description": "是否可以取消", "type": "boolean" }, "cancelReason": { "description": "取消原因", "type": "string" }, "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "errorMessage": { "type": "string" }, "estimatedWaitTime": { "description": "预计等待时间(秒)", "type": "integer" }, "id": { "type": "integer" }, "instanceId": { "type": "integer" }, "instanceName": { "type": "string" }, "instanceType": { "description": "实例类型:container 或 vm", "type": "string" }, "isForceStoppable": { "description": "是否允许强制停止", "type": "boolean" }, "preallocatedBandwidth": { "description": "预分配的带宽(Mbps)", "type": "integer" }, "preallocatedCpu": { "description": "预分配的实例配置信息", "type": "integer" }, "preallocatedDisk": { "description": "预分配的磁盘(MB)", "type": "integer" }, "preallocatedMemory": { "description": "预分配的内存(MB)", "type": "integer" }, "progress": { "type": "integer" }, "progressLogs": { "description": "进度日志(JSON数组)", "type": "string" }, "providerId": { "type": "integer" }, "providerName": { "type": "string" }, "queuePosition": { "description": "排队信息", "type": "integer" }, "remainingTime": { "description": "剩余时间(秒)", "type": "integer" }, "startedAt": { "type": "string" }, "status": { "type": "string" }, "statusMessage": { "description": "状态描述", "type": "string" }, "taskType": { "type": "string" }, "timeoutDuration": { "description": "超时时间(秒)", "type": "integer" }, "updatedAt": { "type": "string" }, "uuid": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }