[PR #157] [MERGED] Add function CheckID #182

Closed
opened 2026-03-03 15:30:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/luthermonson/go-proxmox/pull/157
Author: @rybnico
Created: 8/29/2024
Status: Merged
Merged: 8/30/2024
Merged by: @luthermonson

Base: mainHead: is-vmid-taken


📝 Commits (2)

  • 9a5d4d2 Add function IsVMIDTaken
  • 58a6719 Rename IsVMIDTaken to CheckID and invert logic

📊 Changes

3 files changed (+45 additions, -1 deletions)

View changed files

📝 cluster.go (+16 -0)
📝 cluster_test.go (+16 -0)
📝 tests/mocks/pve7x/cluster.go (+13 -1)

📄 Description

The Proxmox API endpoint /cluster/nextid takes an optional argument vmid to check if the given ID is free.
This argument is not implemented in the existing NextID function. In order not to break the existing API, I have added a new function isVMIDTaken.
This is especially useful if you want to check for a VMID without having VM.Audit privileges on the whole cluster.


🔄 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/luthermonson/go-proxmox/pull/157 **Author:** [@rybnico](https://github.com/rybnico) **Created:** 8/29/2024 **Status:** ✅ Merged **Merged:** 8/30/2024 **Merged by:** [@luthermonson](https://github.com/luthermonson) **Base:** `main` ← **Head:** `is-vmid-taken` --- ### 📝 Commits (2) - [`9a5d4d2`](https://github.com/luthermonson/go-proxmox/commit/9a5d4d2e2bcd3dbb8eff0be3c0bb36af88e99a82) Add function IsVMIDTaken - [`58a6719`](https://github.com/luthermonson/go-proxmox/commit/58a6719e70f90769e95826604e0f3b28c115f5b4) Rename IsVMIDTaken to CheckID and invert logic ### 📊 Changes **3 files changed** (+45 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `cluster.go` (+16 -0) 📝 `cluster_test.go` (+16 -0) 📝 `tests/mocks/pve7x/cluster.go` (+13 -1) </details> ### 📄 Description The Proxmox API endpoint `/cluster/nextid` takes an optional argument `vmid` to check if the given ID is free. This argument is not implemented in the existing `NextID` function. In order not to break the existing API, I have added a new function `isVMIDTaken`. This is especially useful if you want to check for a VMID without having `VM.Audit` privileges on the whole cluster. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 15:30:35 +03:00
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#182
No description provided.