Example #1
0
func NewMysqlDump(ip, username, password string) *MysqlDump {
	m := &MysqlDump{
		Ip:       ip,
		Username: username,
		Password: password,
		Caller:   command.NewLocalExecuter(),
	}
	return m
}
Example #2
0
func NewPgDump(ip string, port int, database, username, password string) *PgDump {
	return &PgDump{
		Ip:       ip,
		Port:     port,
		Database: database,
		Username: username,
		Password: password,
		Caller:   command.NewLocalExecuter(),
	}
}
Example #3
0
func NewMysqlDump(ip, username, password string) *MysqlDump {
	lo.G.Debug("setting up a new local mysqldump object")
	m := &MysqlDump{
		Ip:       ip,
		Username: username,
		Password: password,
		Caller:   command.NewLocalExecuter(),
	}
	return m
}
Example #4
0
		assetsMultiHttpRequestor := ghttp.MultiPartUpload

		context = &OpsManager{
			SettingsUploader:  settingsMultiHttpRequestor,
			AssetsUploader:    assetsMultiHttpRequestor,
			SettingsRequestor: settingsHttpRequestor,
			AssetsRequestor:   assetsHttpRequestor,
			DeploymentDir:     path.Join(target, OPSMGR_BACKUP_DIR, OPSMGR_DEPLOYMENTS_DIR),
			Hostname:          opsManagerHostname,
			Username:          adminUsername,
			Password:          adminPassword,
			BackupContext: BackupContext{
				TargetDir: target,
			},
			Executer:            remoteExecuter,
			LocalExecuter:       command.NewLocalExecuter(),
			OpsmanagerBackupDir: OPSMGR_BACKUP_DIR,
			Logger:              logger,
		}
	}
	return
}

// Backup performs a backup of a Pivotal Ops Manager instance
func (context *OpsManager) Backup() (err error) {
	if err = context.copyDeployments(); err == nil {
		err = context.exportAndExtract()
	}
	return
}