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