Esempio n. 1
0
func updateAppMemory(cmd *cobra.Command, args []string) {
	if cli.EvalPrintUsage(Usage(cmd), args, 2) {
		os.Exit(1)
	}

	wait, _ := cmd.Flags().GetBool(WAIT_FLAG)
	mem, err := strconv.ParseFloat(args[1], 64)

	if err != nil {
		cli.Output(nil, err)
		os.Exit(1)
	}
	update := marathon.NewApplication(args[0]).Memory(mem)
	v, e := client(cmd).UpdateApplication(update, wait)
	cli.Output(templateFor(T_APPLICATION, v), e)
}
Esempio n. 2
0
func rollbackAppVersion(cmd *cobra.Command, args []string) {
	if cli.EvalPrintUsage(Usage(cmd), args, 1) {
		os.Exit(1)
	}

	wait, _ := cmd.Flags().GetBool(WAIT_FLAG)
	version := ""

	if len(args) > 1 {
		version = args[1]
	} else {
		versions, e := client(cmd).ListVersions(args[0])
		if e == nil && len(versions.Versions) > 1 {
			version = versions.Versions[1]
		}
	}
	update := marathon.NewApplication(args[0]).RollbackVersion(version)
	v, e := client(cmd).UpdateApplication(update, wait)
	cli.Output(templateFor(T_APPLICATION, v), e)
}