[PR #40] [MERGED] Rewrite Clone and MoveDisk qemu calls to support all endpoint parameters #94

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

📋 Pull Request Information

Original PR: https://github.com/luthermonson/go-proxmox/pull/40
Author: @jqueuniet
Created: 1/13/2023
Status: Merged
Merged: 1/13/2023
Merged by: @luthermonson

Base: mainHead: rewrite_args_clone_movedisk


📝 Commits (2)

  • ff34b9a Rewrite clone and movedisk qemu calls to support all parameters
  • 9505503 Naming conventions

📊 Changes

2 files changed (+51 additions, -18 deletions)

View changed files

📝 types.go (+25 -0)
📝 virtual_machines.go (+26 -18)

📄 Description

I tried implementing the full range of parameters supported by those calls while I was at it.

For Clone, I kept newid exclusively in the Options structure in the end, since an implicit call to NextID as the default behavior makes sense and simplifies client usage in most cases.

For MoveDisk, I'm a bit torn on what to do with disk since it is mandatory but is also part of the JSON payload so I need it in the Options struct anyway. The current implementation now has two way to pass this information, either through the arg, or through the Options struct if the disk arg is empty. I could also systematically overwrite the struct value with the arg even when empty, or drop the arg altogether, which would make the struct mandatory in practice.


🔄 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/40 **Author:** [@jqueuniet](https://github.com/jqueuniet) **Created:** 1/13/2023 **Status:** ✅ Merged **Merged:** 1/13/2023 **Merged by:** [@luthermonson](https://github.com/luthermonson) **Base:** `main` ← **Head:** `rewrite_args_clone_movedisk` --- ### 📝 Commits (2) - [`ff34b9a`](https://github.com/luthermonson/go-proxmox/commit/ff34b9abc48f7312f89ef774304d441619fc945e) Rewrite clone and movedisk qemu calls to support all parameters - [`9505503`](https://github.com/luthermonson/go-proxmox/commit/950550316a7f791565c8f1a8b0eba65ca8451712) Naming conventions ### 📊 Changes **2 files changed** (+51 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `types.go` (+25 -0) 📝 `virtual_machines.go` (+26 -18) </details> ### 📄 Description I tried implementing the full range of parameters supported by those calls while I was at it. For `Clone`, I kept newid exclusively in the Options structure in the end, since an implicit call to NextID as the default behavior makes sense and simplifies client usage in most cases. For `MoveDisk`, I'm a bit torn on what to do with `disk` since it is mandatory but is also part of the JSON payload so I need it in the Options struct anyway. The current implementation now has two way to pass this information, either through the arg, or through the Options struct if the `disk` arg is empty. I could also systematically overwrite the struct value with the arg even when empty, or drop the arg altogether, which would make the struct mandatory in practice. --- <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:10 +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#94
No description provided.