[PR #514] [CLOSED] migrate: cli vminfo #517

Closed
opened 2026-02-28 00:42:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/514
Author: @NemoDacremont
Created: 11/10/2025
Status: Closed

Base: masterHead: migrate/cli-vminfo


📝 Commits (4)

  • 0a4f9f5 feat: add NewVmRefFromApi to create coherent VmRef from GuestID
  • ccab543 migrate: vminfo in the new cli
  • 270a9ea Revert "feat: add NewVmRefFromApi to create coherent VmRef from GuestID"
  • 1ba95b2 fix: use client.CheckVmRef instead of introducing new functions

📊 Changes

2 files changed (+25 additions, -0 deletions)

View changed files

cli/command/get/get-vminfo.go (+18 -0)
📝 cli/command/get/get.go (+7 -0)

📄 Description

Changes

Add get vminfo to the new cli, I had to add NewVmRefFromApi in order to properly get the guest information from API only with the Id.

list of changes :

  • Add get vminfo to the new cli
  • Add sdk.NewVmRefFromApi to create a new VmRef with all information from API only with the VmId

Test

This changes can be tested by creating a vm and then retrieving the info with proxmox-api-go get vminfo <id>, here is a snippet that should do the work :

cat << EOF > qemu.json
{
    "name": "test-qemu01",
    "bios": "seabios",
    "tablet": true,
    "memory": {
        "capacity": 2048
    },
    "ostype": "l26",
    "sockets": 1,
    "cpu": {
        "type": "host",
        "cores": 1
    },
    "numa": false,
    "kvm": true,
    "hotplug": "network,disk,usb",
    "boot": "order=ide2;net0",
    "scsihw": "virtio-scsi-pci",
    "network": {
        "0": {
            "bridge": "vmbr0",
            "firewall": true,
            "id": 0,
            "macaddr": "B6:8F:9D:7C:8F:BC",
            "model": "virtio"
        }
    }
}
EOF
NEW_CLI=true ./proxmox-api-go -i create guest qemu -f qemu.json 123 pve
NEW_CLI=true ./proxmox-api-go -i get vminfo 123

It should show :

{
  "id": 123,
  "node": "pve",
  "bios": "seabios",
  "boot": "order=ide2;net0",
  "cpu": {
    "cores": 1,
    "type": "host"
  },
  "description": "",
  "hotplug": "network,disk,usb",
  "memory": {
    "capacity": 2048
  },
  "name": "test-qemu01",
  "protection": false,
  "kvm": true,
  "ostype": "l26",
  "scsihw": "virtio-scsi-pci",
  "smbios1": "uuid=4cad0e7e-046b-4776-aa8d-9985e295f1b0",
  "tablet": true
}

fixes #513


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/514 **Author:** [@NemoDacremont](https://github.com/NemoDacremont) **Created:** 11/10/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `migrate/cli-vminfo` --- ### 📝 Commits (4) - [`0a4f9f5`](https://github.com/Telmate/proxmox-api-go/commit/0a4f9f52cee67acf5233e18ccb9b7af678f89c71) feat: add NewVmRefFromApi to create coherent VmRef from GuestID - [`ccab543`](https://github.com/Telmate/proxmox-api-go/commit/ccab5431ef35d749dd707464c3cb86c61076889b) migrate: vminfo in the new cli - [`270a9ea`](https://github.com/Telmate/proxmox-api-go/commit/270a9ea754cad05ccbd379ee6ecb88921942957c) Revert "feat: add NewVmRefFromApi to create coherent VmRef from GuestID" - [`1ba95b2`](https://github.com/Telmate/proxmox-api-go/commit/1ba95b2c9d653a90c4f8a820036ff083c77532f9) fix: use client.CheckVmRef instead of introducing new functions ### 📊 Changes **2 files changed** (+25 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `cli/command/get/get-vminfo.go` (+18 -0) 📝 `cli/command/get/get.go` (+7 -0) </details> ### 📄 Description ## Changes Add `get vminfo` to the new cli, I had to add `NewVmRefFromApi` in order to properly get the guest information from API only with the Id. list of changes : * Add `get vminfo` to the new cli * Add `sdk.NewVmRefFromApi` to create a new VmRef with all information from API only with the VmId ## Test This changes can be tested by creating a vm and then retrieving the info with `proxmox-api-go get vminfo <id>`, here is a snippet that should do the work : ```sh cat << EOF > qemu.json { "name": "test-qemu01", "bios": "seabios", "tablet": true, "memory": { "capacity": 2048 }, "ostype": "l26", "sockets": 1, "cpu": { "type": "host", "cores": 1 }, "numa": false, "kvm": true, "hotplug": "network,disk,usb", "boot": "order=ide2;net0", "scsihw": "virtio-scsi-pci", "network": { "0": { "bridge": "vmbr0", "firewall": true, "id": 0, "macaddr": "B6:8F:9D:7C:8F:BC", "model": "virtio" } } } EOF NEW_CLI=true ./proxmox-api-go -i create guest qemu -f qemu.json 123 pve NEW_CLI=true ./proxmox-api-go -i get vminfo 123 ``` It should show : ```json { "id": 123, "node": "pve", "bios": "seabios", "boot": "order=ide2;net0", "cpu": { "cores": 1, "type": "host" }, "description": "", "hotplug": "network,disk,usb", "memory": { "capacity": 2048 }, "name": "test-qemu01", "protection": false, "kvm": true, "ostype": "l26", "scsihw": "virtio-scsi-pci", "smbios1": "uuid=4cad0e7e-046b-4776-aa8d-9985e295f1b0", "tablet": true } ``` fixes #513 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem closed this issue 2026-02-28 00:42:30 +03:00
Sign in to join this conversation.
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/proxmox-api-go#517
No description provided.