juju: github.com/juju/juju/cmd/juju/backups Index | Files

package backups

import "github.com/juju/juju/cmd/juju/backups"

Index

Package Files

backups.go create.go download.go list.go remove.go restore.go show.go upload.go

func NewCreateCommand Uses

func NewCreateCommand() cmd.Command

NewCreateCommand returns a command used to create backups.

func NewDownloadCommand Uses

func NewDownloadCommand() cmd.Command

NewDownloadCommand returns a commant used to download backups.

func NewListCommand Uses

func NewListCommand() cmd.Command

NewListCommand returns a command used to list metadata for backups.

func NewRemoveCommand Uses

func NewRemoveCommand() cmd.Command

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

func NewRestoreCommand Uses

func NewRestoreCommand() cmd.Command

NewRestoreCommand returns a command used to restore a backup.

func NewShowCommand Uses

func NewShowCommand() cmd.Command

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

func NewUploadCommand Uses

func NewUploadCommand() cmd.Command

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

type APIClient Uses

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)
    // Restore will restore a backup with the given id into the controller.
    Restore(string, backups.ClientConnection) error
    // RestoreReader will restore a backup file into the controller.
    RestoreReader(io.ReadSeeker, *params.BackupsMetadataResult, backups.ClientConnection) 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. go:generate mockgen -package backups_test -destination mock_test.go github.com/juju/juju/cmd/juju/backups ArchiveReader,APIClient

type ArchiveReader Uses

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. go:generate mockgen -package backups_test -destination mock_test.go github.com/juju/juju/cmd/juju/backups ArchiveReader,APIClient

type CommandBase Uses

type CommandBase struct {
    // TODO(wallyworld) - remove Log when backup command is flattened.
    Log *cmd.Log
    modelcmd.ModelCommandBase
}

CommandBase is the base type for backups sub-commands.

func (*CommandBase) NewAPIClient Uses

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

NewAPIClient returns a client for the backups api endpoint.

func (*CommandBase) NewGetAPI Uses

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

NewAPIClient returns a client for the backups api endpoint.

func (*CommandBase) SetFlags Uses

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

SetFlags implements Command.SetFlags.

type ModelStatusAPI Uses

type ModelStatusAPI interface {
    Close() error
    ModelStatus(tags ...names.ModelTag) ([]base.ModelStatus, error)
}

ModelStatusAPI is used to invoke common.ModelStatus The interface is used to facilitate testing.

go:generate mockgen -package backups_test -destination modelstatusapi_mock_test.go github.com/juju/juju/cmd/juju/backups ModelStatusAPI

type RestoreAPI Uses

type RestoreAPI interface {
    // Close is taken from io.Closer.
    Close() error

    // Restore is taken from backups.Client.
    Restore(backupId string, newClient backups.ClientConnection) error

    // RestoreReader is taken from backups.Client.
    RestoreReader(r io.ReadSeeker, meta *params.BackupsMetadataResult, newClient backups.ClientConnection) error
}

RestoreAPI is used to invoke various API calls.

Package backups imports 23 packages (graph) and is imported by 35 packages. Updated 2019-08-29. Refresh now. Tools for package owners.