github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/apiserver/params/backups.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package params
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/juju/version"
    10  )
    11  
    12  // BackupsCreateArgs holds the args for the API Create method.
    13  type BackupsCreateArgs struct {
    14  	Notes string `json:"notes"`
    15  }
    16  
    17  // BackupsInfoArgs holds the args for the API Info method.
    18  type BackupsInfoArgs struct {
    19  	ID string `json:"id"`
    20  }
    21  
    22  // BackupsListArgs holds the args for the API List method.
    23  type BackupsListArgs struct {
    24  }
    25  
    26  // BackupsDownloadArgs holds the args for the API Download method.
    27  type BackupsDownloadArgs struct {
    28  	ID string `json:"id"`
    29  }
    30  
    31  // BackupsUploadArgs holds the args for the API Upload method.
    32  type BackupsUploadArgs struct {
    33  	Data     []byte                `json:"data"`
    34  	Metadata BackupsMetadataResult `json:"metadata"`
    35  }
    36  
    37  // BackupsRemoveArgs holds the args for the API Remove method.
    38  type BackupsRemoveArgs struct {
    39  	ID string `json:"id"`
    40  }
    41  
    42  // BackupsListResult holds the list of all stored backups.
    43  type BackupsListResult struct {
    44  	List []BackupsMetadataResult `json:"list"`
    45  }
    46  
    47  // BackupsListResult holds the list of all stored backups.
    48  type BackupsUploadResult struct {
    49  	ID string `json:"id"`
    50  }
    51  
    52  // BackupsMetadataResult holds the metadata for a backup as returned by
    53  // an API backups method (such as Create).
    54  type BackupsMetadataResult struct {
    55  	ID string `json:"id"`
    56  
    57  	Checksum       string    `json:"checksum"`
    58  	ChecksumFormat string    `json:"checksum-format"`
    59  	Size           int64     `json:"size"`
    60  	Stored         time.Time `json:"stored"` // May be zero...
    61  
    62  	Started  time.Time      `json:"started"`
    63  	Finished time.Time      `json:"finished"` // May be zero...
    64  	Notes    string         `json:"notes"`
    65  	Model    string         `json:"model"`
    66  	Machine  string         `json:"machine"`
    67  	Hostname string         `json:"hostname"`
    68  	Version  version.Number `json:"version"`
    69  	Series   string         `json:"series"`
    70  
    71  	CACert       string `json:"ca-cert"`
    72  	CAPrivateKey string `json:"ca-private-key"`
    73  }
    74  
    75  // RestoreArgs Holds the backup file or id
    76  type RestoreArgs struct {
    77  	// BackupId holds the id of the backup in server if any
    78  	BackupId string `json:"backup-id"`
    79  }