stork

package
v1.20.4-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 19 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInstance

func SetInstance(i Ops)

SetInstance replaces the instance with the provided one. Should be used only for testing purposes.

Types

type ApplicationBackupRestoreOps

type ApplicationBackupRestoreOps interface {
	// CreateApplicationBackup creates the ApplicationBackup
	CreateApplicationBackup(*storkv1alpha1.ApplicationBackup) (*storkv1alpha1.ApplicationBackup, error)
	// GetApplicationBackup gets the ApplicationBackup
	GetApplicationBackup(string, string) (*storkv1alpha1.ApplicationBackup, error)
	// ListApplicationBackups lists all the ApplicationBackups
	ListApplicationBackups(string) (*storkv1alpha1.ApplicationBackupList, error)
	// UpdateApplicationBackup updates the ApplicationBackup
	UpdateApplicationBackup(*storkv1alpha1.ApplicationBackup) (*storkv1alpha1.ApplicationBackup, error)
	// DeleteApplicationBackup deletes the ApplicationBackup
	DeleteApplicationBackup(string, string) error
	// ValidateApplicationBackup validates the ApplicationBackup
	ValidateApplicationBackup(string, string, time.Duration, time.Duration) error
	// WatchApplicationBackup watch the ApplicationBackup
	WatchApplicationBackup(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error
	// CreateApplicationRestore creates the ApplicationRestore
	CreateApplicationRestore(*storkv1alpha1.ApplicationRestore) (*storkv1alpha1.ApplicationRestore, error)
	// GetApplicationRestore gets the ApplicationRestore
	GetApplicationRestore(string, string) (*storkv1alpha1.ApplicationRestore, error)
	// ListApplicationRestores lists all the ApplicationRestores
	ListApplicationRestores(string) (*storkv1alpha1.ApplicationRestoreList, error)
	// UpdateApplicationRestore updates the ApplicationRestore
	UpdateApplicationRestore(*storkv1alpha1.ApplicationRestore) (*storkv1alpha1.ApplicationRestore, error)
	// DeleteApplicationRestore deletes the ApplicationRestore
	DeleteApplicationRestore(string, string) error
	// ValidateApplicationRestore validates the ApplicationRestore
	ValidateApplicationRestore(string, string, time.Duration, time.Duration) error
	// WatchApplicationRestore watch the ApplicationRestore
	WatchApplicationRestore(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error
	// GetApplicationBackupSchedule gets the ApplicationBackupSchedule
	GetApplicationBackupSchedule(string, string) (*storkv1alpha1.ApplicationBackupSchedule, error)
	// CreateApplicationBackupSchedule creates an ApplicationBackupSchedule
	CreateApplicationBackupSchedule(*storkv1alpha1.ApplicationBackupSchedule) (*storkv1alpha1.ApplicationBackupSchedule, error)
	// UpdateApplicationBackupSchedule updates the ApplicationBackupSchedule
	UpdateApplicationBackupSchedule(*storkv1alpha1.ApplicationBackupSchedule) (*storkv1alpha1.ApplicationBackupSchedule, error)
	// ListApplicationBackupSchedules lists all the ApplicationBackupSchedules
	ListApplicationBackupSchedules(string) (*storkv1alpha1.ApplicationBackupScheduleList, error)
	// DeleteApplicationBackupSchedule deletes the ApplicationBackupSchedule
	DeleteApplicationBackupSchedule(string, string) error
	// ValidateApplicationBackupSchedule validates the given ApplicationBackupSchedule. It checks the status of each of
	// the backups triggered for this schedule and returns a map of successfull backups. The key of the
	// map will be the schedule type and value will be list of backups for that schedule type.
	// The caller is expected to validate if the returned map has all backups expected at that point of time
	ValidateApplicationBackupSchedule(string, string, int, time.Duration, time.Duration) (
		map[storkv1alpha1.SchedulePolicyType][]*storkv1alpha1.ScheduledApplicationBackupStatus, error)
}

ApplicationBackupRestoreOps is an interface to perfrom k8s Application Backup and Restore operations

type ApplicationCloneOps

type ApplicationCloneOps interface {
	// CreateApplicationClone creates the ApplicationClone
	CreateApplicationClone(*storkv1alpha1.ApplicationClone) (*storkv1alpha1.ApplicationClone, error)
	// GetApplicationClone gets the ApplicationClone
	GetApplicationClone(string, string) (*storkv1alpha1.ApplicationClone, error)
	// ListApplicationClones lists all the ApplicationClones
	ListApplicationClones(string) (*storkv1alpha1.ApplicationCloneList, error)
	// UpdateApplicationClone updates the ApplicationClone
	UpdateApplicationClone(*storkv1alpha1.ApplicationClone) (*storkv1alpha1.ApplicationClone, error)
	// DeleteApplicationClone deletes the ApplicationClone
	DeleteApplicationClone(string, string) error
	// ValidateApplicationClone validates the ApplicationClone
	ValidateApplicationClone(string, string, time.Duration, time.Duration) error
	// WatchApplicationClone watch the ApplicationClone
	WatchApplicationClone(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error
}

ApplicationCloneOps is an interface to perform k8s Application Clone operations

type ApplicationRegistrationOps

type ApplicationRegistrationOps interface {
	// CreateApplicationRegistration creates the ApplicationRegistration
	CreateApplicationRegistration(*storkv1alpha1.ApplicationRegistration) (*storkv1alpha1.ApplicationRegistration, error)
	// GetApplicationRegistration gets the ApplicationRegistration
	GetApplicationRegistration(string) (*storkv1alpha1.ApplicationRegistration, error)
	// ListApplicationRegistrations lists all the ApplicationRegistrations
	ListApplicationRegistrations() (*storkv1alpha1.ApplicationRegistrationList, error)
	// UpdateApplicationRegistration updates the ApplicationRegistration
	UpdateApplicationRegistration(*storkv1alpha1.ApplicationRegistration) (*storkv1alpha1.ApplicationRegistration, error)
	// DeleteApplicationRegistration deletes the ApplicationRegistration
	DeleteApplicationRegistration(string) error
	// ValidateApplicationRegistration validates the ApplicationRegistration
	ValidateApplicationRegistration(string, time.Duration, time.Duration) error
}

ApplicationRegistrationOps is an interface to perform k8s ApplicationRegistration operations

type BackupLocationOps

type BackupLocationOps interface {
	// CreateBackupLocation creates the BackupLocation
	CreateBackupLocation(*storkv1alpha1.BackupLocation) (*storkv1alpha1.BackupLocation, error)
	// GetBackupLocation gets the BackupLocation
	GetBackupLocation(string, string) (*storkv1alpha1.BackupLocation, error)
	// ListBackupLocations lists all the BackupLocations
	ListBackupLocations(string) (*storkv1alpha1.BackupLocationList, error)
	// UpdateBackupLocation updates the BackupLocation
	UpdateBackupLocation(*storkv1alpha1.BackupLocation) (*storkv1alpha1.BackupLocation, error)
	// DeleteBackupLocation deletes the BackupLocation
	DeleteBackupLocation(string, string) error
	// ValidateBackupLocation validates the BackupLocation
	ValidateBackupLocation(string, string, time.Duration, time.Duration) error
}

BackupLocationOps is an interface to perform k8s BackupLocation operations

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a wrapper for the stork operator client.

func New

New creates a new stork client.

func NewForConfig

func NewForConfig(c *rest.Config) (*Client, error)

NewForConfig creates a new stork client for the given config.

func (*Client) CreateApplicationBackup

func (c *Client) CreateApplicationBackup(backup *storkv1alpha1.ApplicationBackup) (*storkv1alpha1.ApplicationBackup, error)

CreateApplicationBackup creates the ApplicationBackup

func (*Client) CreateApplicationBackupSchedule

func (c *Client) CreateApplicationBackupSchedule(applicationBackupSchedule *storkv1alpha1.ApplicationBackupSchedule) (*storkv1alpha1.ApplicationBackupSchedule, error)

CreateApplicationBackupSchedule creates an ApplicationBackupSchedule

func (*Client) CreateApplicationClone

func (c *Client) CreateApplicationClone(clone *storkv1alpha1.ApplicationClone) (*storkv1alpha1.ApplicationClone, error)

CreateApplicationClone creates the ApplicationClone

func (*Client) CreateApplicationRegistration

func (c *Client) CreateApplicationRegistration(ApplicationRegistration *storkv1alpha1.ApplicationRegistration) (*storkv1alpha1.ApplicationRegistration, error)

CreateApplicationRegistration creates the ApplicationRegistration

func (*Client) CreateApplicationRestore

func (c *Client) CreateApplicationRestore(restore *storkv1alpha1.ApplicationRestore) (*storkv1alpha1.ApplicationRestore, error)

CreateApplicationRestore creates the ApplicationRestore

func (*Client) CreateBackupLocation

func (c *Client) CreateBackupLocation(backupLocation *storkv1alpha1.BackupLocation) (*storkv1alpha1.BackupLocation, error)

CreateBackupLocation creates the BackupLocation

func (*Client) CreateClusterDomainUpdate

func (c *Client) CreateClusterDomainUpdate(clusterDomainUpdate *storkv1alpha1.ClusterDomainUpdate) (*storkv1alpha1.ClusterDomainUpdate, error)

CreateClusterDomainUpdate creates the ClusterDomainUpdate

func (*Client) CreateClusterDomainsStatus

func (c *Client) CreateClusterDomainsStatus(clusterDomainsStatus *storkv1alpha1.ClusterDomainsStatus) (*storkv1alpha1.ClusterDomainsStatus, error)

CreateClusterDomainsStatus creates the ClusterDomainStatus

func (*Client) CreateClusterPair

func (c *Client) CreateClusterPair(pair *storkv1alpha1.ClusterPair) (*storkv1alpha1.ClusterPair, error)

CreateClusterPair creates the ClusterPair

func (*Client) CreateGroupSnapshot

CreateGroupSnapshot creates the given group snapshot

func (*Client) CreateMigration

func (c *Client) CreateMigration(migration *storkv1alpha1.Migration) (*storkv1alpha1.Migration, error)

CreateMigration creates the Migration

func (*Client) CreateMigrationSchedule

func (c *Client) CreateMigrationSchedule(migrationSchedule *storkv1alpha1.MigrationSchedule) (*storkv1alpha1.MigrationSchedule, error)

CreateMigrationSchedule creates a MigrationSchedule

func (*Client) CreateRule

func (c *Client) CreateRule(rule *storkv1alpha1.Rule) (*storkv1alpha1.Rule, error)

CreateRule creates the given stork rule

func (*Client) CreateSchedulePolicy

func (c *Client) CreateSchedulePolicy(schedulePolicy *storkv1alpha1.SchedulePolicy) (*storkv1alpha1.SchedulePolicy, error)

CreateSchedulePolicy creates a SchedulePolicy

func (*Client) CreateSnapshotSchedule

func (c *Client) CreateSnapshotSchedule(snapshotSchedule *storkv1alpha1.VolumeSnapshotSchedule) (*storkv1alpha1.VolumeSnapshotSchedule, error)

CreateSnapshotSchedule creates a SnapshotSchedule

func (*Client) CreateVolumeSnapshotRestore

func (c *Client) CreateVolumeSnapshotRestore(snapRestore *storkv1alpha1.VolumeSnapshotRestore) (*storkv1alpha1.VolumeSnapshotRestore, error)

CreateVolumeSnapshotRestore restore snapshot to pvc specifed in CRD, if no pvcs defined we restore to parent volumes

func (*Client) DeleteApplicationBackup

func (c *Client) DeleteApplicationBackup(name string, namespace string) error

DeleteApplicationBackup deletes the ApplicationBackup

func (*Client) DeleteApplicationBackupSchedule

func (c *Client) DeleteApplicationBackupSchedule(name string, namespace string) error

DeleteApplicationBackupSchedule deletes the ApplicationBackupSchedule

func (*Client) DeleteApplicationClone

func (c *Client) DeleteApplicationClone(name string, namespace string) error

DeleteApplicationClone deletes the ApplicationClone

func (*Client) DeleteApplicationRegistration

func (c *Client) DeleteApplicationRegistration(name string) error

DeleteApplicationRegistration deletes the ApplicationRegistration

func (*Client) DeleteApplicationRestore

func (c *Client) DeleteApplicationRestore(name string, namespace string) error

DeleteApplicationRestore deletes the ApplicationRestore

func (*Client) DeleteBackupLocation

func (c *Client) DeleteBackupLocation(name string, namespace string) error

DeleteBackupLocation deletes the BackupLocation

func (*Client) DeleteClusterDomainUpdate

func (c *Client) DeleteClusterDomainUpdate(name string) error

DeleteClusterDomainUpdate deletes the ClusterDomainUpdate

func (*Client) DeleteClusterDomainsStatus

func (c *Client) DeleteClusterDomainsStatus(name string) error

DeleteClusterDomainsStatus deletes the ClusterDomainsStatus

func (*Client) DeleteClusterPair

func (c *Client) DeleteClusterPair(name string, namespace string) error

DeleteClusterPair deletes the ClusterPair

func (*Client) DeleteGroupSnapshot

func (c *Client) DeleteGroupSnapshot(name, namespace string) error

DeleteGroupSnapshot deletes the group snapshot with the given name and namespace

func (*Client) DeleteMigration

func (c *Client) DeleteMigration(name string, namespace string) error

DeleteMigration deletes the Migration

func (*Client) DeleteMigrationSchedule

func (c *Client) DeleteMigrationSchedule(name string, namespace string) error

DeleteMigrationSchedule deletes the MigrationSchedule

func (*Client) DeleteRule

func (c *Client) DeleteRule(name, namespace string) error

DeleteRule deletes the given stork rule

func (*Client) DeleteSchedulePolicy

func (c *Client) DeleteSchedulePolicy(name string) error

DeleteSchedulePolicy deletes the SchedulePolicy

func (*Client) DeleteSnapshotSchedule

func (c *Client) DeleteSnapshotSchedule(name string, namespace string) error

DeleteSnapshotSchedule deletes the SnapshotSchedule

func (*Client) DeleteVolumeSnapshotRestore

func (c *Client) DeleteVolumeSnapshotRestore(name, namespace string) error

DeleteVolumeSnapshotRestore delete given volumesnapshotrestore CRD

func (*Client) GetApplicationBackup

func (c *Client) GetApplicationBackup(name string, namespace string) (*storkv1alpha1.ApplicationBackup, error)

GetApplicationBackup gets the ApplicationBackup

func (*Client) GetApplicationBackupSchedule

func (c *Client) GetApplicationBackupSchedule(name string, namespace string) (*storkv1alpha1.ApplicationBackupSchedule, error)

GetApplicationBackupSchedule gets the ApplicationBackupSchedule

func (*Client) GetApplicationClone

func (c *Client) GetApplicationClone(name string, namespace string) (*storkv1alpha1.ApplicationClone, error)

GetApplicationClone gets the ApplicationClone

func (*Client) GetApplicationRegistration

func (c *Client) GetApplicationRegistration(name string) (*storkv1alpha1.ApplicationRegistration, error)

GetApplicationRegistration gets the ApplicationRegistration

func (*Client) GetApplicationRestore

func (c *Client) GetApplicationRestore(name string, namespace string) (*storkv1alpha1.ApplicationRestore, error)

GetApplicationRestore gets the ApplicationRestore

func (*Client) GetBackupLocation

func (c *Client) GetBackupLocation(name string, namespace string) (*storkv1alpha1.BackupLocation, error)

GetBackupLocation gets the BackupLocation

func (*Client) GetClusterDomainUpdate

func (c *Client) GetClusterDomainUpdate(name string) (*storkv1alpha1.ClusterDomainUpdate, error)

GetClusterDomainUpdate gets the ClusterDomainUpdate

func (*Client) GetClusterDomainsStatus

func (c *Client) GetClusterDomainsStatus(name string) (*storkv1alpha1.ClusterDomainsStatus, error)

GetClusterDomainsStatus gets the ClusterDomainsStatus

func (*Client) GetClusterPair

func (c *Client) GetClusterPair(name string, namespace string) (*storkv1alpha1.ClusterPair, error)

GetClusterPair gets the ClusterPair

func (*Client) GetGroupSnapshot

func (c *Client) GetGroupSnapshot(name, namespace string) (*storkv1alpha1.GroupVolumeSnapshot, error)

GetGroupSnapshot returns the group snapshot for the given name and namespace

func (*Client) GetMigration

func (c *Client) GetMigration(name string, namespace string) (*storkv1alpha1.Migration, error)

GetMigration gets the Migration

func (*Client) GetMigrationSchedule

func (c *Client) GetMigrationSchedule(name string, namespace string) (*storkv1alpha1.MigrationSchedule, error)

GetMigrationSchedule gets the MigrationSchedule

func (*Client) GetRule

func (c *Client) GetRule(name, namespace string) (*storkv1alpha1.Rule, error)

GetRule fetches the given stork rule

func (*Client) GetSchedulePolicy

func (c *Client) GetSchedulePolicy(name string) (*storkv1alpha1.SchedulePolicy, error)

GetSchedulePolicy gets the SchedulePolicy

func (*Client) GetSnapshotSchedule

func (c *Client) GetSnapshotSchedule(name string, namespace string) (*storkv1alpha1.VolumeSnapshotSchedule, error)

GetSnapshotSchedule gets the SnapshotSchedule

func (*Client) GetSnapshotsForGroupSnapshot

func (c *Client) GetSnapshotsForGroupSnapshot(name, namespace string) ([]*snapv1.VolumeSnapshot, error)

GetSnapshotsForGroupSnapshot returns all child snapshots for the group snapshot

func (*Client) GetVolumeSnapshotRestore

func (c *Client) GetVolumeSnapshotRestore(name, namespace string) (*storkv1alpha1.VolumeSnapshotRestore, error)

GetVolumeSnapshotRestore returns details of given restore crd status

func (*Client) ListApplicationBackupSchedules

func (c *Client) ListApplicationBackupSchedules(namespace string) (*storkv1alpha1.ApplicationBackupScheduleList, error)

ListApplicationBackupSchedules lists all the ApplicationBackupSchedules

func (*Client) ListApplicationBackups

func (c *Client) ListApplicationBackups(namespace string) (*storkv1alpha1.ApplicationBackupList, error)

ListApplicationBackups lists all the ApplicationBackups

func (*Client) ListApplicationClones

func (c *Client) ListApplicationClones(namespace string) (*storkv1alpha1.ApplicationCloneList, error)

ListApplicationClones lists all the ApplicationClones

func (*Client) ListApplicationRegistrations

func (c *Client) ListApplicationRegistrations() (*storkv1alpha1.ApplicationRegistrationList, error)

ListApplicationRegistrations lists all the ApplicationRegistrations

func (*Client) ListApplicationRestores

func (c *Client) ListApplicationRestores(namespace string) (*storkv1alpha1.ApplicationRestoreList, error)

ListApplicationRestores lists all the ApplicationRestores

func (*Client) ListBackupLocations

func (c *Client) ListBackupLocations(namespace string) (*storkv1alpha1.BackupLocationList, error)

ListBackupLocations lists all the BackupLocations

func (*Client) ListClusterDomainStatuses

func (c *Client) ListClusterDomainStatuses() (*storkv1alpha1.ClusterDomainsStatusList, error)

ListClusterDomainStatuses lists ClusterDomainsStatus

func (*Client) ListClusterDomainUpdates

func (c *Client) ListClusterDomainUpdates() (*storkv1alpha1.ClusterDomainUpdateList, error)

ListClusterDomainUpdates lists ClusterDomainUpdates

func (*Client) ListClusterPairs

func (c *Client) ListClusterPairs(namespace string) (*storkv1alpha1.ClusterPairList, error)

ListClusterPairs gets all the ClusterPairs

func (*Client) ListGroupSnapshots

func (c *Client) ListGroupSnapshots(namespace string) (*storkv1alpha1.GroupVolumeSnapshotList, error)

ListGroupSnapshots lists all group snapshots for the given namespace

func (*Client) ListMigrationSchedules

func (c *Client) ListMigrationSchedules(namespace string) (*storkv1alpha1.MigrationScheduleList, error)

ListMigrationSchedules lists all the MigrationSchedules

func (*Client) ListMigrations

func (c *Client) ListMigrations(namespace string) (*storkv1alpha1.MigrationList, error)

ListMigrations lists all the Migrations

func (*Client) ListSchedulePolicies

func (c *Client) ListSchedulePolicies() (*storkv1alpha1.SchedulePolicyList, error)

ListSchedulePolicies lists all the SchedulePolicies

func (*Client) ListSnapshotSchedules

func (c *Client) ListSnapshotSchedules(namespace string) (*storkv1alpha1.VolumeSnapshotScheduleList, error)

ListSnapshotSchedules lists all the SnapshotSchedules

func (*Client) ListVolumeSnapshotRestore

func (c *Client) ListVolumeSnapshotRestore(namespace string) (*storkv1alpha1.VolumeSnapshotRestoreList, error)

ListVolumeSnapshotRestore return list of volumesnapshotrestores in given namespaces

func (*Client) SetConfig

func (c *Client) SetConfig(cfg *rest.Config)

SetConfig sets the config and resets the client

func (*Client) UpdateApplicationBackup

func (c *Client) UpdateApplicationBackup(backup *storkv1alpha1.ApplicationBackup) (*storkv1alpha1.ApplicationBackup, error)

UpdateApplicationBackup updates the ApplicationBackup

func (*Client) UpdateApplicationBackupSchedule

func (c *Client) UpdateApplicationBackupSchedule(applicationBackupSchedule *storkv1alpha1.ApplicationBackupSchedule) (*storkv1alpha1.ApplicationBackupSchedule, error)

UpdateApplicationBackupSchedule updates the ApplicationBackupSchedule

func (*Client) UpdateApplicationClone

func (c *Client) UpdateApplicationClone(clone *storkv1alpha1.ApplicationClone) (*storkv1alpha1.ApplicationClone, error)

UpdateApplicationClone updates the ApplicationClone

func (*Client) UpdateApplicationRegistration

func (c *Client) UpdateApplicationRegistration(ApplicationRegistration *storkv1alpha1.ApplicationRegistration) (*storkv1alpha1.ApplicationRegistration, error)

UpdateApplicationRegistration updates the ApplicationRegistration

func (*Client) UpdateApplicationRestore

func (c *Client) UpdateApplicationRestore(restore *storkv1alpha1.ApplicationRestore) (*storkv1alpha1.ApplicationRestore, error)

UpdateApplicationRestore updates the ApplicationRestore

func (*Client) UpdateBackupLocation

func (c *Client) UpdateBackupLocation(backupLocation *storkv1alpha1.BackupLocation) (*storkv1alpha1.BackupLocation, error)

UpdateBackupLocation updates the BackupLocation

func (*Client) UpdateClusterDomainUpdate

func (c *Client) UpdateClusterDomainUpdate(clusterDomainUpdate *storkv1alpha1.ClusterDomainUpdate) (*storkv1alpha1.ClusterDomainUpdate, error)

UpdateClusterDomainUpdate updates the ClusterDomainUpdate

func (*Client) UpdateClusterDomainsStatus

func (c *Client) UpdateClusterDomainsStatus(clusterDomainsStatus *storkv1alpha1.ClusterDomainsStatus) (*storkv1alpha1.ClusterDomainsStatus, error)

UpdateClusterDomainsStatus updates the ClusterDomainsStatus

func (*Client) UpdateClusterPair

func (c *Client) UpdateClusterPair(pair *storkv1alpha1.ClusterPair) (*storkv1alpha1.ClusterPair, error)

UpdateClusterPair updates the ClusterPair

func (*Client) UpdateGroupSnapshot

UpdateGroupSnapshot updates the given group snapshot

func (*Client) UpdateMigration

func (c *Client) UpdateMigration(migration *storkv1alpha1.Migration) (*storkv1alpha1.Migration, error)

UpdateMigration updates the Migration

func (*Client) UpdateMigrationSchedule

func (c *Client) UpdateMigrationSchedule(migrationSchedule *storkv1alpha1.MigrationSchedule) (*storkv1alpha1.MigrationSchedule, error)

UpdateMigrationSchedule updates the MigrationSchedule

func (*Client) UpdateRule

func (c *Client) UpdateRule(rule *storkv1alpha1.Rule) (*storkv1alpha1.Rule, error)

UpdateRule updates the given stork rule

func (*Client) UpdateSchedulePolicy

func (c *Client) UpdateSchedulePolicy(schedulePolicy *storkv1alpha1.SchedulePolicy) (*storkv1alpha1.SchedulePolicy, error)

UpdateSchedulePolicy updates the SchedulePolicy

func (*Client) UpdateSnapshotSchedule

func (c *Client) UpdateSnapshotSchedule(snapshotSchedule *storkv1alpha1.VolumeSnapshotSchedule) (*storkv1alpha1.VolumeSnapshotSchedule, error)

UpdateSnapshotSchedule updates the SnapshotSchedule

func (*Client) UpdateVolumeSnapshotRestore

func (c *Client) UpdateVolumeSnapshotRestore(snapRestore *storkv1alpha1.VolumeSnapshotRestore) (*storkv1alpha1.VolumeSnapshotRestore, error)

UpdateVolumeSnapshotRestore updates given volumesnapshorestore CRD

func (*Client) ValidateApplicationBackup

func (c *Client) ValidateApplicationBackup(name, namespace string, timeout, retryInterval time.Duration) error

ValidateApplicationBackup validates the ApplicationBackup

func (*Client) ValidateApplicationBackupSchedule

func (c *Client) ValidateApplicationBackupSchedule(name string, namespace string, expectedSuccess int, timeout, retryInterval time.Duration) (
	map[storkv1alpha1.SchedulePolicyType][]*storkv1alpha1.ScheduledApplicationBackupStatus, error)

ValidateApplicationBackupSchedule validates the given ApplicationBackupSchedule. It checks the status of each of the backups triggered for this schedule and returns a map of successfull backups. The key of the map will be the schedule type and value will be list of backups for that schedule type. The caller is expected to validate if the returned map has all backups expected at that point of time

func (*Client) ValidateApplicationClone

func (c *Client) ValidateApplicationClone(name, namespace string, timeout, retryInterval time.Duration) error

ValidateApplicationClone validates the ApplicationClone

func (*Client) ValidateApplicationRegistration

func (c *Client) ValidateApplicationRegistration(name string, timeout, retryInterval time.Duration) error

ValidateApplicationRegistration validates the ApplicationRegistration

func (*Client) ValidateApplicationRestore

func (c *Client) ValidateApplicationRestore(name, namespace string, timeout, retryInterval time.Duration) error

ValidateApplicationRestore validates the ApplicationRestore

func (*Client) ValidateBackupLocation

func (c *Client) ValidateBackupLocation(name, namespace string, timeout, retryInterval time.Duration) error

ValidateBackupLocation validates the BackupLocation

func (*Client) ValidateClusterDomainUpdate

func (c *Client) ValidateClusterDomainUpdate(name string, timeout, retryInterval time.Duration) error

ValidateClusterDomainUpdate validates ClusterDomainUpdate

func (*Client) ValidateClusterDomainsStatus

func (c *Client) ValidateClusterDomainsStatus(name string, domainMap map[string]bool, timeout, retryInterval time.Duration) error

ValidateClusterDomainsStatus validates the ClusterDomainsStatus

func (*Client) ValidateClusterPair

func (c *Client) ValidateClusterPair(name string, namespace string, timeout, retryInterval time.Duration) error

ValidateClusterPair validates clusterpair status

func (*Client) ValidateGroupSnapshot

func (c *Client) ValidateGroupSnapshot(name, namespace string, retry bool, timeout, retryInterval time.Duration) error

ValidateGroupSnapshot checks if the group snapshot with given name and namespace is in ready state

If retry is true, the validation will be retried with given timeout and retry internal

func (*Client) ValidateMigration

func (c *Client) ValidateMigration(name string, namespace string, timeout, retryInterval time.Duration) error

ValidateMigration validate the Migration status

func (*Client) ValidateMigrationSchedule

func (c *Client) ValidateMigrationSchedule(name string, namespace string, timeout, retryInterval time.Duration) (
	map[storkv1alpha1.SchedulePolicyType][]*storkv1alpha1.ScheduledMigrationStatus, error)

ValidateMigrationSchedule validates the given MigrationSchedule. It checks the status of each of the migrations triggered for this schedule and returns a map of successfull migrations. The key of the map will be the schedule type and value will be list of migrations for that schedule type. The caller is expected to validate if the returned map has all migrations expected at that point of time

func (*Client) ValidateSnapshotSchedule

func (c *Client) ValidateSnapshotSchedule(name string, namespace string, timeout, retryInterval time.Duration) (
	map[storkv1alpha1.SchedulePolicyType][]*storkv1alpha1.ScheduledVolumeSnapshotStatus, error)

ValidateSnapshotSchedule validates the given SnapshotSchedule. It checks the status of each of the snapshots triggered for this schedule and returns a map of successfull snapshots. The key of the map will be the schedule type and value will be list of snapshots for that schedule type. The caller is expected to validate if the returned map has all snapshots expected at that point of time

func (*Client) ValidateVolumeSnapshotRestore

func (c *Client) ValidateVolumeSnapshotRestore(name, namespace string, timeout, retryInterval time.Duration) error

ValidateVolumeSnapshotRestore validates given volumesnapshotrestore CRD

func (*Client) WatchApplicationBackup

func (c *Client) WatchApplicationBackup(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error

WatchApplicationBackup sets up a watcher that listens for changes on application backups

func (*Client) WatchApplicationClone

func (c *Client) WatchApplicationClone(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error

WatchApplicationClone sets up a watcher that listens for changes on application backups

func (*Client) WatchApplicationRestore

func (c *Client) WatchApplicationRestore(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error

WatchApplicationRestore sets up a watcher that listens for changes on application restores

func (*Client) WatchClusterPair

func (c *Client) WatchClusterPair(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error

WatchClusterPair sets up a watcher that listens for changes on cluster pair objects

func (*Client) WatchMigration

func (c *Client) WatchMigration(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error

WatchMigration sets up a watcher that listens for changes on migration objects

func (*Client) WatchStorkResources

func (c *Client) WatchStorkResources(namespace string, object runtime.Object) (watch.Interface, error)

WatchStorkResources sets up and return resource watch

type ClusterDomainsOps

type ClusterDomainsOps interface {
	// CreateClusterDomainsStatus creates the ClusterDomainStatus
	CreateClusterDomainsStatus(*storkv1alpha1.ClusterDomainsStatus) (*storkv1alpha1.ClusterDomainsStatus, error)
	// GetClusterDomainsStatus gets the ClusterDomainsStatus
	GetClusterDomainsStatus(string) (*storkv1alpha1.ClusterDomainsStatus, error)
	// UpdateClusterDomainsStatus updates the ClusterDomainsStatus
	UpdateClusterDomainsStatus(*storkv1alpha1.ClusterDomainsStatus) (*storkv1alpha1.ClusterDomainsStatus, error)
	// DeleteClusterDomainsStatus deletes the ClusterDomainsStatus
	DeleteClusterDomainsStatus(string) error
	// ListClusterDomainStatuses lists ClusterDomainsStatus
	ListClusterDomainStatuses() (*storkv1alpha1.ClusterDomainsStatusList, error)
	// ValidateClusterDomainsStatus validates the ClusterDomainsStatus
	ValidateClusterDomainsStatus(string, map[string]bool, time.Duration, time.Duration) error
	// CreateClusterDomainUpdate creates the ClusterDomainUpdate
	CreateClusterDomainUpdate(*storkv1alpha1.ClusterDomainUpdate) (*storkv1alpha1.ClusterDomainUpdate, error)
	// GetClusterDomainUpdate gets the ClusterDomainUpdate
	GetClusterDomainUpdate(string) (*storkv1alpha1.ClusterDomainUpdate, error)
	// UpdateClusterDomainUpdate updates the ClusterDomainUpdate
	UpdateClusterDomainUpdate(*storkv1alpha1.ClusterDomainUpdate) (*storkv1alpha1.ClusterDomainUpdate, error)
	// DeleteClusterDomainUpdate deletes the ClusterDomainUpdate
	DeleteClusterDomainUpdate(string) error
	// ValidateClusterDomainUpdate validates ClusterDomainUpdate
	ValidateClusterDomainUpdate(string, time.Duration, time.Duration) error
	// ListClusterDomainUpdates lists ClusterDomainUpdates
	ListClusterDomainUpdates() (*storkv1alpha1.ClusterDomainUpdateList, error)
}

ClusterDomainsOps is an interface to perform k8s ClusterDomains operations

type ClusterPairOps

type ClusterPairOps interface {
	// CreateClusterPair creates the ClusterPair
	CreateClusterPair(*storkv1alpha1.ClusterPair) (*storkv1alpha1.ClusterPair, error)
	// GetClusterPair gets the ClusterPair
	GetClusterPair(string, string) (*storkv1alpha1.ClusterPair, error)
	// ListClusterPairs gets all the ClusterPairs
	ListClusterPairs(string) (*storkv1alpha1.ClusterPairList, error)
	// UpdateClusterPair updates the ClusterPair
	UpdateClusterPair(*storkv1alpha1.ClusterPair) (*storkv1alpha1.ClusterPair, error)
	// DeleteClusterPair deletes the ClusterPair
	DeleteClusterPair(string, string) error
	// ValidateClusterPair validates clusterpair status
	ValidateClusterPair(string, string, time.Duration, time.Duration) error
	// WatchClusterPair watch the ClusterPair object
	WatchClusterPair(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error
}

ClusterPairOps is an interface to perfrom k8s ClusterPair operations

type GroupSnapshotOps

type GroupSnapshotOps interface {
	// GetGroupSnapshot returns the group snapshot for the given name and namespace
	GetGroupSnapshot(name, namespace string) (*storkv1alpha1.GroupVolumeSnapshot, error)
	// ListGroupSnapshots lists all group snapshots for the given namespace
	ListGroupSnapshots(namespace string) (*storkv1alpha1.GroupVolumeSnapshotList, error)
	// CreateGroupSnapshot creates the given group snapshot
	CreateGroupSnapshot(*storkv1alpha1.GroupVolumeSnapshot) (*storkv1alpha1.GroupVolumeSnapshot, error)
	// UpdateGroupSnapshot updates the given group snapshot
	UpdateGroupSnapshot(*storkv1alpha1.GroupVolumeSnapshot) (*storkv1alpha1.GroupVolumeSnapshot, error)
	// DeleteGroupSnapshot deletes the group snapshot with the given name and namespace
	DeleteGroupSnapshot(name, namespace string) error
	// ValidateGroupSnapshot checks if the group snapshot with given name and namespace is in ready state
	//  If retry is true, the validation will be retried with given timeout and retry internal
	ValidateGroupSnapshot(name, namespace string, retry bool, timeout, retryInterval time.Duration) error
	// GetSnapshotsForGroupSnapshot returns all child snapshots for the group snapshot
	GetSnapshotsForGroupSnapshot(name, namespace string) ([]*snapv1.VolumeSnapshot, error)
}

GroupSnapshotOps is an interface to perform k8s GroupVolumeSnapshot operations

type MigrationOps

type MigrationOps interface {
	// CreateMigration creates the Migration
	CreateMigration(*storkv1alpha1.Migration) (*storkv1alpha1.Migration, error)
	// GetMigration gets the Migration
	GetMigration(string, string) (*storkv1alpha1.Migration, error)
	// ListMigrations lists all the Migrations
	ListMigrations(string) (*storkv1alpha1.MigrationList, error)
	// UpdateMigration updates the Migration
	UpdateMigration(*storkv1alpha1.Migration) (*storkv1alpha1.Migration, error)
	// DeleteMigration deletes the Migration
	DeleteMigration(string, string) error
	// ValidateMigration validate the Migration status
	ValidateMigration(string, string, time.Duration, time.Duration) error
	// GetMigrationSchedule gets the MigrationSchedule
	GetMigrationSchedule(string, string) (*storkv1alpha1.MigrationSchedule, error)
	// CreateMigrationSchedule creates a MigrationSchedule
	CreateMigrationSchedule(*storkv1alpha1.MigrationSchedule) (*storkv1alpha1.MigrationSchedule, error)
	// UpdateMigrationSchedule updates the MigrationSchedule
	UpdateMigrationSchedule(*storkv1alpha1.MigrationSchedule) (*storkv1alpha1.MigrationSchedule, error)
	// ListMigrationSchedules lists all the MigrationSchedules
	ListMigrationSchedules(string) (*storkv1alpha1.MigrationScheduleList, error)
	// DeleteMigrationSchedule deletes the MigrationSchedule
	DeleteMigrationSchedule(string, string) error
	// ValidateMigrationSchedule validates the given MigrationSchedule. It checks the status of each of
	// the migrations triggered for this schedule and returns a map of successfull migrations. The key of the
	// map will be the schedule type and value will be list of migrations for that schedule type.
	// The caller is expected to validate if the returned map has all migrations expected at that point of time
	ValidateMigrationSchedule(string, string, time.Duration, time.Duration) (
		map[storkv1alpha1.SchedulePolicyType][]*storkv1alpha1.ScheduledMigrationStatus, error)
	// WatchMigration watch the Migration object
	WatchMigration(namespace string, fn WatchFunc, listOptions metav1.ListOptions) error
}

MigrationOps is an interface to perform k8s Migration operations

type Ops

type Ops interface {
	SnapshotScheduleOps
	GroupSnapshotOps
	RuleOps
	ClusterPairOps
	MigrationOps
	ClusterDomainsOps
	SchedulePolicyOps
	BackupLocationOps
	ApplicationBackupRestoreOps
	ApplicationCloneOps
	VolumeSnapshotRestoreOps
	ApplicationRegistrationOps

	// SetConfig sets the config and resets the client
	SetConfig(config *rest.Config)
	// WatchStorkResources sets up and return resource watch
	WatchStorkResources(string, runtime.Object) (watch.Interface, error)
}

Ops is an interface to Stork operations.

func Instance

func Instance() Ops

Instance returns a singleton instance of the client.

func NewInstanceFromConfigFile

func NewInstanceFromConfigFile(config string) (Ops, error)

NewInstanceFromConfigFile returns new instance of client by using given config file

type RuleOps

type RuleOps interface {
	// GetRule fetches the given stork rule
	GetRule(name, namespace string) (*storkv1alpha1.Rule, error)
	// CreateRule creates the given stork rule
	CreateRule(rule *storkv1alpha1.Rule) (*storkv1alpha1.Rule, error)
	// UpdateRule updates the given stork rule
	UpdateRule(rule *storkv1alpha1.Rule) (*storkv1alpha1.Rule, error)
	// DeleteRule deletes the given stork rule
	DeleteRule(name, namespace string) error
}

RuleOps is an interface to perform operations for k8s stork rule

type SchedulePolicyOps

type SchedulePolicyOps interface {
	// CreateSchedulePolicy creates a SchedulePolicy
	CreateSchedulePolicy(*storkv1alpha1.SchedulePolicy) (*storkv1alpha1.SchedulePolicy, error)
	// GetSchedulePolicy gets the SchedulePolicy
	GetSchedulePolicy(string) (*storkv1alpha1.SchedulePolicy, error)
	// ListSchedulePolicies lists all the SchedulePolicies
	ListSchedulePolicies() (*storkv1alpha1.SchedulePolicyList, error)
	// UpdateSchedulePolicy updates the SchedulePolicy
	UpdateSchedulePolicy(*storkv1alpha1.SchedulePolicy) (*storkv1alpha1.SchedulePolicy, error)
	// DeleteSchedulePolicy deletes the SchedulePolicy
	DeleteSchedulePolicy(string) error
}

SchedulePolicyOps is an interface to manage SchedulePolicy Object

type SnapshotScheduleOps

type SnapshotScheduleOps interface {
	// GetSnapshotSchedule gets the SnapshotSchedule
	GetSnapshotSchedule(string, string) (*storkv1alpha1.VolumeSnapshotSchedule, error)
	// CreateSnapshotSchedule creates a SnapshotSchedule
	CreateSnapshotSchedule(*storkv1alpha1.VolumeSnapshotSchedule) (*storkv1alpha1.VolumeSnapshotSchedule, error)
	// UpdateSnapshotSchedule updates the SnapshotSchedule
	UpdateSnapshotSchedule(*storkv1alpha1.VolumeSnapshotSchedule) (*storkv1alpha1.VolumeSnapshotSchedule, error)
	// ListSnapshotSchedules lists all the SnapshotSchedules
	ListSnapshotSchedules(string) (*storkv1alpha1.VolumeSnapshotScheduleList, error)
	// DeleteSnapshotSchedule deletes the SnapshotSchedule
	DeleteSnapshotSchedule(string, string) error
	// ValidateSnapshotSchedule validates the given SnapshotSchedule. It checks the status of each of
	// the snapshots triggered for this schedule and returns a map of successfull snapshots. The key of the
	// map will be the schedule type and value will be list of snapshots for that schedule type.
	// The caller is expected to validate if the returned map has all snapshots expected at that point of time
	ValidateSnapshotSchedule(string, string, time.Duration, time.Duration) (
		map[storkv1alpha1.SchedulePolicyType][]*storkv1alpha1.ScheduledVolumeSnapshotStatus, error)
}

SnapshotScheduleOps is an interface to perform k8s VolumeSnapshotSchedule operations

type VolumeSnapshotRestoreOps

type VolumeSnapshotRestoreOps interface {
	// CreateVolumeSnapshotRestore restore snapshot to pvc specifed in CRD, if no pvcs defined we restore to
	// parent volumes
	CreateVolumeSnapshotRestore(snap *storkv1alpha1.VolumeSnapshotRestore) (*storkv1alpha1.VolumeSnapshotRestore, error)
	// UpdateVolumeSnapshotRestore updates given volumesnapshorestore CRD
	UpdateVolumeSnapshotRestore(snap *storkv1alpha1.VolumeSnapshotRestore) (*storkv1alpha1.VolumeSnapshotRestore, error)
	// GetVolumeSnapshotRestore returns details of given restore crd status
	GetVolumeSnapshotRestore(name, namespace string) (*storkv1alpha1.VolumeSnapshotRestore, error)
	// ListVolumeSnapshotRestore return list of volumesnapshotrestores in given namespaces
	ListVolumeSnapshotRestore(namespace string) (*storkv1alpha1.VolumeSnapshotRestoreList, error)
	// DeleteVolumeSnapshotRestore delete given volumesnapshotrestore CRD
	DeleteVolumeSnapshotRestore(name, namespace string) error
	// ValidateVolumeSnapshotRestore validates given volumesnapshotrestore CRD
	ValidateVolumeSnapshotRestore(name, namespace string, timeout, retry time.Duration) error
}

VolumeSnapshotRestoreOps is interface to perform isnapshot restore using CRD

type WatchFunc

type WatchFunc func(object runtime.Object) error

WatchFunc is a callback provided to the Watch functions which is invoked when the given object is changed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL