[PR #452] [MERGED] Refactor nextid & GuestID.Exists() #482

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

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/452
Author: @Tinyblargon
Created: 8/22/2025
Status: Merged
Merged: 8/22/2025
Merged by: @Tinyblargon

Base: masterHead: refactor-nextid


📝 Commits (4)

  • 337c339 fix: id always tested as invalid
  • 549ae4d feat: pass function for ignoring errors
  • 0dab40e refactor: GetNextID optimization
  • 82ed316 refactor: GuestID.Exists() optimization

📊 Changes

8 files changed (+94 additions, -45 deletions)

View changed files

📝 cli/validate.go (+1 -1)
📝 proxmox/client.go (+54 -22)
📝 proxmox/config__guest.go (+22 -13)
📝 proxmox/config__lxc__new.go (+1 -1)
📝 proxmox/config__lxc__new_test.go (+2 -2)
📝 proxmox/config__qemu.go (+1 -1)
📝 proxmox/data__qemu__agent.go (+11 -3)
📝 proxmox/vmref.go (+2 -2)

📄 Description

  • Optimized GetNextID(), using a loop instead of recursion.
  • GuestID.Exists() now checks if a specific error was returned when checking if an ID is in use. Instead of getting the list of all Guests and parsing it.

🔄 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/452 **Author:** [@Tinyblargon](https://github.com/Tinyblargon) **Created:** 8/22/2025 **Status:** ✅ Merged **Merged:** 8/22/2025 **Merged by:** [@Tinyblargon](https://github.com/Tinyblargon) **Base:** `master` ← **Head:** `refactor-nextid` --- ### 📝 Commits (4) - [`337c339`](https://github.com/Telmate/proxmox-api-go/commit/337c3395da9966ef60ee9ad155ecfb417730476e) fix: id always tested as invalid - [`549ae4d`](https://github.com/Telmate/proxmox-api-go/commit/549ae4db9318b50b58dbb66000a5b7988586f130) feat: pass function for ignoring errors - [`0dab40e`](https://github.com/Telmate/proxmox-api-go/commit/0dab40ec5c7cd4df1f73e8030877e85067676f8f) refactor: GetNextID optimization - [`82ed316`](https://github.com/Telmate/proxmox-api-go/commit/82ed3168ce5a50bdddc33b7cbb3a08a22235fe44) refactor: GuestID.Exists() optimization ### 📊 Changes **8 files changed** (+94 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `cli/validate.go` (+1 -1) 📝 `proxmox/client.go` (+54 -22) 📝 `proxmox/config__guest.go` (+22 -13) 📝 `proxmox/config__lxc__new.go` (+1 -1) 📝 `proxmox/config__lxc__new_test.go` (+2 -2) 📝 `proxmox/config__qemu.go` (+1 -1) 📝 `proxmox/data__qemu__agent.go` (+11 -3) 📝 `proxmox/vmref.go` (+2 -2) </details> ### 📄 Description - Optimized GetNextID(), using a loop instead of recursion. - `GuestID.Exists()` now checks if a specific error was returned when checking if an ID is in use. Instead of getting the list of all Guests and parsing it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:42:22 +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#482
No description provided.