-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic backup logic #133
Basic backup logic #133
Conversation
vzdump api call
struct tag fix
replace vzdump method based on proxmox ve api
func (n *Node) Vzdump(ctx context.Context, params *VirtualMachineBackupOptions) (task *Task, err error) { | ||
var upid UPID | ||
|
||
if params == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API docs read like all params are optional https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/vzdump
you sure you dont want to allow nil params? I haven't tested this but it reads like empty post data should still create a backup with some form of defaults. maybe confirm and let's drop the check?
types.go
Outdated
ModeType = string | ||
CompressType = string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are already types and "mode" and "compress" are pretty generic and these are specific for the vzdump params. maybe better if you do VirtualMachineBackupMode
and VirtualMachineBackupCompress
Mode ModeType `json:"mode,omitempty"` | ||
Compress CompressType `json:"compress,omitempty"` | ||
Notes string `json:"notes,omitempty"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really one to talk here as I've definitely not finished param types before but if you could finish the params for this one I would appreciate it as it's an important feature and we should probably do it the first time. https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/vzdump note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will finish it
review comment fixes
Add all params for vzdump API call and change enum types. |
This is great! Thanks for the contribution |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
==========================================
+ Coverage 25.95% 26.96% +1.00%
==========================================
Files 15 15
Lines 1753 1962 +209
==========================================
+ Hits 455 529 +74
- Misses 1278 1399 +121
- Partials 20 34 +14 ☔ View full report in Codecov by Sentry. |
Vzdump API call for backups