github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/api/backups/create.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package backups
     5  
     6  import (
     7  	"github.com/juju/errors"
     8  
     9  	"github.com/juju/juju/apiserver/params"
    10  )
    11  
    12  // Create sends a request to create a backup of juju's state.  It
    13  // returns the metadata associated with the resulting backup and a
    14  // filename for download.
    15  func (c *Client) Create(notes string, keepCopy, noDownload bool) (*params.BackupsMetadataResult, error) {
    16  	var result params.BackupsMetadataResult
    17  	args := params.BackupsCreateArgs{
    18  		Notes:      notes,
    19  		KeepCopy:   keepCopy,
    20  		NoDownload: noDownload,
    21  	}
    22  
    23  	if err := c.facade.FacadeCall("Create", args, &result); err != nil {
    24  		return nil, errors.Trace(err)
    25  	}
    26  
    27  	return &result, nil
    28  }