Exemple #1
0
		var (
			err error
			fs  = &flagSet{
				host:           c.String(flagList[opsManagerHost].Flag[0]),
				adminUser:      c.String(flagList[adminUser].Flag[0]),
				adminPass:      c.String(flagList[adminPass].Flag[0]),
				opsManagerUser: c.String(flagList[opsManagerUser].Flag[0]),
				opsManagerPass: c.String(flagList[opsManagerPass].Flag[0]),
				dest:           c.String(flagList[dest].Flag[0]),
				tilelist:       c.String(flagList[tilelist].Flag[0]),
			}
		)

		if hasValidBackupRestoreFlags(fs) {
			cfops.SetupSupportedTiles(fs)
			err = cfops.RunPipeline(fs, cfops.Restore)

			if err != nil {
				fmt.Println(err)
				ExitCode = errExitCode

			} else {
				fmt.Println(restore_full_name, " completed successfully.")
			}

		} else {
			cli.ShowCommandHelp(c, restore_full_name)
			ExitCode = helpExitCode
		}
	},
}
Exemple #2
0
	Flags:       backupRestoreFlags,
	Action: func(c *cli.Context) {
		var (
			err error
			fs  = &flagSet{
				host:     c.String(hostflag[0]),
				user:     c.String(userflag[0]),
				pass:     c.String(passflag[0]),
				tpass:    c.String(tpassflag[0]),
				dest:     c.String(destflag[0]),
				tilelist: c.String(tilelistflag[0]),
			}
		)

		if hasValidBackupRestoreFlags(fs) {
			cfops.SetupSupportedTiles(fs)
			err = cfops.RunPipeline(fs, cfops.Backup)

		} else {
			cli.ShowCommandHelp(c, backup_full_name)
		}

		if err != nil {
			fmt.Println(err)

		} else {
			fmt.Println(backup_full_name, " completed successfully.")
		}
	},
}