cfbackup

package module
v0.1.158 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 26 Imported by: 10

README

cfbackup

Cloud Foundry Backup Utilities

wercker status

GoDoc

this repo is meant to be included in other projects. It will provide method calls for backing up Ops Manager and Elastic Runtime.

Running tests / build pipeline locally (docker-machine)


# install the wercker cli
$ curl -L https://install.wercker.com | sh

# make sure a docker host is running
$ docker-machine start default && eval $(docker-machine env default)

# run the build pipeline locally, to test your code locally
$ ./testrunner

Running tests / build pipeline locally (boot2docker)


# install the wercker cli
$ curl -L https://install.wercker.com | sh

# make sure a docker host is running
$ boot2docker up && $(boot2docker shellinit)

# run the build pipeline locally, to test your code locally
$ ./testrunner

Documentation

Index

Constants

View Source
const (
	//AccessKeyIDVarname - s3 key flag
	AccessKeyIDVarname = "S3_ACCESS_KEY_ID"
	//SecretAccessKeyVarname - s3 secret key
	SecretAccessKeyVarname = "S3_SECRET_ACCESS_KEY"
	//BucketNameVarname - bucket name var flag
	BucketNameVarname = "S3_BUCKET_NAME"
	//S3Domain - s3 domain value
	S3Domain = "S3_DOMAIN"
	//IsS3Varname - s3 persistence true|false
	IsS3Varname = "S3_ACTIVE"

	//NfsDirPath - this is where the nfs store lives
	NfsDirPath string = "/var/vcap/store"
	//NfsArchiveDir - this is the archive dir name
	NfsArchiveDir string = "shared"

	//ERDefaultSystemUser - default user for system vms
	ERDefaultSystemUser = "vcap"
	//ERDirectorInfoURL - url format for a director info endpoint
	ERDirectorInfoURL = "%s:25555/info"
	//ERBackupDir - default er backup dir
	ERBackupDir = "elasticruntime"
	//ERVmsURL - url format for a vms url
	ERVmsURL = "https://%s:25555/deployments/%s/vms"
	//ERDirector -- key
	ERDirector = "DirectorInfo"
	//ERConsole -- key
	ERConsole = "ConsoledbInfo"
	//ERUaa -- key
	ERUaa = "UaadbInfo"
	//ERCc -- key
	ERCc = "CcdbInfo"
	//ERMySQL -- key
	ERMySQL = "MysqldbInfo"
	//ERNfs -- key
	ERNfs = "NfsInfo"
	//ERBackupFileFormat -- format of archive filename
	ERBackupFileFormat = "%s.backup"
	//ERInvalidDirectorCredsMsg -- error message for invalid creds on director
	ERInvalidDirectorCredsMsg = "invalid director credentials"
	//ERNoPersistenceArchives -- error message for persistence stores
	ERNoPersistenceArchives = "there are no persistence stores in the list"
	//ERFileDoesNotExist -- error message for file does not exist
	ERFileDoesNotExist = "file does not exist"
	//ErrERDBBackupFailure -- error message for backup failure
	ErrERDBBackupFailure = "failed to backup database"
	//ERVersionEnvFlag -- env flag from ER version toggle
	ERVersionEnvFlag = "ER_VERSION"
	//ERVersion16 -- value for 1.6 toggle
	ERVersion16 = "1.6"

	//BackupLoggerName --
	BackupLoggerName = "Backup"
	//RestoreLoggerName --
	RestoreLoggerName = "Restore"

	//SDProduct --
	SDProduct string = "Product"
	//SDComponent --
	SDComponent string = "Component"
	//SDIdentity --
	SDIdentity string = "Identity"
	//SDIP --
	SDIP string = "Ip"
	//SDUser --
	SDUser string = "User"
	//SDPass --
	SDPass string = "Pass"
	//SDVcapUser --
	SDVcapUser string = "VcapUser"
	//SDVcapPass --
	SDVcapPass string = "VcapPass"
	//SDIdentifier
	SDIdentifier string = "Identifier"
)
View Source
const (
	//ImportArchive --
	ImportArchive = iota
	//ExportArchive --
	ExportArchive
)
View Source
const (
	BOSHError      int = 1
	BOSHProcessing int = 2
	BOSHDone       int = 3
	BOSHQueued     int = 4
)
View Source
const (
	NFSBackupTypeFull = "full"
	NFSBackupTypeLite = "lite"
	NFSBackupTypeBP   = "bp"
)

Variables

View Source
var (
	//NfsNewRemoteExecuter - this is a function which is able to execute a remote command against the nfs server
	NfsNewRemoteExecuter = command.NewRemoteExecutor

	//ErrERDirectorCreds - error for director creds
	ErrERDirectorCreds = errors.New(ERInvalidDirectorCredsMsg)
	//ErrEREmptyDBList - error for db list empty
	ErrEREmptyDBList = errors.New(ERNoPersistenceArchives)
	//ErrERInvalidPath - invalid filepath error
	ErrERInvalidPath = &os.PathError{Err: errors.New(ERFileDoesNotExist)}
	//ErrERDBBackup - error for db backup failures
	ErrERDBBackup = errors.New(ErrERDBBackupFailure)

	//TileRestoreAction -- executes a restore action on the given tile
	TileRestoreAction = func(t Tile) func() error {
		return t.Restore
	}
	//TileBackupAction - executes a backup action on a given tile
	TileBackupAction = func(t Tile) func() error {
		return t.Backup
	}
)
View Source
var TaskPingFreq = 1000 * time.Millisecond

Not ping server so frequently and exausted the resources

View Source
var Taskresult map[string]int = map[string]int{"error": BOSHError, "processing": BOSHProcessing, "done": BOSHDone, "queued": BOSHQueued}

Functions

func ExtractEncryptionKey

func ExtractEncryptionKey(dest io.Writer, deploymentDir string) (err error)

ExtractEncryptionKey - extract the encryptionKey from a deployment archive

func GetUploader added in v0.1.43

func GetUploader(backupContext BackupContext) (uploader httpUploader)

GetUploader - returns an uploader from a given backup context

Types

type AssignmentsAZ added in v0.1.96

type AssignmentsAZ map[string][]string

AssignmentsAZ - a map []string representing a list of az assignments

type AssignmentsJob added in v0.1.96

type AssignmentsJob map[string]AssignmentsAZ

AssignmentsJob - a map representing job assignments

type AssignmentsProduct added in v0.1.96

type AssignmentsProduct map[string]AssignmentsJob

AssignmentsProduct - a map string representing product assignments

type BackupContext

type BackupContext struct {
	TargetDir string
	IsS3      bool
	StorageProvider
}

BackupContext - stores the base context information for a backup/restore

func NewBackupContext added in v0.1.34

func NewBackupContext(targetDir string, env map[string]string, cryptKey string) (backupContext BackupContext)

NewBackupContext initializes a BackupContext

type Bosh added in v0.1.140

type Bosh interface {
	GetInfo() (io.ReadCloser, error)
	GetCloudControllerVMSet(name string) (io.ReadCloser, error)
	GetDeploymentManifest(deploymentName string) (io.ReadCloser, error)
	ChangeJobState(string, string, string, int) (int, error)
	RetrieveTaskStatus(int) (*Task, error)
}

type CCJob added in v0.1.2

type CCJob struct {
	Job   string
	Index int
}

CCJob - a cloud controller job object

func GetCCVMs

func GetCCVMs(jsonObj []VMObject) ([]CCJob, error)

GetCCVMs - a function to get a list of ccjobs

type CloudController

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

CloudController - a struct representing a cloud controller

func NewCloudController

func NewCloudController(ip, username, password, deploymentName string, cloudControllers CloudControllerJobs) (*CloudController, error)

NewCloudController - a function representing a constructor for a cloud controller

func (*CloudController) Start

func (c *CloudController) Start() error

Start - a method to execute a start event on a cloud controller

func (*CloudController) Stop

func (c *CloudController) Stop() error

Stop - a method which executes a stop against a cloud controller

type CloudControllerDeploymentParser

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

CloudControllerDeploymentParser - a struct which will handle the parsing of deployments

func (*CloudControllerDeploymentParser) Parse

func (s *CloudControllerDeploymentParser) Parse(jsonObj []VMObject) ([]CCJob, error)

Parse - a method which will parse a given vmobject array

type CloudControllerJobs

type CloudControllerJobs []CCJob

CloudControllerJobs - array storing a list of CCJobs

type ConfigurationParser added in v0.1.45

type ConfigurationParser struct {
	InstallationSettings InstallationSettings
}

ConfigurationParser - the parser to handle installation settings file parsing

func NewConfigurationParser added in v0.1.45

func NewConfigurationParser(installationFilePath string) *ConfigurationParser

NewConfigurationParser - constructor for a ConfigurationParser from a json installationsettings file

func NewConfigurationParserFromReader added in v0.1.49

func NewConfigurationParserFromReader(settings io.Reader) *ConfigurationParser

NewConfigurationParserFromReader - constructor for a ConfigurationParser from a json installationsettings file

func (*ConfigurationParser) FindByProductID added in v0.1.89

func (s *ConfigurationParser) FindByProductID(id string) (productResponse Products, err error)

FindByProductID finds a product by product id

func (*ConfigurationParser) FindCFPostgresJobs added in v0.1.73

func (s *ConfigurationParser) FindCFPostgresJobs() (jobs []Jobs)

FindCFPostgresJobs finds all the postgres jobs in the cf product

func (*ConfigurationParser) FindJobsByProductID added in v0.1.73

func (s *ConfigurationParser) FindJobsByProductID(id string) (jobs []Jobs)

FindJobsByProductID finds all the jobs in an installation by product id

func (*ConfigurationParser) GetIaaS added in v0.1.45

func (s *ConfigurationParser) GetIaaS() (config IaaSConfiguration, hasSSHKey bool)

GetIaaS - get the iaas elements from the installation settings

func (*ConfigurationParser) GetProducts added in v0.1.77

func (s *ConfigurationParser) GetProducts() (products []Products)

GetProducts - get the products array

type DirectorCreator added in v0.1.148

type DirectorCreator func(ip, username, password string, port int) (Bosh, error)

NewDirector - a function representing a constructor for a director object

var NewDirector DirectorCreator = func(ip, username, password string, port int) (Bosh, error) {

	if !regexp.MustCompile(`^([a-zA-Z][-+.a-zA-Z0-9]+:)?//`).MatchString(ip) {
		ip = "https://" + ip
	}
	return newBoshDirector(ip, username, password, port)
}

type DirectorInfo added in v0.1.73

type DirectorInfo struct {
	SystemInfo
	Database string
}

DirectorInfo - a struct representing a director systemdump implementation

func (*DirectorInfo) GetPersistanceBackup added in v0.1.73

func (s *DirectorInfo) GetPersistanceBackup() (dumper PersistanceBackup, err error)

GetPersistanceBackup - the constructor for a new DirectorInfo object

type DiskProvider added in v0.1.36

type DiskProvider struct {
	Directory string
}

DiskProvider is a storage provider that stores your Docker images on local disk.

func (*DiskProvider) Reader added in v0.1.36

func (d *DiskProvider) Reader(path ...string) (io.ReadCloser, error)

Reader returns an io.ReadCloser for the specified path

func (*DiskProvider) Writer added in v0.1.36

func (d *DiskProvider) Writer(path ...string) (io.WriteCloser, error)

Writer returns an io.WriteCloser for the specified path

type EncryptedStorageProvider added in v0.1.101

type EncryptedStorageProvider struct {
	EncryptionKey string
	// contains filtered or unexported fields
}

EncryptedStorageProvider - a storage provider wrapper that applies encryption

func NewEncryptedStorageProvider added in v0.1.101

func NewEncryptedStorageProvider(storageProvider StorageProvider, encryptionKey string) (encryptedStorageProvider *EncryptedStorageProvider, err error)

NewEncryptedStorageProvider - create a encrpyted wrapper for the given provider using the given encrpytion key. key lengths supported are 16, 24, 32 for AES-128, AES-192, or AES-256

func (*EncryptedStorageProvider) Reader added in v0.1.101

func (s *EncryptedStorageProvider) Reader(path ...string) (decryptReader io.ReadCloser, err error)

Reader - returns the encrpyted reader for the given path

func (*EncryptedStorageProvider) Writer added in v0.1.101

func (s *EncryptedStorageProvider) Writer(path ...string) (cryptWriter io.WriteCloser, err error)

Writer - returns the encrpyted writer for the given path

type IPAssignments added in v0.1.94

type IPAssignments struct {
	Assignments AssignmentsProduct `json:"assignments"`
}

IPAssignments - an object to house ip_assignments elements from the json

func (*IPAssignments) FindIPsByProductGUIDAndJobGUIDAndAvailabilityZoneGUID added in v0.1.94

func (s *IPAssignments) FindIPsByProductGUIDAndJobGUIDAndAvailabilityZoneGUID(productGUID, jobGUID string, azGUID string) (ips []string, err error)

FindIPsByProductGUIDAndJobGUIDAndAvailabilityZoneGUID - returns array of IPs based on product and job guids

type IaaSConfiguration added in v0.1.45

type IaaSConfiguration struct {
	SSHPrivateKey string `json:"ssh_private_key"`
}

IaaSConfiguration - a struct to house the IaaSConfiguration block elements from the json

type Infrastructure added in v0.1.45

type Infrastructure struct {
	Type       string            `json:"type"`
	IaaSConfig IaaSConfiguration `json:"iaas_configuration"`
}

Infrastructure - a struct to house Infrastructure block elements from the json

type InstallationInfo added in v0.1.123

type InstallationInfo interface {
	FindPropertyValues(productName, jobName, identifier string) (propertyMap map[string]string, err error)
	FindJobByProductAndJobName(productName, jobName string) (job Jobs, err error)
	FindVMCredentialsByProductAndJob(productName, jobName string) (vmCredentials VMCredentials, err error)
	FindIPsByProductAndJob(productName string, jobName string) (IPs []string, err error)
	FindByProductID(id string) (productResponse Products, err error)
	FindJobsByProductID(id string) []Jobs
	FindCFPostgresJobs() (jobs []Jobs)
}

InstallationInfo - inteferface for gettting at insallation info

type InstallationSettings added in v0.1.45

type InstallationSettings struct {
	Version        string         `json:"installation_schema_version"`
	Infrastructure Infrastructure `json:"infrastructure"`
	Products       []Products     `json:"products"`
	IPAssignments  IPAssignments  `json:"ip_assignments"`
}

InstallationSettings - an object to house installationsettings elements from the json

func (*InstallationSettings) FindByProductID added in v0.1.93

func (s *InstallationSettings) FindByProductID(id string) (productResponse Products, err error)

FindByProductID finds a product by product id

func (*InstallationSettings) FindCFPostgresJobs added in v0.1.93

func (s *InstallationSettings) FindCFPostgresJobs() (jobs []Jobs)

FindCFPostgresJobs finds all the postgres jobs in the cf product

func (*InstallationSettings) FindIPsByProductAndJob added in v0.1.94

func (s *InstallationSettings) FindIPsByProductAndJob(productName string, jobName string) (IPs []string, err error)

FindIPsByProductAndJob finds a product and jobName

func (*InstallationSettings) FindJobByProductAndJobName added in v0.1.96

func (s *InstallationSettings) FindJobByProductAndJobName(productName, jobName string) (job Jobs, err error)

FindJobByProductAndJobName gets job for a given product and jobName

func (*InstallationSettings) FindJobInstanceCount added in v0.1.120

func (s *InstallationSettings) FindJobInstanceCount(productID string, jobID string) int

FindJobInstanceCount find how many instances of a particular job

func (*InstallationSettings) FindJobsByProductID added in v0.1.93

func (s *InstallationSettings) FindJobsByProductID(id string) []Jobs

FindJobsByProductID finds all the jobs in an installation by product id

func (*InstallationSettings) FindPropertyValues added in v0.1.96

func (s *InstallationSettings) FindPropertyValues(productName, jobName, identifier string) (propertyMap map[string]string, err error)

FindPropertyValues - returns a map of property values for a given product, job and identifier

func (*InstallationSettings) FindVMCredentialsByProductAndJob added in v0.1.95

func (s *InstallationSettings) FindVMCredentialsByProductAndJob(productName, jobName string) (vmCredentials VMCredentials, err error)

FindVMCredentialsByProductAndJob gets VMCredentials for a given product and job

func (*InstallationSettings) GetBoshName added in v0.1.100

func (s *InstallationSettings) GetBoshName() (boshName string)

GetBoshName - returns name of BoshProduct

func (*InstallationSettings) SetPGDumpUtilVersions added in v0.1.100

func (s *InstallationSettings) SetPGDumpUtilVersions()

SetPGDumpUtilVersions - initializes the correct dump commands

type Instances added in v0.1.68

type Instances struct {
	Identifier string `json:"identifier"`
	Value      int    `json:"value"`
}

Instances contains instances for a job

type Jobs added in v0.1.68

type Jobs struct {
	Identifier       string                   `json:"identifier"`
	Properties       []Properties             `json:"properties"`
	Instances        []Instances              `json:"instances"`
	Instance         Instances                `json:"instance"` //this element replaces Instances in 1.7. keeping both for compatibility
	GUID             string                   `json:"guid"`
	InstallationName string                   `json:"installation_name"`
	Partitions       []Partition              `json:"partitions"`
	Resources        []map[string]interface{} `json:"resources"`
	VMCredentials    map[string]string        `json:"vm_credentials"`
}

Jobs contains job settings for a product

func (*Jobs) GetInstances added in v0.1.118

func (s *Jobs) GetInstances() (i []Instances)

type MysqlInfo

type MysqlInfo struct {
	SystemInfo
	Database string
}

MysqlInfo - a struct representing a mysql systemdump implementation

func (*MysqlInfo) GetPersistanceBackup

func (s *MysqlInfo) GetPersistanceBackup() (dumper PersistanceBackup, err error)

GetPersistanceBackup - the constructor for a new mysqlinfo object

type NFSBackup

type NFSBackup struct {
	Caller     command.Executer
	RemoteOps  remoteOpsInterface
	BackupType string
}

NFSBackup - this is a nfs backup object

func NewNFSBackup

func NewNFSBackup(username, password, ip, sslKey, remoteArchivePath, backupType string) (nfs *NFSBackup, err error)

NewNFSBackup - constructor for an nfsbackup object

func (*NFSBackup) Dump

func (s *NFSBackup) Dump(dest io.Writer) (err error)

Dump - will dump the output of a executed command to the given writer

func (*NFSBackup) Import

func (s *NFSBackup) Import(lfile io.Reader) (err error)

Import - will upload the contents of the given io.reader to the remote execution target and execute the restore command against the uploaded file.

type NfsInfo

type NfsInfo struct {
	SystemInfo
	BackupType string
}

NfsInfo - a struct representing a nfs systemdump implementation

func (*NfsInfo) GetPersistanceBackup

func (s *NfsInfo) GetPersistanceBackup() (dumper PersistanceBackup, err error)

GetPersistanceBackup - the constructor for a new nfsinfo object

type Partition added in v0.1.120

type Partition struct {
	JobReference              string `json:"job_reference"`
	InstallationName          string `json:"installation_name"`
	InstanceCount             int    `json:"instance_count"`
	AvailabilityZoneReference string `json:"availability_zone_reference"`
}

Partition partition for a job

type PersistanceBackup

type PersistanceBackup interface {
	Dump(io.Writer) error
	Import(io.Reader) error
}

PersistanceBackup - a struct representing a persistence backup

type PgInfo

type PgInfo struct {
	SystemInfo
	Database string
}

PgInfo - a struct representing a pgres systemdump implementation

func (*PgInfo) GetPersistanceBackup

func (s *PgInfo) GetPersistanceBackup() (dumper PersistanceBackup, err error)

GetPersistanceBackup - the constructor for a new pginfo object

type Products added in v0.1.68

type Products struct {
	Identifier                         string              `json:"identifier"`
	IPS                                map[string][]string `json:"ips"`
	Jobs                               []Jobs              `json:"jobs"`
	ProductVersion                     string              `json:"product_version"`
	AZReference                        []string            `json:"availability_zone_references"`
	DisabledPostDeployErrandNames      []string            `json:"disabled_post_deploy_errand_names"`
	DeploymentNetworkReference         string              `json:"deployment_network_reference"`
	GUID                               string              `json:"guid"`
	InfrastructureNetworkReference     string              `json:"infrastructure_network_reference"`
	InstallationName                   string              `json:"installation_name"`
	SingletonAvailabilityZoneReference string              `json:"singleton_availability_zone_reference"`
	Stemcell                           interface{}         `json:"stemcell"`
}

Products contains installation settings for a product

func (*Products) GetAvailabilityZoneNames added in v0.1.100

func (s *Products) GetAvailabilityZoneNames() (availablityZoneNames []string)

GetAvailabilityZoneNames - returns a list of availability zones

func (*Products) GetIPsByJob added in v0.1.91

func (s *Products) GetIPsByJob(jobname string) (ips []string)

GetIPsByJob - get array of ips for a job

func (*Products) GetJob added in v0.1.91

func (s *Products) GetJob(jobName string) (job Jobs, err error)

GetJob - get Job by name

func (*Products) GetPropertiesByJob added in v0.1.91

func (s *Products) GetPropertiesByJob(jobname string) (properties []Properties, err error)

GetPropertiesByJob - get array of []Properties for a job

func (*Products) GetPropertyValues added in v0.1.96

func (s *Products) GetPropertyValues(job Jobs, identifier string) (propertyMap map[string]string)

GetPropertyValues = returns a map of property values for an identifier

func (*Products) GetVMCredentialsByJob added in v0.1.91

func (s *Products) GetVMCredentialsByJob(jobName string) (vmCredentials VMCredentials, err error)

GetVMCredentialsByJob - returns VMCredentials for a job

type Properties added in v0.1.68

type Properties struct {
	Identifier string        `json:"identifier"`
	Value      PropertyValue `json:"value"`
}

Properties contains property settings for a job

type PropertyValue added in v0.1.108

type PropertyValue struct {
	ArrayValue  []interface{}
	MapValue    map[string]interface{}
	StringValue string
	IntValue    uint64
	BoolValue   bool
}

PropertyValue contains a composite value

func (*PropertyValue) UnmarshalJSON added in v0.1.108

func (p *PropertyValue) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON Custom handling of PropertyValue unmarshal UnmarshalJSON Custom handling of PropertyValue unmarshal

type S3Provider added in v0.1.36

type S3Provider struct {
	S3Domain        string
	BucketName      string
	AccessKeyID     string
	SecretAccessKey string
}

S3Provider is a storage provider that allows backups to be stored to an S3 compatible blobstore

func (*S3Provider) Reader added in v0.1.36

func (s *S3Provider) Reader(path ...string) (io.ReadCloser, error)

Reader for reading from an S3 bucket

func (*S3Provider) Writer added in v0.1.36

func (s *S3Provider) Writer(path ...string) (io.WriteCloser, error)

Writer for writing to an S3 bucket

type StorageProvider added in v0.1.36

type StorageProvider interface {
	Reader(path ...string) (io.ReadCloser, error)
	Writer(path ...string) (io.WriteCloser, error)
}

StorageProvider is responsible for obtaining/managing a reader/writer to a storage type (eg disk/s3)

func NewDiskProvider added in v0.1.36

func NewDiskProvider() StorageProvider

NewDiskProvider creates a new disk storage provider instance

func NewS3Provider added in v0.1.36

func NewS3Provider(domain, key, secret, bucket string) StorageProvider

NewS3Provider creates a new instance of the S3 storage provider

type StreamReadCloser added in v0.1.101

type StreamReadCloser struct {
	cipher.StreamReader
	io.Closer
}

StreamReadCloser - wrapper for a cipher.StreadReader to implement Closer interface as well

type SystemDump

type SystemDump interface {
	Error() error
	GetPersistanceBackup() (dumper PersistanceBackup, err error)
	// contains filtered or unexported methods
}

SystemDump - definition for a SystemDump interface

type SystemInfo

type SystemInfo struct {
	goutil.GetSet

	Product           string
	Component         string
	Identifier        string
	Ip                string
	User              string
	Pass              string
	VcapUser          string
	VcapPass          string
	SSHPrivateKey     string
	RemoteArchivePath string
	// contains filtered or unexported fields
}

SystemInfo - a struct representing a base systemdump implementation

func (*SystemInfo) Error

func (s *SystemInfo) Error() (err error)

Error - method making systeminfo implement the error interface

func (*SystemInfo) Get

func (s *SystemInfo) Get(name string) string

Get - a getter for a systeminfo object

func (*SystemInfo) GetPersistanceBackup

func (s *SystemInfo) GetPersistanceBackup() (dumper PersistanceBackup, err error)

GetPersistanceBackup - the constructor for a systeminfo object

func (*SystemInfo) Set

func (s *SystemInfo) Set(name string, val string)

Set - a setter for a systeminfo object

type SystemsInfo added in v0.1.61

type SystemsInfo struct {
	SystemDumps map[string]SystemDump
}

SystemsInfo holds the values for all the supported SystemDump used by an installation

func NewSystemsInfo added in v0.1.61

func NewSystemsInfo(installationSettingsFile string, sshKey string, nfs string) SystemsInfo

NewSystemsInfo creates a map of SystemDumps that are configured based on the installation settings fetched from ops manager

func (SystemsInfo) PersistentSystems added in v0.1.61

func (s SystemsInfo) PersistentSystems() []SystemDump

PersistentSystems returns a slice of all the jobs that need to be backed up

type Task added in v0.1.140

type Task struct {
	Id          int    `json:"id"`
	State       string `json:"state"`
	Description string `json:"description"`
	Result      string `json:"result"`
}

type Tile

type Tile interface {
	Backup() error
	Restore() error
}

Tile is a deployable component that can be backed up

type VMCredentials added in v0.1.91

type VMCredentials struct {
	UserID   string
	Password string
	SSLKey   string
}

VMCredentials contains property settings for a job

type VMObject

type VMObject struct {
	Job   string
	Index int
}

VMObject - a struct representing a vm

func ReadAndUnmarshalVMObjects

func ReadAndUnmarshalVMObjects(src io.Reader) (jsonObj []VMObject, err error)

ReadAndUnmarshalVMObjects - read the io.reader and unmarshal its contents into an vmobject array

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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