Documentation
¶
Index ¶
Constants ¶
const ( //ERDefaultSystemUser - default user for system vms ERDefaultSystemUser = "vcap" //ERDirectorInfoURL - url format for a director info endpoint ERDirectorInfoURL = "https://%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" )
Variables ¶
var ( //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) )
var GetInstallationSettings = func(tileSpec tileregistry.TileSpec) (settings io.Reader, err error) { var ( opsManager *opsmanager.OpsManager ) if opsManager, err = opsmanager.NewOpsManager(tileSpec.OpsManagerHost, tileSpec.AdminUser, tileSpec.AdminPass, tileSpec.OpsManagerUser, tileSpec.OpsManagerPass, tileSpec.ArchiveDirectory); err == nil { settings, err = opsManager.GetInstallationSettings() } return }
GetInstallationSettings - makes a call to ops manager and returns a io.reader containing the contents of the installation settings file.
var NewElasticRuntime = func(jsonFile string, target string, sshKey string) *ElasticRuntime { systemsInfo := cfbackup.NewSystemsInfo(jsonFile, sshKey) context := &ElasticRuntime{ SSHPrivateKey: sshKey, JSONFile: jsonFile, BackupContext: cfbackup.NewBackupContext(target, cfenv.CurrentEnv()), SystemsInfo: systemsInfo, PersistentSystems: systemsInfo.PersistentSystems(), } return context }
NewElasticRuntime initializes an ElasticRuntime intance
Functions ¶
This section is empty.
Types ¶
type ElasticRuntime ¶
type ElasticRuntime struct { cfbackup.BackupContext JSONFile string SystemsInfo cfbackup.SystemsInfo PersistentSystems []cfbackup.SystemDump HTTPGateway ghttp.HttpGateway InstallationName string SSHPrivateKey string }
ElasticRuntime contains information about a Pivotal Elastic Runtime deployment
func (*ElasticRuntime) Backup ¶
func (context *ElasticRuntime) Backup() (err error)
Backup performs a backup of a Pivotal Elastic Runtime deployment
func (*ElasticRuntime) ReadAllUserCredentials ¶
func (context *ElasticRuntime) ReadAllUserCredentials() (err error)
ReadAllUserCredentials - get all user creds from the installation json
func (*ElasticRuntime) Restore ¶
func (context *ElasticRuntime) Restore() (err error)
Restore performs a restore of a Pivotal Elastic Runtime deployment
func (*ElasticRuntime) RunDbAction ¶
func (context *ElasticRuntime) RunDbAction(dbInfoList []cfbackup.SystemDump, action int) (err error)
RunDbAction - run a db action dump/import against a list of systemdump types
type ElasticRuntimeBuilder ¶
type ElasticRuntimeBuilder struct{}
ElasticRuntimeBuilder -- an object that can build an elastic runtime pre-initialized
func (*ElasticRuntimeBuilder) New ¶
func (s *ElasticRuntimeBuilder) New(tileSpec tileregistry.TileSpec) (elasticRuntime tileregistry.Tile, err error)
New -- method to generate an initialized elastic runtime