instance

package
v1.9.47 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Logger
	// contains filtered or unexported fields
}

func NewBackupArtifact

func NewBackupArtifact(job orchestrator.Job, instance orchestrator.InstanceIdentifer, remoteRunner ssh.RemoteRunner, logger Logger) *Artifact

func NewRestoreArtifact

func NewRestoreArtifact(job orchestrator.Job, instance orchestrator.InstanceIdentifer, remoteRunner ssh.RemoteRunner, logger Logger) *Artifact

func (*Artifact) Checksum

func (b *Artifact) Checksum() (orchestrator.BackupChecksum, error)

func (*Artifact) Delete

func (b *Artifact) Delete() error

func (*Artifact) HasCustomName

func (b *Artifact) HasCustomName() bool

func (*Artifact) InstanceID

func (b *Artifact) InstanceID() string

func (*Artifact) InstanceIndex

func (b *Artifact) InstanceIndex() string

func (*Artifact) InstanceName

func (b *Artifact) InstanceName() string

func (*Artifact) Name

func (b *Artifact) Name() string

func (*Artifact) Size

func (b *Artifact) Size() (string, error)

func (*Artifact) SizeInBytes added in v1.7.2

func (b *Artifact) SizeInBytes() (int, error)

func (*Artifact) StreamFromRemote

func (b *Artifact) StreamFromRemote(writer io.Writer) error

func (*Artifact) StreamToRemote

func (b *Artifact) StreamToRemote(reader io.Reader) error

type BackupAndRestoreScripts

type BackupAndRestoreScripts []Script

func NewBackupAndRestoreScripts

func NewBackupAndRestoreScripts(files []string) BackupAndRestoreScripts

func (BackupAndRestoreScripts) BackupOnly

func (BackupAndRestoreScripts) HasBackup

func (s BackupAndRestoreScripts) HasBackup() bool

func (BackupAndRestoreScripts) MetadataOnly

func (BackupAndRestoreScripts) PostBackupUnlockOnly

func (s BackupAndRestoreScripts) PostBackupUnlockOnly() BackupAndRestoreScripts

func (BackupAndRestoreScripts) PreBackupLockOnly

func (s BackupAndRestoreScripts) PreBackupLockOnly() BackupAndRestoreScripts

func (BackupAndRestoreScripts) PreRestoreLockOnly

func (s BackupAndRestoreScripts) PreRestoreLockOnly() BackupAndRestoreScripts

func (BackupAndRestoreScripts) RestoreOnly

func (BackupAndRestoreScripts) SinglePostRestoreUnlockScript

func (s BackupAndRestoreScripts) SinglePostRestoreUnlockScript() Script

type DeployedInstance

type DeployedInstance struct {
	Logger
	// contains filtered or unexported fields
}

func NewDeployedInstance

func NewDeployedInstance(instanceIndex string, instanceGroupName string, instanceID string, artifactDirCreated bool, remoteRunner ssh.RemoteRunner, logger Logger, jobs orchestrator.Jobs) *DeployedInstance

func (*DeployedInstance) ArtifactDirCreated

func (i *DeployedInstance) ArtifactDirCreated() bool

func (*DeployedInstance) ArtifactDirExists

func (i *DeployedInstance) ArtifactDirExists() (bool, error)

func (*DeployedInstance) ArtifactsToBackup

func (i *DeployedInstance) ArtifactsToBackup() []orchestrator.BackupArtifact

func (*DeployedInstance) ArtifactsToRestore

func (i *DeployedInstance) ArtifactsToRestore() []orchestrator.BackupArtifact

func (*DeployedInstance) Backup

func (i *DeployedInstance) Backup() error

func (*DeployedInstance) ConnectedUsername

func (i *DeployedInstance) ConnectedUsername() string

func (*DeployedInstance) HasMetadataRestoreNames

func (i *DeployedInstance) HasMetadataRestoreNames() bool

func (*DeployedInstance) ID

func (i *DeployedInstance) ID() string

func (*DeployedInstance) Index

func (i *DeployedInstance) Index() string

func (*DeployedInstance) IsBackupable

func (i *DeployedInstance) IsBackupable() bool

func (*DeployedInstance) IsRestorable

func (i *DeployedInstance) IsRestorable() bool

func (*DeployedInstance) Jobs

func (i *DeployedInstance) Jobs() []orchestrator.Job

func (*DeployedInstance) MarkArtifactDirCreated

func (i *DeployedInstance) MarkArtifactDirCreated()

func (*DeployedInstance) Name

func (i *DeployedInstance) Name() string

func (*DeployedInstance) RemoveArtifactDir

func (i *DeployedInstance) RemoveArtifactDir() error

func (*DeployedInstance) Restore

func (i *DeployedInstance) Restore() error

type InstanceIdentifier

type InstanceIdentifier struct {
	InstanceGroupName string
	InstanceId        string
	Bootstrap         bool
}

func (InstanceIdentifier) String

func (i InstanceIdentifier) String() string

type Job

type Job struct {
	Logger Logger
	// contains filtered or unexported fields
}

func NewJob

func NewJob(remoteRunner ssh.RemoteRunner, instanceIdentifier string, logger Logger, release string, jobScripts BackupAndRestoreScripts, metadata Metadata, backupOneRestoreAll bool, onBootstrapNode bool) Job

func (Job) Backup

func (j Job) Backup() error

func (Job) BackupArtifactDirectory

func (j Job) BackupArtifactDirectory() string

func (Job) BackupArtifactName

func (j Job) BackupArtifactName() string

func (Job) BackupShouldBeLockedBefore

func (j Job) BackupShouldBeLockedBefore() []orchestrator.JobSpecifier

func (Job) HasBackup

func (j Job) HasBackup() bool

func (Job) HasMetadataRestoreName

func (j Job) HasMetadataRestoreName() bool

func (Job) HasNamedBackupArtifact

func (j Job) HasNamedBackupArtifact() bool

func (Job) HasNamedRestoreArtifact

func (j Job) HasNamedRestoreArtifact() bool

func (Job) HasRestore

func (j Job) HasRestore() bool

func (Job) InstanceIdentifier

func (j Job) InstanceIdentifier() string

func (Job) Name

func (j Job) Name() string

func (Job) PostBackupUnlock

func (j Job) PostBackupUnlock(afterSuccessfulBackup bool) error

func (Job) PostRestoreUnlock

func (j Job) PostRestoreUnlock() error

func (Job) PreBackupLock

func (j Job) PreBackupLock() error

func (Job) PreRestoreLock

func (j Job) PreRestoreLock() error

func (Job) Release

func (j Job) Release() string

func (Job) Restore

func (j Job) Restore() error

func (Job) RestoreArtifactDirectory

func (j Job) RestoreArtifactDirectory() string

func (Job) RestoreArtifactName

func (j Job) RestoreArtifactName() string

func (Job) RestoreScript

func (j Job) RestoreScript() Script

func (Job) RestoreShouldBeLockedBefore

func (j Job) RestoreShouldBeLockedBefore() []orchestrator.JobSpecifier

type JobFinder

type JobFinder interface {
	FindJobs(instanceIdentifier InstanceIdentifier, remoteRunner ssh.RemoteRunner, manifestQuerier ManifestQuerier) (orchestrator.Jobs, error)
}

type JobFinderFromScripts

type JobFinderFromScripts struct {
	Logger Logger
	// contains filtered or unexported fields
}

func NewJobFinder

func NewJobFinder(bbrVersion string, logger Logger) *JobFinderFromScripts

func NewJobFinderOmitMetadataReleases

func NewJobFinderOmitMetadataReleases(bbrVersion string, logger Logger) *JobFinderFromScripts

func (*JobFinderFromScripts) FindJobs

func (j *JobFinderFromScripts) FindJobs(instanceIdentifier InstanceIdentifier, remoteRunner ssh.RemoteRunner,
	manifestQuerier ManifestQuerier) (orchestrator.Jobs, error)

type LockBefore

type LockBefore struct {
	JobName string `yaml:"job_name"`
	Release string `yaml:"release"`
}

func (LockBefore) Validate

func (l LockBefore) Validate() error

type Logger

type Logger interface {
	Debug(tag, msg string, args ...interface{})
	Info(tag, msg string, args ...interface{})
	Warn(tag, msg string, args ...interface{})
	Error(tag, msg string, args ...interface{})
}

type ManifestQuerier

type ManifestQuerier interface {
	FindReleaseName(instanceGroupName, jobName string) (string, error)
	IsJobBackupOneRestoreAll(instanceGroupName, jobName string) (bool, error)
}

func NewNoopManifestQuerier

func NewNoopManifestQuerier() ManifestQuerier

type ManifestQuerierCreator

type ManifestQuerierCreator func(manifest string) (ManifestQuerier, error)

type Metadata

type Metadata struct {
	BackupName                  string       `yaml:"backup_name"`
	RestoreName                 string       `yaml:"restore_name"`
	BackupShouldBeLockedBefore  []LockBefore `yaml:"backup_should_be_locked_before"`
	RestoreShouldBeLockedBefore []LockBefore `yaml:"restore_should_be_locked_before"`
	SkipBBRScripts              bool         `yaml:"skip_bbr_scripts"`
}

func ParseJobMetadata

func ParseJobMetadata(data string) (*Metadata, error)

func ParseJobMetadataOmitReleases

func ParseJobMetadataOmitReleases(data string) (*Metadata, error)

type MetadataParserFunc

type MetadataParserFunc func(string) (*Metadata, error)

type Script

type Script string

func (Script) JobName

func (s Script) JobName() string

func (Script) Name

func (script Script) Name() string

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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