172 lines
6.1 KiB
Go
172 lines
6.1 KiB
Go
package api
|
|
|
|
type BackupRequest struct {
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc"`
|
|
Tags []string `json:"tags,omitempty"`
|
|
Snapshot bool `json:"snapshot"`
|
|
DryRun bool `json:"dry_run"`
|
|
}
|
|
|
|
type BackupResponse struct {
|
|
Driver string `json:"driver,omitempty"`
|
|
Volume string `json:"volume,omitempty"`
|
|
Backup string `json:"backup,omitempty"`
|
|
JobName string `json:"job_name,omitempty"`
|
|
Namespace string `json:"namespace,omitempty"`
|
|
Secret string `json:"secret,omitempty"`
|
|
RequestedBy string `json:"requested_by,omitempty"`
|
|
DryRun bool `json:"dry_run"`
|
|
}
|
|
|
|
type RestoreTestRequest struct {
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc,omitempty"`
|
|
Snapshot string `json:"snapshot,omitempty"`
|
|
BackupURL string `json:"backup_url,omitempty"`
|
|
TargetNamespace string `json:"target_namespace,omitempty"`
|
|
TargetPVC string `json:"target_pvc,omitempty"`
|
|
DryRun bool `json:"dry_run"`
|
|
}
|
|
|
|
type RestoreTestResponse struct {
|
|
Driver string `json:"driver,omitempty"`
|
|
Volume string `json:"volume,omitempty"`
|
|
TargetNamespace string `json:"target_namespace,omitempty"`
|
|
TargetPVC string `json:"target_pvc,omitempty"`
|
|
BackupURL string `json:"backup_url,omitempty"`
|
|
JobName string `json:"job_name,omitempty"`
|
|
Namespace string `json:"namespace,omitempty"`
|
|
Secret string `json:"secret,omitempty"`
|
|
RequestedBy string `json:"requested_by,omitempty"`
|
|
DryRun bool `json:"dry_run"`
|
|
}
|
|
|
|
type InventoryResponse struct {
|
|
GeneratedAt string `json:"generated_at"`
|
|
Namespaces []NamespaceInventory `json:"namespaces"`
|
|
}
|
|
|
|
type NamespaceInventory struct {
|
|
Name string `json:"name"`
|
|
PVCs []PVCInventory `json:"pvcs"`
|
|
}
|
|
|
|
type PVCInventory struct {
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc"`
|
|
Volume string `json:"volume,omitempty"`
|
|
Phase string `json:"phase,omitempty"`
|
|
StorageClass string `json:"storage_class,omitempty"`
|
|
Capacity string `json:"capacity,omitempty"`
|
|
AccessModes []string `json:"access_modes,omitempty"`
|
|
Driver string `json:"driver,omitempty"`
|
|
LastBackupAt string `json:"last_backup_at,omitempty"`
|
|
LastBackupAgeHours float64 `json:"last_backup_age_hours,omitempty"`
|
|
BackupCount int `json:"backup_count"`
|
|
Healthy bool `json:"healthy"`
|
|
HealthReason string `json:"health_reason,omitempty"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
type BackupListResponse struct {
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc"`
|
|
Volume string `json:"volume"`
|
|
Backups []BackupRecord `json:"backups"`
|
|
}
|
|
|
|
type BackupRecord struct {
|
|
Name string `json:"name"`
|
|
SnapshotName string `json:"snapshot_name,omitempty"`
|
|
Created string `json:"created,omitempty"`
|
|
State string `json:"state,omitempty"`
|
|
URL string `json:"url,omitempty"`
|
|
Size string `json:"size,omitempty"`
|
|
Latest bool `json:"latest,omitempty"`
|
|
}
|
|
|
|
type AuthInfoResponse struct {
|
|
Authenticated bool `json:"authenticated"`
|
|
User string `json:"user,omitempty"`
|
|
Email string `json:"email,omitempty"`
|
|
Groups []string `json:"groups,omitempty"`
|
|
}
|
|
|
|
type BackupPolicy struct {
|
|
ID string `json:"id"`
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc,omitempty"`
|
|
IntervalHours float64 `json:"interval_hours"`
|
|
Enabled bool `json:"enabled"`
|
|
CreatedAt string `json:"created_at,omitempty"`
|
|
UpdatedAt string `json:"updated_at,omitempty"`
|
|
}
|
|
|
|
type BackupPolicyUpsertRequest struct {
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc,omitempty"`
|
|
IntervalHours float64 `json:"interval_hours"`
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
}
|
|
|
|
type BackupPolicyListResponse struct {
|
|
Policies []BackupPolicy `json:"policies"`
|
|
}
|
|
|
|
type NamespaceBackupRequest struct {
|
|
Namespace string `json:"namespace"`
|
|
DryRun bool `json:"dry_run"`
|
|
}
|
|
|
|
type NamespaceBackupResult struct {
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc"`
|
|
Status string `json:"status"`
|
|
Volume string `json:"volume,omitempty"`
|
|
Backup string `json:"backup,omitempty"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
type NamespaceBackupResponse struct {
|
|
Namespace string `json:"namespace"`
|
|
RequestedBy string `json:"requested_by,omitempty"`
|
|
Driver string `json:"driver"`
|
|
DryRun bool `json:"dry_run"`
|
|
Total int `json:"total"`
|
|
Succeeded int `json:"succeeded"`
|
|
Failed int `json:"failed"`
|
|
Results []NamespaceBackupResult `json:"results"`
|
|
}
|
|
|
|
type NamespaceRestoreRequest struct {
|
|
Namespace string `json:"namespace"`
|
|
TargetNamespace string `json:"target_namespace,omitempty"`
|
|
TargetPrefix string `json:"target_prefix,omitempty"`
|
|
Snapshot string `json:"snapshot,omitempty"`
|
|
DryRun bool `json:"dry_run"`
|
|
}
|
|
|
|
type NamespaceRestoreResult struct {
|
|
Namespace string `json:"namespace"`
|
|
PVC string `json:"pvc"`
|
|
TargetNamespace string `json:"target_namespace"`
|
|
TargetPVC string `json:"target_pvc"`
|
|
Status string `json:"status"`
|
|
Volume string `json:"volume,omitempty"`
|
|
BackupURL string `json:"backup_url,omitempty"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
type NamespaceRestoreResponse struct {
|
|
Namespace string `json:"namespace"`
|
|
TargetNamespace string `json:"target_namespace"`
|
|
RequestedBy string `json:"requested_by,omitempty"`
|
|
Driver string `json:"driver"`
|
|
DryRun bool `json:"dry_run"`
|
|
Total int `json:"total"`
|
|
Succeeded int `json:"succeeded"`
|
|
Failed int `json:"failed"`
|
|
Results []NamespaceRestoreResult `json:"results"`
|
|
}
|