[GH-ISSUE #198] PID field in VirtualMachine should support nill values #52

Open
opened 2026-03-03 15:29:54 +03:00 by kerem · 0 comments
Owner

Originally created by @hsiegeln on GitHub (Jun 6, 2025).
Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/198

VM Templates retrieved via the /api2/json/nodes/{node}/qemu endpoint will have null for the pid field. The current implementation throws an error when a template is returned: 2025/06/06 13:58:33 failed to match ^[0-9.]*$: null

Template:

        {
            "pid": null,
            "status": "stopped",
            "maxdisk": 34359738368,
            "diskread": 0,
            "diskwrite": 0,
            "cpu": 0,
            "uptime": 0,
            "template": 1,
            "mem": 0,
            "maxmem": 2147483648,
            "disk": 0,
            "name": "ubuntu24",
            "netout": 0,
            "cpus": 1,
            "netin": 0,
            "vmid": "113"
        }

Regular VM:

        {
            "vmid": "140",
            "netin": 6124487532,
            "cpus": 4,
            "netout": 414087827,
            "name": "os0107",
            "mem": 3007004179,
            "maxmem": 17179869184,
            "disk": 0,
            "template": "",
            "uptime": 16600781,
            "cpu": 0.0099720556493484,
            "diskwrite": 0,
            "diskread": 0,
            "pid": "14558",
            "maxdisk": 119185342464,
            "status": "running"
        }
Originally created by @hsiegeln on GitHub (Jun 6, 2025). Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/198 VM Templates retrieved via the `/api2/json/nodes/{node}/qemu` endpoint will have null for the pid field. The current implementation throws an error when a template is returned: `2025/06/06 13:58:33 failed to match ^[0-9.]*$: null` Template: ``` { "pid": null, "status": "stopped", "maxdisk": 34359738368, "diskread": 0, "diskwrite": 0, "cpu": 0, "uptime": 0, "template": 1, "mem": 0, "maxmem": 2147483648, "disk": 0, "name": "ubuntu24", "netout": 0, "cpus": 1, "netin": 0, "vmid": "113" } ``` Regular VM: ``` { "vmid": "140", "netin": 6124487532, "cpus": 4, "netout": 414087827, "name": "os0107", "mem": 3007004179, "maxmem": 17179869184, "disk": 0, "template": "", "uptime": 16600781, "cpu": 0.0099720556493484, "diskwrite": 0, "diskread": 0, "pid": "14558", "maxdisk": 119185342464, "status": "running" } ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-proxmox#52
No description provided.