示例#1
0
文件: mysqldump.go 项目: rdrew4/cfops
func NewMysqlDump(ip, username, password string) *MysqlDump {
	m := &MysqlDump{
		Ip:       ip,
		Username: username,
		Password: password,
		Caller:   command.NewLocalExecuter(),
	}
	return m
}
示例#2
0
文件: pgdump.go 项目: rdrew4/cfops
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(),
	}
}
示例#3
0
文件: mysqldump.go 项目: krujos/cfops
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
}
示例#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
}