622 lines
13 KiB
JSON
622 lines
13 KiB
JSON
{
|
|
"openapi": "3.1.0",
|
|
"info": {
|
|
"title": "VPS-Commander",
|
|
"version": "1.1.0"
|
|
},
|
|
"servers": [
|
|
{
|
|
"url": "https://vpstool.kory.kdns.fr"
|
|
}
|
|
],
|
|
"components": {
|
|
"securitySchemes": {
|
|
"bearerAuth": {
|
|
"type": "http",
|
|
"scheme": "bearer"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"Device": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"is_local": {
|
|
"type": "boolean"
|
|
},
|
|
"arch": {
|
|
"type": "string"
|
|
},
|
|
"os": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ExecRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"command"
|
|
],
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"command": {
|
|
"type": "string"
|
|
},
|
|
"workdir": {
|
|
"type": "string"
|
|
},
|
|
"timeout": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"ExecResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"exit_code": {
|
|
"type": "integer"
|
|
},
|
|
"stdout": {
|
|
"type": "string"
|
|
},
|
|
"stderr": {
|
|
"type": "string"
|
|
},
|
|
"duration_ms": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"FileReadRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"path"
|
|
],
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"offset": {
|
|
"type": "integer"
|
|
},
|
|
"limit": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"FileReadResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"offset": {
|
|
"type": "integer"
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
},
|
|
"bytes": {
|
|
"type": "integer"
|
|
},
|
|
"eof": {
|
|
"type": "boolean"
|
|
},
|
|
"total_size": {
|
|
"type": "integer"
|
|
},
|
|
"has_more": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"FileWriteRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"path",
|
|
"content"
|
|
],
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"FileWriteResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"path": {
|
|
"type": "string"
|
|
},
|
|
"bytes": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"MCPService": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"transport": {
|
|
"type": "string"
|
|
},
|
|
"command": {
|
|
"type": "string"
|
|
},
|
|
"args_json": {
|
|
"type": "string"
|
|
},
|
|
"env_json": {
|
|
"type": "string"
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"headers_json": {
|
|
"type": "string"
|
|
},
|
|
"scope": {
|
|
"type": "string"
|
|
},
|
|
"target_nodes_json": {
|
|
"type": "string"
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"MCPCallRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"device",
|
|
"server",
|
|
"tool"
|
|
],
|
|
"properties": {
|
|
"device": {
|
|
"type": "string"
|
|
},
|
|
"server": {
|
|
"type": "string"
|
|
},
|
|
"tool": {
|
|
"type": "string"
|
|
},
|
|
"arguments": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"paths": {
|
|
"/api/v1/devices": {
|
|
"get": {
|
|
"operationId": "list_devices",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Devices",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Device"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/exec": {
|
|
"post": {
|
|
"operationId": "exec_command",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ExecRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Execution result",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ExecResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/file/read": {
|
|
"post": {
|
|
"operationId": "read_file",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/FileReadRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "File content",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/FileReadResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/file/write": {
|
|
"post": {
|
|
"operationId": "write_file",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/FileWriteRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Write result",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/FileWriteResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/mcp/services": {
|
|
"get": {
|
|
"operationId": "list_mcp_services",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "MCP services",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/MCPService"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"operationId": "save_mcp_service",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MCPService"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Saved MCP service"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/mcp/service": {
|
|
"delete": {
|
|
"operationId": "delete_mcp_service",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/mcp/list": {
|
|
"get": {
|
|
"operationId": "list_agent_mcp",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "device",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Mounted MCP services"
|
|
},
|
|
"409": {
|
|
"description": "Device offline"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/mcp/call": {
|
|
"post": {
|
|
"operationId": "call_agent_mcp",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/MCPCallRequest"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "MCP result"
|
|
},
|
|
"409": {
|
|
"description": "Device offline"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/security/settings": {
|
|
"get": {
|
|
"summary": "Get security policy",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Current global and per-node security policy"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/security/settings/update": {
|
|
"post": {
|
|
"summary": "Update security policy",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"global": {
|
|
"type": "string",
|
|
"enum": [
|
|
"low",
|
|
"medium",
|
|
"high"
|
|
]
|
|
},
|
|
"node": {
|
|
"type": "string"
|
|
},
|
|
"mode": {
|
|
"type": "string",
|
|
"enum": [
|
|
"inherit",
|
|
"low",
|
|
"medium",
|
|
"high"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/notifications/webhooks": {
|
|
"get": {
|
|
"summary": "List webhook targets",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/notifications/webhook/update": {
|
|
"post": {
|
|
"summary": "Create or update webhook target",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"type",
|
|
"url"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"generic",
|
|
"telegram",
|
|
"wecom"
|
|
]
|
|
},
|
|
"url": {
|
|
"type": "string"
|
|
},
|
|
"config_json": {
|
|
"type": "string"
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/notifications/webhook/delete": {
|
|
"delete": {
|
|
"summary": "Delete webhook target",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/notifications/webhook/test": {
|
|
"post": {
|
|
"summary": "Send webhook test message",
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|