backup

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c HTTPClient) *Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

Create Create new vzdump backup job.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)

Delete Delete vzdump backup job definition.

func (*Client) Find

func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)

Find Read vzdump backup job definition.

func (*Client) GetVolumeBackupIncludedIncludedVolumes

GetVolumeBackupIncludedIncludedVolumes Returns included guests and the backup status of their disks. Optimized to be used in ExtJS tree views.

func (*Client) Index

func (c *Client) Index(ctx context.Context) (*IndexResponse, error)

Index List vzdump backup schedule.

func (*Client) Update

func (c *Client) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)

Update Update vzdump backup job definition.

type CreateRequest

type CreateRequest struct {

	// The following parameters are optional
	All              *util.SpecialBool `url:"all,omitempty",json:"all,omitempty"`                           // Backup all known guest systems on this host.
	Bwlimit          *int              `url:"bwlimit,omitempty",json:"bwlimit,omitempty"`                   // Limit I/O bandwidth (KBytes per second).
	Comment          *string           `url:"comment,omitempty",json:"comment,omitempty"`                   // Description for the Job.
	Compress         *string           `url:"compress,omitempty",json:"compress,omitempty"`                 // Compress dump file.
	Dow              *string           `url:"dow,omitempty",json:"dow,omitempty"`                           // Day of week selection.
	Dumpdir          *string           `url:"dumpdir,omitempty",json:"dumpdir,omitempty"`                   // Store resulting files to specified directory.
	Enabled          *util.SpecialBool `url:"enabled,omitempty",json:"enabled,omitempty"`                   // Enable or disable the job.
	Exclude          *string           `url:"exclude,omitempty",json:"exclude,omitempty"`                   // Exclude specified guest systems (assumes --all)
	ExcludePath      *string           `url:"exclude-path,omitempty",json:"exclude-path,omitempty"`         // Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root,  other paths match relative to each subdirectory.
	Id               *string           `url:"id,omitempty",json:"id,omitempty"`                             // Job ID (will be autogenerated).
	Ionice           *int              `url:"ionice,omitempty",json:"ionice,omitempty"`                     // Set CFQ ionice priority.
	Lockwait         *int              `url:"lockwait,omitempty",json:"lockwait,omitempty"`                 // Maximal time to wait for the global lock (minutes).
	Mailnotification *string           `url:"mailnotification,omitempty",json:"mailnotification,omitempty"` // Specify when to send an email
	Mailto           *string           `url:"mailto,omitempty",json:"mailto,omitempty"`                     // Comma-separated list of email addresses or users that should receive email notifications.
	Maxfiles         *int              `url:"maxfiles,omitempty",json:"maxfiles,omitempty"`                 // Deprecated: use 'prune-backups' instead. Maximal number of backup files per guest system.
	Mode             *string           `url:"mode,omitempty",json:"mode,omitempty"`                         // Backup mode.
	Node             *string           `url:"node,omitempty",json:"node,omitempty"`                         // Only run if executed on this node.
	NotesTemplate    *string           `url:"notes-template,omitempty",json:"notes-template,omitempty"`     // Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively.
	Performance      *string           `url:"performance,omitempty",json:"performance,omitempty"`           // Other performance-related settings.
	Pigz             *int              `url:"pigz,omitempty",json:"pigz,omitempty"`                         // Use pigz instead of gzip when N>0. N=1 uses half of cores, N>1 uses N as thread count.
	Pool             *string           `url:"pool,omitempty",json:"pool,omitempty"`                         // Backup all known guest systems included in the specified pool.
	Protected        *util.SpecialBool `url:"protected,omitempty",json:"protected,omitempty"`               // If true, mark backup(s) as protected.
	PruneBackups     *string           `url:"prune-backups,omitempty",json:"prune-backups,omitempty"`       // Use these retention options instead of those from the storage configuration.
	Quiet            *util.SpecialBool `url:"quiet,omitempty",json:"quiet,omitempty"`                       // Be quiet.
	Remove           *util.SpecialBool `url:"remove,omitempty",json:"remove,omitempty"`                     // Prune older backups according to 'prune-backups'.
	RepeatMissed     *util.SpecialBool `url:"repeat-missed,omitempty",json:"repeat-missed,omitempty"`       // If true, the job will be run as soon as possible if it was missed while the scheduler was not running.
	Schedule         *string           `url:"schedule,omitempty",json:"schedule,omitempty"`                 // Backup schedule. The format is a subset of `systemd` calendar events.
	Script           *string           `url:"script,omitempty",json:"script,omitempty"`                     // Use specified hook script.
	Starttime        *string           `url:"starttime,omitempty",json:"starttime,omitempty"`               // Job Start time.
	Stdexcludes      *util.SpecialBool `url:"stdexcludes,omitempty",json:"stdexcludes,omitempty"`           // Exclude temporary files and logs.
	Stop             *util.SpecialBool `url:"stop,omitempty",json:"stop,omitempty"`                         // Stop running backup jobs on this host.
	Stopwait         *int              `url:"stopwait,omitempty",json:"stopwait,omitempty"`                 // Maximal time to wait until a guest system is stopped (minutes).
	Storage          *string           `url:"storage,omitempty",json:"storage,omitempty"`                   // Store resulting file to this storage.
	Tmpdir           *string           `url:"tmpdir,omitempty",json:"tmpdir,omitempty"`                     // Store temporary files to specified directory.
	Vmid             *string           `url:"vmid,omitempty",json:"vmid,omitempty"`                         // The ID of the guest system you want to backup.
	Zstd             *int              `url:"zstd,omitempty",json:"zstd,omitempty"`                         // Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count.
}

type CreateResponse

type CreateResponse map[string]interface{}

type DeleteRequest

type DeleteRequest struct {
	Id string `url:"id",json:"id"` // The job ID.

}

type DeleteResponse

type DeleteResponse map[string]interface{}

type FindRequest

type FindRequest struct {
	Id string `url:"id",json:"id"` // The job ID.

}

type FindResponse

type FindResponse map[string]interface{}

type GetVolumeBackupIncludedIncludedVolumesRequest

type GetVolumeBackupIncludedIncludedVolumesRequest struct {
	Id string `url:"id",json:"id"` // The job ID.

}

type GetVolumeBackupIncludedIncludedVolumesResponse

type GetVolumeBackupIncludedIncludedVolumesResponse struct {
	Children []*struct {
		Id   int    `url:"id",json:"id"`     // VMID of the guest.
		Type string `url:"type",json:"type"` // Type of the guest, VM, CT or unknown for removed but not purged guests.

		// The following parameters are optional
		Children []*struct {
			Id       string           `url:"id",json:"id"`             // Configuration key of the volume.
			Included util.SpecialBool `url:"included",json:"included"` // Whether the volume is included in the backup or not.
			Name     string           `url:"name",json:"name"`         // Name of the volume.
			Reason   string           `url:"reason",json:"reason"`     // The reason why the volume is included (or excluded).

		} `url:"children,omitempty",json:"children,omitempty"` // The volumes of the guest with the information if they will be included in backups.
		Name *string `url:"name,omitempty",json:"name,omitempty"` // Name of the guest
	} `url:"children",json:"children"`
}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexResponse

type IndexResponse []*struct {
	Id string `url:"id",json:"id"` // The job ID.

}

type UpdateRequest

type UpdateRequest struct {
	Id string `url:"id",json:"id"` // The job ID.

	// The following parameters are optional
	All              *util.SpecialBool `url:"all,omitempty",json:"all,omitempty"`                           // Backup all known guest systems on this host.
	Bwlimit          *int              `url:"bwlimit,omitempty",json:"bwlimit,omitempty"`                   // Limit I/O bandwidth (KBytes per second).
	Comment          *string           `url:"comment,omitempty",json:"comment,omitempty"`                   // Description for the Job.
	Compress         *string           `url:"compress,omitempty",json:"compress,omitempty"`                 // Compress dump file.
	Delete           *string           `url:"delete,omitempty",json:"delete,omitempty"`                     // A list of settings you want to delete.
	Dow              *string           `url:"dow,omitempty",json:"dow,omitempty"`                           // Day of week selection.
	Dumpdir          *string           `url:"dumpdir,omitempty",json:"dumpdir,omitempty"`                   // Store resulting files to specified directory.
	Enabled          *util.SpecialBool `url:"enabled,omitempty",json:"enabled,omitempty"`                   // Enable or disable the job.
	Exclude          *string           `url:"exclude,omitempty",json:"exclude,omitempty"`                   // Exclude specified guest systems (assumes --all)
	ExcludePath      *string           `url:"exclude-path,omitempty",json:"exclude-path,omitempty"`         // Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root,  other paths match relative to each subdirectory.
	Ionice           *int              `url:"ionice,omitempty",json:"ionice,omitempty"`                     // Set CFQ ionice priority.
	Lockwait         *int              `url:"lockwait,omitempty",json:"lockwait,omitempty"`                 // Maximal time to wait for the global lock (minutes).
	Mailnotification *string           `url:"mailnotification,omitempty",json:"mailnotification,omitempty"` // Specify when to send an email
	Mailto           *string           `url:"mailto,omitempty",json:"mailto,omitempty"`                     // Comma-separated list of email addresses or users that should receive email notifications.
	Maxfiles         *int              `url:"maxfiles,omitempty",json:"maxfiles,omitempty"`                 // Deprecated: use 'prune-backups' instead. Maximal number of backup files per guest system.
	Mode             *string           `url:"mode,omitempty",json:"mode,omitempty"`                         // Backup mode.
	Node             *string           `url:"node,omitempty",json:"node,omitempty"`                         // Only run if executed on this node.
	NotesTemplate    *string           `url:"notes-template,omitempty",json:"notes-template,omitempty"`     // Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively.
	Performance      *string           `url:"performance,omitempty",json:"performance,omitempty"`           // Other performance-related settings.
	Pigz             *int              `url:"pigz,omitempty",json:"pigz,omitempty"`                         // Use pigz instead of gzip when N>0. N=1 uses half of cores, N>1 uses N as thread count.
	Pool             *string           `url:"pool,omitempty",json:"pool,omitempty"`                         // Backup all known guest systems included in the specified pool.
	Protected        *util.SpecialBool `url:"protected,omitempty",json:"protected,omitempty"`               // If true, mark backup(s) as protected.
	PruneBackups     *string           `url:"prune-backups,omitempty",json:"prune-backups,omitempty"`       // Use these retention options instead of those from the storage configuration.
	Quiet            *util.SpecialBool `url:"quiet,omitempty",json:"quiet,omitempty"`                       // Be quiet.
	Remove           *util.SpecialBool `url:"remove,omitempty",json:"remove,omitempty"`                     // Prune older backups according to 'prune-backups'.
	RepeatMissed     *util.SpecialBool `url:"repeat-missed,omitempty",json:"repeat-missed,omitempty"`       // If true, the job will be run as soon as possible if it was missed while the scheduler was not running.
	Schedule         *string           `url:"schedule,omitempty",json:"schedule,omitempty"`                 // Backup schedule. The format is a subset of `systemd` calendar events.
	Script           *string           `url:"script,omitempty",json:"script,omitempty"`                     // Use specified hook script.
	Starttime        *string           `url:"starttime,omitempty",json:"starttime,omitempty"`               // Job Start time.
	Stdexcludes      *util.SpecialBool `url:"stdexcludes,omitempty",json:"stdexcludes,omitempty"`           // Exclude temporary files and logs.
	Stop             *util.SpecialBool `url:"stop,omitempty",json:"stop,omitempty"`                         // Stop running backup jobs on this host.
	Stopwait         *int              `url:"stopwait,omitempty",json:"stopwait,omitempty"`                 // Maximal time to wait until a guest system is stopped (minutes).
	Storage          *string           `url:"storage,omitempty",json:"storage,omitempty"`                   // Store resulting file to this storage.
	Tmpdir           *string           `url:"tmpdir,omitempty",json:"tmpdir,omitempty"`                     // Store temporary files to specified directory.
	Vmid             *string           `url:"vmid,omitempty",json:"vmid,omitempty"`                         // The ID of the guest system you want to backup.
	Zstd             *int              `url:"zstd,omitempty",json:"zstd,omitempty"`                         // Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count.
}

type UpdateResponse

type UpdateResponse map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL