-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
34 lines (30 loc) · 805 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"swift/cli"
"github.com/spf13/cobra"
)
func main() {
// Define vm domains instance
var createDomain = cli.CreateDomain()
// Show everything that has to do with domains
var domains = cli.ListDomains()
// undefine the domain
var undefine = cli.UndefineDomain()
// run a VM instance
var startVM = cli.StartDomain()
// Shutdown a VM instance
var shutdown = cli.ShutdownDomain()
// Get domain status
var status = cli.DomainState()
// Get the VM XML dump
var vmXML = cli.GetVmXML()
rootCmd := &cobra.Command{Use: "swift", Version: "0.3.0"}
rootCmd.AddCommand(createDomain)
rootCmd.AddCommand(domains)
rootCmd.AddCommand(undefine)
rootCmd.AddCommand(startVM)
rootCmd.AddCommand(shutdown)
rootCmd.AddCommand(status)
rootCmd.AddCommand(vmXML)
rootCmd.Execute()
}