-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from vshn/add/nextcloud_api
Add Nextcloud Backups to API
- Loading branch information
Showing
35 changed files
with
2,278 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/apiserver-runtime/pkg/builder/resource" | ||
) | ||
|
||
// VSHNNextcloudBackup needs to implement the builder resource interface | ||
var _ resource.Object = &VSHNNextcloudBackup{} | ||
var _ resource.ObjectList = &VSHNNextcloudBackupList{} | ||
|
||
// +kubebuilder:object:root=true | ||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudBackup struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Status VSHNNextcloudBackupStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudBackupStatus struct { | ||
// FileBackupAvailable indicates if this backup contains a file backup for Nextcloud. | ||
// Not every file backup might have a database backup associated, because the retention is not enforced at the same time. | ||
FileBackupAvailable bool | ||
// DatabaseBackupAvailable indicates if this backup contains a database backup for Nextcloud. | ||
// Not every file backup might have a database backup associated, because the retention is not enforced at the same time. | ||
DatabaseBackupAvailable bool | ||
NextcloudFileBackup VSHNNextcloudFileBackupStatus `json:"nextcloudFileBackup,omitempty"` | ||
DatabaseBackupStatus VSHNPostgresBackupStatus `json:"databaseBackupStatus,omitempty"` | ||
} | ||
|
||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudFileBackupStatus struct { | ||
ID string `json:"id,omitempty"` | ||
Date metav1.Time `json:"date,omitempty"` | ||
Instance string `json:"instance,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +k8s:openapi-gen=true | ||
type VSHNNextcloudBackupList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
|
||
Items []VSHNNextcloudBackup `json:"items,omitempty"` | ||
} | ||
|
||
// GetGroupVersionResource returns the GroupVersionResource for this resource. | ||
// The resource should be the all lowercase and pluralized kind | ||
func (in *VSHNNextcloudBackup) GetGroupVersionResource() schema.GroupVersionResource { | ||
return schema.GroupVersionResource{ | ||
Group: GroupVersion.Group, | ||
Version: GroupVersion.Version, | ||
Resource: "vshnnextcloudbackups", | ||
} | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) GetObjectMeta() *metav1.ObjectMeta { | ||
return &in.ObjectMeta | ||
} | ||
|
||
// IsStorageVersion returns true if the object is also the internal version -- i.e. is the type defined for the API group or an alias to this object. | ||
// If false, the resource is expected to implement MultiVersionObject interface. | ||
func (in *VSHNNextcloudBackup) IsStorageVersion() bool { | ||
return true | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) NamespaceScoped() bool { | ||
return true | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) New() runtime.Object { | ||
return &VSHNNextcloudBackup{} | ||
} | ||
|
||
func (in *VSHNNextcloudBackup) NewList() runtime.Object { | ||
return &VSHNNextcloudBackupList{} | ||
} | ||
|
||
func (in *VSHNNextcloudBackupList) GetListMeta() *metav1.ListMeta { | ||
return &in.ListMeta | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.