mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-26 19:11:08 +01:00
feat(proxmox): support node-level routes and journalctl access
This change enables Proxmox node-level operations without requiring a specific
LXC container VMID.
**Features added:**
- New `/proxmox/journalctl/{node}` API endpoint for streaming node journalctl
- Route configuration support for Proxmox nodes (VMID = 0)
- `ReverseLookupNode` function for node discovery by hostname/IP/alias
- `NodeJournalctl` method for executing journalctl on nodes
**Behavior changes:**
- VMID parameter in journalctl endpoints is now optional
- Routes targeting nodes (without specific containers) are now valid
**Bug fixes:**
- Fixed error message variable reference in route validation
This commit is contained in:
@@ -2077,9 +2077,9 @@
|
||||
"operationId": "uptime"
|
||||
}
|
||||
},
|
||||
"/proxmox/journalctl/{node}/{vmid}": {
|
||||
"/proxmox/journalctl/{node}": {
|
||||
"get": {
|
||||
"description": "Get journalctl output",
|
||||
"description": "Get journalctl output for node or LXC container. If vmid is not provided, streams node journalctl.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -2094,19 +2094,85 @@
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Node name",
|
||||
"name": "node",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "vmid",
|
||||
"description": "Limit output lines (1-1000)",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Journalctl output",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ErrorResponse"
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Node not found",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ErrorResponse"
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-id": "journalctl",
|
||||
"operationId": "journalctl"
|
||||
}
|
||||
},
|
||||
"/proxmox/journalctl/{node}/{vmid}": {
|
||||
"get": {
|
||||
"description": "Get journalctl output for node or LXC container. If vmid is not provided, streams node journalctl.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"proxmox",
|
||||
"websocket"
|
||||
],
|
||||
"summary": "Get journalctl output",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Node name",
|
||||
"name": "node",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "limit",
|
||||
"description": "Container VMID (optional - if not provided, streams node journalctl)",
|
||||
"name": "vmid",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Limit output lines (1-1000)",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
}
|
||||
@@ -2149,7 +2215,7 @@
|
||||
},
|
||||
"/proxmox/journalctl/{node}/{vmid}/{service}": {
|
||||
"get": {
|
||||
"description": "Get journalctl output",
|
||||
"description": "Get journalctl output for node or LXC container. If vmid is not provided, streams node journalctl.",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
@@ -2164,24 +2230,26 @@
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Node name",
|
||||
"name": "node",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "Container VMID (optional - if not provided, streams node journalctl)",
|
||||
"name": "vmid",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Service name (e.g., 'pveproxy' for node, 'container@.service' format for LXC)",
|
||||
"name": "service",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "vmid",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "limit",
|
||||
"description": "Limit output lines (1-1000)",
|
||||
"name": "limit",
|
||||
"in": "query"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user