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:
yusing
2026-01-25 13:04:09 +08:00
parent 09ddb925a3
commit 57a2ca26db
7 changed files with 263 additions and 84 deletions

View File

@@ -3361,21 +3361,67 @@ paths:
- metrics
- websocket
x-id: uptime
/proxmox/journalctl/{node}:
get:
consumes:
- application/json
description: Get journalctl output for node or LXC container. If vmid is not
provided, streams node journalctl.
parameters:
- description: Node name
in: path
name: node
required: true
type: string
- description: Limit output lines (1-1000)
in: query
name: limit
type: integer
produces:
- application/json
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'
summary: Get journalctl output
tags:
- proxmox
- websocket
x-id: journalctl
/proxmox/journalctl/{node}/{vmid}:
get:
consumes:
- application/json
description: Get journalctl output
description: Get journalctl output for node or LXC container. If vmid is not
provided, streams node journalctl.
parameters:
- in: path
- description: Node name
in: path
name: node
required: true
type: string
- in: path
- description: Container VMID (optional - if not provided, streams node journalctl)
in: path
name: vmid
required: true
type: integer
- description: limit
- description: Limit output lines (1-1000)
in: query
name: limit
type: integer
@@ -3411,20 +3457,24 @@ paths:
get:
consumes:
- application/json
description: Get journalctl output
description: Get journalctl output for node or LXC container. If vmid is not
provided, streams node journalctl.
parameters:
- in: path
- description: Node name
in: path
name: node
required: true
type: string
- in: path
- description: Container VMID (optional - if not provided, streams node journalctl)
in: path
name: vmid
type: integer
- description: Service name (e.g., 'pveproxy' for node, 'container@.service'
format for LXC)
in: path
name: service
type: string
- in: path
name: vmid
required: true
type: integer
- description: limit
- description: Limit output lines (1-1000)
in: query
name: limit
type: integer