-
Notifications
You must be signed in to change notification settings - Fork 39
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
Changes from 6 commits
a53a116
51986f5
9ec5fe0
1c60063
50b62d3
c63ed1a
ff0cfce
a904ff2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1242,3 +1242,29 @@ type FirewallIPSet struct { | |
Digest string `json:"digest,omitempty"` | ||
Comment string `json:"comment,omitempty"` | ||
} | ||
|
||
type ( | ||
ModeType = string | ||
CompressType = string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
) | ||
|
||
const ( | ||
ModeSnapshot = ModeType("snapshot") | ||
ModeSuspend = ModeType("suspend") | ||
ModeStop = ModeType("stop") | ||
|
||
CompressZero = CompressType("0") | ||
CompressOne = CompressType("1") | ||
CompressGzip = CompressType("gzip") | ||
CompressLzo = CompressType("lzo") | ||
CompressZstd = CompressType("zstd") | ||
) | ||
|
||
type VirtualMachineBackupOptions struct { | ||
VMID uint64 `json:"vmid"` | ||
Storage string `json:"storage"` | ||
Remove int `json:"remove,omitempty"` | ||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I will finish it |
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?