當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Backend.Destroy方法代碼示例

本文整理匯總了Golang中github.com/deis/deis/deisctl/backend.Backend.Destroy方法的典型用法代碼示例。如果您正苦於以下問題:Golang Backend.Destroy方法的具體用法?Golang Backend.Destroy怎麽用?Golang Backend.Destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/deis/deis/deisctl/backend.Backend的用法示例。


在下文中一共展示了Backend.Destroy方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Uninstall

// Uninstall unloads the definitions of the specified components.
// After Uninstall, the components will be unavailable until Install is called.
func Uninstall(targets []string, b backend.Backend) error {
	if len(targets) == 1 {
		if targets[0] == PlatformCommand {
			return UninstallPlatform(b, false)
		} else if targets[0] == StatelessPlatformCommand {
			return UninstallPlatform(b, true)
		} else if targets[0] == swarm {
			return UnInstallSwarm(b)
		}
	}

	outchan := make(chan string)
	errchan := make(chan error)
	var wg sync.WaitGroup

	go printState(outchan, errchan, 500*time.Millisecond)

	// uninstall the specific target
	b.Destroy(targets, &wg, outchan, errchan)
	wg.Wait()
	close(outchan)
	close(errchan)

	return nil
}
開發者ID:bladealslayer,項目名稱:deis,代碼行數:27,代碼來源:cmd.go

示例2: Uninstall

// Uninstall unloads the definitions of the specified components.
// After Uninstall, the components will be unavailable until Install is called.
func Uninstall(argv []string, b backend.Backend) error {
	usage := `Unloads the definitions of the specified components.

After uninstall, the components will be unavailable until install is called.

Usage:
  deisctl uninstall [<target>...] [options]
`
	// parse command-line arguments
	args, err := docopt.Parse(usage, argv, true, "", false)
	if err != nil {
		return err
	}

	// if target is platform, uninstall all services
	targets := args["<target>"].([]string)
	if len(targets) == 1 && targets[0] == PlatformCommand {
		return UninstallPlatform(b)
	}

	outchan := make(chan string)
	errchan := make(chan error)
	var wg sync.WaitGroup

	go printState(outchan, errchan, 500*time.Millisecond)

	// uninstall the specific target
	b.Destroy(targets, &wg, outchan, errchan)
	wg.Wait()
	close(outchan)

	return nil
}
開發者ID:pombredanne,項目名稱:deo,代碼行數:35,代碼來源:cmd.go

示例3: doUpgradeTakeOver

func doUpgradeTakeOver(stateless bool, b backend.Backend, cb config.Backend) error {
	var wg sync.WaitGroup

	nodes, err := listPublishedServices(cb)
	if err != nil {
		return err
	}

	b.Stop([]string{"publisher"}, &wg, Stdout, Stderr)
	wg.Wait()
	b.Destroy([]string{"publisher"}, &wg, Stdout, Stderr)
	wg.Wait()

	if err := republishServices(1800, nodes, cb); err != nil {
		return err
	}

	b.RollingRestart("router", &wg, Stdout, Stderr)
	wg.Wait()
	b.Create([]string{"publisher"}, &wg, Stdout, Stderr)
	wg.Wait()
	b.Start([]string{"publisher"}, &wg, Stdout, Stderr)
	wg.Wait()

	installUpgradeServices(b, stateless, &wg, Stdout, Stderr)
	wg.Wait()

	startUpgradeServices(b, stateless, &wg, Stdout, Stderr)
	wg.Wait()
	return nil
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:31,代碼來源:upgrade.go

示例4: UpgradePrep

// UpgradePrep stops and uninstalls all components except router and publisher
func UpgradePrep(stateless bool, b backend.Backend) error {
	var wg sync.WaitGroup

	b.Stop([]string{"database", "[email protected]*", "controller", "builder", "logger", "logspout"}, &wg, Stdout, Stderr)
	wg.Wait()
	b.Destroy([]string{"database", "[email protected]*", "controller", "builder", "logger", "logspout"}, &wg, Stdout, Stderr)
	wg.Wait()

	if !stateless {
		b.Stop([]string{"store-volume", "[email protected]*"}, &wg, Stdout, Stderr)
		wg.Wait()
		b.Destroy([]string{"store-volume", "[email protected]*"}, &wg, Stdout, Stderr)
		wg.Wait()

		b.Stop([]string{"store-metadata"}, &wg, Stdout, Stderr)
		wg.Wait()
		b.Destroy([]string{"store-metadata"}, &wg, Stdout, Stderr)
		wg.Wait()

		b.Stop([]string{"store-daemon"}, &wg, Stdout, Stderr)
		wg.Wait()
		b.Destroy([]string{"store-daemon"}, &wg, Stdout, Stderr)
		wg.Wait()

		b.Stop([]string{"store-monitor"}, &wg, Stdout, Stderr)
		wg.Wait()
		b.Destroy([]string{"store-monitor"}, &wg, Stdout, Stderr)
		wg.Wait()
	}

	fmt.Fprintln(Stdout, "The platform has been stopped, but applications are still serving traffic as normal.")
	fmt.Fprintln(Stdout, "Your cluster is now ready for upgrade. Install a new deisctl version and run `deisctl upgrade-takeover`.")
	fmt.Fprintln(Stdout, "For more details, see: http://docs.deis.io/en/latest/managing_deis/upgrading-deis/#graceful-upgrade")
	return nil
}
開發者ID:CodeJuan,項目名稱:deis,代碼行數:36,代碼來源:upgrade.go

示例5: UnInstallSwarm

//UnInstallSwarm uninstall Swarm
func UnInstallSwarm(b backend.Backend) error {
	var wg sync.WaitGroup
	io.WriteString(Stdout, prettyprint.DeisIfy("Destroying Swarm..."))
	fmt.Fprintln(Stdout, "swarm nodes and swarm manager...")
	b.Destroy([]string{"swarm-node", "swarm-manager"}, &wg, Stdout, Stderr)
	wg.Wait()
	fmt.Fprintln(Stdout, "Done.\n ")
	return nil
}
開發者ID:Kazanz,項目名稱:deis,代碼行數:10,代碼來源:swarm.go

示例6: UnInstallSwarm

//UnInstallSwarm uninstall Swarm
func UnInstallSwarm(b backend.Backend) error {
	var wg sync.WaitGroup
	io.WriteString(Stdout, prettyprint.DeisIfy("Uninstalling Swarm..."))
	fmt.Fprintln(Stdout, "Swarm data plane...")
	b.Destroy([]string{"swarm-node"}, &wg, Stdout, Stderr)
	wg.Wait()
	fmt.Fprintln(Stdout, "Swarm control plane...")
	b.Destroy([]string{"swarm-manager"}, &wg, Stdout, Stderr)
	wg.Wait()
	fmt.Fprintln(Stdout, "Done.\n ")
	return nil
}
開發者ID:ngpestelos,項目名稱:deis,代碼行數:13,代碼來源:swarm.go

示例7: uninstallMesosServices

func uninstallMesosServices(b backend.Backend, wg *sync.WaitGroup, out, err io.Writer) error {

	fmt.Fprintln(out, "Mesos/Marathon data plane...")
	b.Destroy([]string{"mesos-slave"}, wg, out, err)
	wg.Wait()

	fmt.Fprintln(out, "Mesos/Marathon control plane...")
	b.Destroy([]string{"mesos-marathon", "mesos-master", "zookeeper"}, wg, out, err)
	wg.Wait()

	return nil
}
開發者ID:ngpestelos,項目名稱:deis,代碼行數:12,代碼來源:mesos.go

示例8: UnInstallSwarm

//UnInstallSwarm uninstall Swarm
func UnInstallSwarm(b backend.Backend) error {
	outchan := make(chan string)
	errchan := make(chan error)
	defer close(outchan)
	defer close(errchan)
	var wg sync.WaitGroup
	go printState(outchan, errchan, 500*time.Millisecond)
	outchan <- utils.DeisIfy("Destroying Swarm...")
	outchan <- fmt.Sprintf("swarm nodes and swarm manager...")
	b.Destroy([]string{"swarm-node", "swarm-manager"}, &wg, outchan, errchan)
	wg.Wait()
	fmt.Println("Done.")
	fmt.Println()
	return nil
}
開發者ID:gpxl,項目名稱:deis,代碼行數:16,代碼來源:swarm.go

示例9: Uninstall

// Uninstall unloads the definitions of the specified components.
// After Uninstall, the components will be unavailable until Install is called.
func Uninstall(targets []string, b backend.Backend) error {
	if len(targets) == 1 {
		switch targets[0] {
		case PlatformCommand:
			return UninstallPlatform(b, false)
		case StatelessPlatformCommand:
			return UninstallPlatform(b, true)
		}
	}

	var wg sync.WaitGroup

	// uninstall the specific target
	b.Destroy(targets, &wg, Stdout, Stderr)
	wg.Wait()

	return nil
}
開發者ID:CloudSide,項目名稱:deis,代碼行數:20,代碼來源:cmd.go

示例10: UnInstallK8s

//UnInstallK8s uninstall K8s
func UnInstallK8s(b backend.Backend) error {
	var wg sync.WaitGroup
	io.WriteString(Stdout, prettyprint.DeisIfy("Uninstalling K8s..."))
	fmt.Fprintln(Stdout, "K8s router mesh...")
	b.Destroy([]string{"kube-proxy"}, &wg, Stdout, Stderr)
	wg.Wait()
	fmt.Fprintln(Stdout, "K8s data plane...")
	b.Destroy([]string{"kube-kubelet"}, &wg, Stdout, Stderr)
	wg.Wait()
	fmt.Fprintln(Stdout, "K8s control plane...")
	b.Destroy([]string{"kube-controller-manager", "kube-scheduler"}, &wg, Stdout, Stderr)
	wg.Wait()
	b.Destroy([]string{"kube-apiserver"}, &wg, Stdout, Stderr)
	wg.Wait()
	fmt.Fprintln(Stdout, "Done.\n ")
	return nil
}
開發者ID:ngpestelos,項目名稱:deis,代碼行數:18,代碼來源:k8s.go

示例11: uninstallMesosServices

func uninstallMesosServices(b backend.Backend, wg *sync.WaitGroup, out, err io.Writer) error {

	fmt.Fprintln(out, "Marathon Framework...")
	b.Destroy([]string{"mesos-marathon"}, wg, out, err)
	wg.Wait()

	fmt.Fprintln(out, "Mesos Slave...")
	b.Destroy([]string{"mesos-slave"}, wg, out, err)
	wg.Wait()

	fmt.Fprintln(out, "Mesos Master...")
	b.Destroy([]string{"mesos-master"}, wg, out, err)
	wg.Wait()

	fmt.Fprintln(out, "Zookeeper...")
	b.Destroy([]string{"zookeeper"}, wg, out, err)
	wg.Wait()

	return nil
}
開發者ID:uniite,項目名稱:deis,代碼行數:20,代碼來源:mesos.go

示例12: uninstallAllServices

func uninstallAllServices(b backend.Backend, stateless bool, wg *sync.WaitGroup, out, err io.Writer) error {

	fmt.Fprintln(out, "Routing mesh...")
	b.Destroy([]string{"[email protected]*"}, wg, out, err)
	wg.Wait()

	fmt.Fprintln(out, "Data plane...")
	b.Destroy([]string{"publisher"}, wg, out, err)
	wg.Wait()

	fmt.Fprintln(out, "Control plane...")
	if stateless {
		b.Destroy([]string{"controller", "builder", "[email protected]*"}, wg, out, err)
	} else {
		b.Destroy([]string{"controller", "builder", "database", "[email protected]*"}, wg, out, err)
	}
	wg.Wait()

	fmt.Fprintln(out, "Logging subsystem...")
	if stateless {
		b.Destroy([]string{"logspout"}, wg, out, err)
	} else {
		b.Destroy([]string{"logger", "logspout"}, wg, out, err)
	}
	wg.Wait()

	if !stateless {
		fmt.Fprintln(out, "Storage subsystem...")
		b.Destroy([]string{"store-volume", "[email protected]*"}, wg, out, err)
		wg.Wait()
		b.Destroy([]string{"store-metadata"}, wg, out, err)
		wg.Wait()
		b.Destroy([]string{"store-daemon"}, wg, out, err)
		wg.Wait()
		b.Destroy([]string{"store-monitor"}, wg, out, err)
		wg.Wait()
	}

	return nil
}
開發者ID:uniite,項目名稱:deis,代碼行數:40,代碼來源:cmd.go

示例13: uninstallAllServices

func uninstallAllServices(b backend.Backend, wg *sync.WaitGroup, outchan chan string, errchan chan error) error {

	outchan <- fmt.Sprintf("Routing mesh...")
	b.Destroy([]string{"[email protected]", "[email protected]", "[email protected]"}, wg, outchan, errchan)
	wg.Wait()

	outchan <- fmt.Sprintf("Data plane...")
	b.Destroy([]string{"publisher"}, wg, outchan, errchan)
	wg.Wait()

	outchan <- fmt.Sprintf("Control plane...")
	b.Destroy([]string{"controller", "builder", "cache", "database", "registry"}, wg, outchan, errchan)
	wg.Wait()

	outchan <- fmt.Sprintf("Logging subsystem...")
	b.Destroy([]string{"logger", "logspout"}, wg, outchan, errchan)
	wg.Wait()

	outchan <- fmt.Sprintf("Storage subsystem...")
	b.Destroy([]string{"store-volume", "store-gateway"}, wg, outchan, errchan)
	wg.Wait()
	b.Destroy([]string{"store-metadata"}, wg, outchan, errchan)
	wg.Wait()
	b.Destroy([]string{"store-daemon"}, wg, outchan, errchan)
	wg.Wait()
	b.Destroy([]string{"store-monitor"}, wg, outchan, errchan)
	wg.Wait()

	return nil
}
開發者ID:pombredanne,項目名稱:deo,代碼行數:30,代碼來源:cmd.go


注:本文中的github.com/deis/deis/deisctl/backend.Backend.Destroy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。