func NewMysqlDump(ip, username, password string) *MysqlDump { m := &MysqlDump{ Ip: ip, Username: username, Password: password, Caller: command.NewLocalExecuter(), } return m }
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(), } }
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 }
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 }