-
Notifications
You must be signed in to change notification settings - Fork 90
/
types.go
134 lines (119 loc) · 4.81 KB
/
types.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package types
import (
"time"
velerov1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
)
type App struct {
Slug string `json:"slug"`
Sequence int64 `json:"sequence"`
Name string `json:"name"`
AppIconURI string `json:"iconUri"`
}
type Backup struct {
Name string `json:"name"`
Status string `json:"status"`
Trigger string `json:"trigger"`
AppID string `json:"appID"` // TODO: remove with app backups
Sequence int64 `json:"sequence"` // TODO: remove with app backups
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
VolumeCount int `json:"volumeCount"`
VolumeSuccessCount int `json:"volumeSuccessCount"`
VolumeBytes int64 `json:"volumeBytes"`
VolumeSizeHuman string `json:"volumeSizeHuman"`
SupportBundleID string `json:"supportBundleId,omitempty"`
IncludedApps []App `json:"includedApps,omitempty"`
}
type BackupDetail struct {
Name string `json:"name"`
Status string `json:"status"`
VolumeSizeHuman string `json:"volumeSizeHuman"`
Namespaces []string `json:"namespaces"`
Hooks []*SnapshotHook `json:"hooks"`
Volumes []SnapshotVolume `json:"volumes"`
Errors []SnapshotError `json:"errors"`
Warnings []SnapshotError `json:"warnings"`
}
type RestoreDetail struct {
Name string `json:"name"`
Phase velerov1.RestorePhase `json:"phase"`
Volumes []RestoreVolume `json:"volumes"`
Errors []SnapshotError `json:"errors"`
Warnings []SnapshotError `json:"warnings"`
}
type SnapshotHook struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Phase string `json:"phase"`
PodName string `json:"podName"`
ContainerName string `json:"containerName"`
Command string `json:"command"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
Errors []SnapshotError `json:"errors"`
Warnings []SnapshotError `json:"warnings"`
}
type SnapshotVolume struct {
Name string `json:"name"`
SizeBytesHuman string `json:"sizeBytesHuman"`
DoneBytesHuman string `json:"doneBytesHuman"`
CompletionPercent int `json:"completionPercent"`
TimeRemainingSeconds int `json:"timeRemainingSeconds"`
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
Phase string `json:"phase"`
}
type RestoreVolume struct {
Name string `json:"name"`
PodName string `json:"podName"`
PodNamespace string `json:"podNamespace"`
PodVolumeName string `json:"podVolumeName"`
SizeBytesHuman string `json:"sizeBytesHuman"`
DoneBytesHuman string `json:"doneBytesHuman"`
CompletionPercent int `json:"completionPercent"`
RemainingSecondsExist bool `json:"remainingSecondsExist"`
TimeRemainingSeconds int `json:"timeRemainingSeconds"`
StartedAt *time.Time `json:"startedAt,omitempty"`
FinishedAt *time.Time `json:"finishedAt,omitempty"`
Phase string `json:"phase"`
}
type SnapshotError struct {
Title string `json:"title"`
Message string `json:"message"`
Namespace string `json:"namespace"`
}
type VolumeSummary struct {
VolumeCount int `json:"volumeCount"`
VolumeSuccessCount int `json:"volumeSuccessCount"`
VolumeBytes int64 `json:"volumeBytes"`
VolumeSizeHuman string `json:"volumeSizeHuman"`
}
type SnapshotSchedule struct {
Schedule string `json:"schedule"`
}
type SnapshotTTL struct {
InputValue string `json:"inputValue"`
InputTimeUnit string `json:"inputTimeUnit"`
Converted string `json:"converted"`
}
type ParsedTTL struct {
Quantity int64 `json:"quantity"`
Unit string `json:"unit"`
}
type ScheduledSnapshot struct {
ID string `json:"id"`
AppID string `json:"appId"`
ScheduledTimestamp time.Time `json:"scheduledTimestamp"`
// name of Backup CR will be set once scheduled
BackupName string `json:"backupName,omitempty"`
}
type ScheduledInstanceSnapshot struct {
ID string `json:"id"`
ClusterID string `json:"clusterId"`
ScheduledTimestamp time.Time `json:"scheduledTimestamp"`
// name of Backup CR will be set once scheduled
BackupName string `json:"backupName,omitempty"`
}