-
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 all 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,58 @@ type FirewallIPSet struct { | |
Digest string `json:"digest,omitempty"` | ||
Comment string `json:"comment,omitempty"` | ||
} | ||
|
||
type ( | ||
VirtualMachineBackupMode = string | ||
VirtualMachineBackupCompress = string | ||
VirtualMachineBackupNotificationPolicy = string | ||
) | ||
|
||
const ( | ||
VirtualMachineBackupModeSnapshot = VirtualMachineBackupMode("snapshot") | ||
VirtualMachineBackupModeSuspend = VirtualMachineBackupMode("suspend") | ||
VirtualMachineBackupModeStop = VirtualMachineBackupMode("stop") | ||
|
||
VirtualMachineBackupCompressZero = VirtualMachineBackupCompress("0") | ||
VirtualMachineBackupCompressOne = VirtualMachineBackupCompress("1") | ||
VirtualMachineBackupCompressGzip = VirtualMachineBackupCompress("gzip") | ||
VirtualMachineBackupCompressLzo = VirtualMachineBackupCompress("lzo") | ||
VirtualMachineBackupCompressZstd = VirtualMachineBackupCompress("zstd") | ||
|
||
VirtualMachineBackupNotificationPolicyAlways = VirtualMachineBackupNotificationPolicy("always") | ||
VirtualMachineBackupNotificationPolicyFailure = VirtualMachineBackupNotificationPolicy("failure") | ||
VirtualMachineBackupNotificationPolicyNever = VirtualMachineBackupNotificationPolicy("never") | ||
) | ||
|
||
type VirtualMachineBackupOptions struct { | ||
All bool `json:"all,omitempty"` | ||
BwLimit uint `json:"bwlimit,omitempty"` | ||
Compress VirtualMachineBackupCompress `json:"compress,omitempty"` | ||
DumpDir string `json:"dumpDir,omitempty"` | ||
Exclude string `json:"exclude,omitempty"` | ||
ExcludePath []string `json:"exclude-path,omitempty"` | ||
IoNice uint `json:"ionice,omitempty"` | ||
LockWait uint `json:"lockwait,omitempty"` | ||
MailTo string `json:"mailto,omitempty"` | ||
Mode VirtualMachineBackupMode `json:"mode,omitempty"` | ||
Node string `json:"node,omitempty"` | ||
NotesTemplate string `json:"notes-template,omitempty"` | ||
NotificationPolicy VirtualMachineBackupNotificationPolicy `json:"notification-policy,omitempty"` | ||
NotificationTarget string `json:"notification-target,omitempty"` | ||
Performance string `json:"performance,omitempty"` | ||
Pigz int `json:"pigz,omitempty"` | ||
Pool string `json:"pool,omitempty"` | ||
Protected string `json:"protected,omitempty"` | ||
PruneBackups string `json:"prune-backups,omitempty"` | ||
Quiet bool `json:"quiet,omitempty"` | ||
Remove bool `json:"remove,omitempty"` | ||
Script string `json:"script,omitempty"` | ||
StdExcludes bool `json:"stdexcludes,omitempty"` | ||
StdOut bool `json:"stdout,omitempty"` | ||
Stop bool `json:"stop,omitempty"` | ||
StopWait uint `json:"stopwait,omitempty"` | ||
Storage string `json:"storage,omitempty"` | ||
TmpDir string `json:"tmpdir,omitempty"` | ||
VMID uint64 `json:"vmid,omitempty"` | ||
Zstd uint `json:"zstd,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?