github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/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 KeepCopy bool `json:"keep-copy"` 16 NoDownload bool `json:"no-download"` 17 } 18 19 // BackupsInfoArgs holds the args for the API Info method. 20 type BackupsInfoArgs struct { 21 ID string `json:"id"` 22 } 23 24 // BackupsListArgs holds the args for the API List method. 25 type BackupsListArgs struct { 26 } 27 28 // BackupsDownloadArgs holds the args for the API Download method. 29 type BackupsDownloadArgs struct { 30 ID string `json:"id"` 31 } 32 33 // BackupsUploadArgs holds the args for the API Upload method. 34 type BackupsUploadArgs struct { 35 Data []byte `json:"data"` 36 Metadata BackupsMetadataResult `json:"metadata"` 37 } 38 39 // BackupsRemoveArgs holds the args for the API Remove method. 40 type BackupsRemoveArgs struct { 41 IDs []string `json:"ids"` 42 } 43 44 // BackupsListResult holds the list of all stored backups. 45 type BackupsListResult struct { 46 List []BackupsMetadataResult `json:"list"` 47 } 48 49 // BackupsListResult holds the list of all stored backups. 50 type BackupsUploadResult struct { 51 ID string `json:"id"` 52 } 53 54 // BackupsMetadataResult holds the metadata for a backup as returned by 55 // an API backups method (such as Create). 56 type BackupsMetadataResult struct { 57 ID string `json:"id"` 58 59 Checksum string `json:"checksum"` 60 ChecksumFormat string `json:"checksum-format"` 61 Size int64 `json:"size"` 62 Stored time.Time `json:"stored"` // May be zero... 63 64 Started time.Time `json:"started"` 65 Finished time.Time `json:"finished"` // May be zero... 66 Notes string `json:"notes"` 67 Model string `json:"model"` 68 Machine string `json:"machine"` 69 Hostname string `json:"hostname"` 70 Version version.Number `json:"version"` 71 Series string `json:"series"` 72 73 CACert string `json:"ca-cert"` 74 CAPrivateKey string `json:"ca-private-key"` 75 Filename string `json:"filename"` 76 } 77 78 // RestoreArgs Holds the backup file or id 79 type RestoreArgs struct { 80 // BackupId holds the id of the backup in server if any 81 BackupId string `json:"backup-id"` 82 }