backups

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateCommand

func NewCreateCommand() cmd.Command

NewCreateCommand returns a command used to create backups.

func NewDownloadCommand

func NewDownloadCommand() cmd.Command

NewDownloadCommand returns a commant used to download backups.

func NewListCommand

func NewListCommand() cmd.Command

NewListCommand returns a command used to list metadata for backups.

func NewRemoveCommand

func NewRemoveCommand() cmd.Command

NewRemoveCommand returns a command used to remove a backup from remote storage.

func NewShowCommand

func NewShowCommand() cmd.Command

NewShowCommand returns a command used to show metadata for a backup.

func NewUploadCommand

func NewUploadCommand() cmd.Command

NewUploadCommand returns a command used to send a backup achieve file to remote storage.

Types

type APIClient

type APIClient interface {
	io.Closer
	// Create sends an RPC request to create a new backup.
	Create(notes string, keepCopy, noDownload bool) (*params.BackupsMetadataResult, error)
	// Info gets the backup's metadata.
	Info(id string) (*params.BackupsMetadataResult, error)
	// List gets all stored metadata.
	List() (*params.BackupsListResult, error)
	// Download pulls the backup archive file.
	Download(id string) (io.ReadCloser, error)
	// Upload pushes a backup archive to storage.
	Upload(ar io.ReadSeeker, meta params.BackupsMetadataResult) (string, error)
	// Remove removes the stored backups.
	Remove(ids ...string) ([]params.ErrorResult, error)
}

APIClient represents the backups API client functionality used by the backups command.

To regenerate the mocks for the APIClient used by this package, run "go generate" from the package directory.

type ArchiveReader

type ArchiveReader interface {
	io.ReadSeeker
	io.Closer
}

ArchiveReader can read a backup archive.

To regenerate the mocks for the ArchiveReader used by this package, run "go generate" from the package directory.

type CommandBase

type CommandBase struct {
	modelcmd.ModelCommandBase
	// contains filtered or unexported fields
}

CommandBase is the base type for backups sub-commands.

func (*CommandBase) Init

func (c *CommandBase) Init(args []string) error

Init implements Command.SetFlags.

func (*CommandBase) NewAPIClient

func (c *CommandBase) NewAPIClient() (APIClient, error)

NewAPIClient returns a client for the backups api endpoint.

func (*CommandBase) NewGetAPI

func (c *CommandBase) NewGetAPI() (APIClient, int, error)

NewGetAPI returns a client for the backups api endpoint.

func (*CommandBase) SetFlags

func (c *CommandBase) SetFlags(f *gnuflag.FlagSet)

SetFlags implements Command.SetFlags.

type MetadataParams

type MetadataParams struct {
	BackupID       string
	FormatVersion  int64
	Checksum       string
	ChecksumFormat string
	Size           int64
	Stored         time.Time
	Started        time.Time
	Finished       time.Time
	Notes          string
	ControllerUUID string
	HANodes        int64
	ModelUUID      string
	MachineID      string
	Hostname       string
	JujuVersion    version.Number
	Series         string
}

Jump to

Keyboard shortcuts

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