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

package backups

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


Package Files

client.go create.go download.go info.go list.go remove.go restore.go upload.go

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client wraps the backups API for the client.

func MakeClient Uses

func MakeClient(frontend base.ClientFacade, backend base.FacadeCaller, client *httprequest.Client) *Client

MakeClient is a direct constructor function for a backups client.

func NewClient Uses

func NewClient(st base.APICallCloser) (*Client, error)

NewClient returns a new backups API client.

func (*Client) Create Uses

func (c *Client) Create(notes string, keepCopy, noDownload bool) (*params.BackupsMetadataResult, error)

Create sends a request to create a backup of juju's state. It returns the metadata associated with the resulting backup and a filename for download.

func (*Client) Download Uses

func (c *Client) Download(id string) (io.ReadCloser, error)

Download returns an io.ReadCloser for the given backup id.

func (*Client) Info Uses

func (c *Client) Info(id string) (*params.BackupsMetadataResult, error)

Info implements the API method.

func (*Client) List Uses

func (c *Client) List() (*params.BackupsListResult, error)

List implements the API method.

func (*Client) Remove Uses

func (c *Client) Remove(ids ...string) ([]params.ErrorResult, error)

func (*Client) Restore Uses

func (c *Client) Restore(backupId string, newClient ClientConnection) error

Restore performs restore using a backup id corresponding to a backup stored in the server.

func (*Client) RestoreReader Uses

func (c *Client) RestoreReader(r io.ReadSeeker, meta *params.BackupsMetadataResult, newClient ClientConnection) error

RestoreReader restores the contents of backupFile as backup.

func (*Client) Upload Uses

func (c *Client) Upload(archive io.ReadSeeker, meta params.BackupsMetadataResult) (string, error)

Upload sends the backup archive to remote storage.

type ClientConnection Uses

type ClientConnection func() (*Client, error)

ClientConnection type represents a function capable of spawning a new Client connection it is used to pass around connection factories when necessary. TODO(perrito666) This is a workaround for lp:1399722 .

Package backups imports 11 packages (graph) and is imported by 38 packages. Updated 2019-12-20. Refresh now. Tools for package owners.