Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "VBoxManage", Short: "Oracle VM VirtualBox Command Line Management Interface Version 5.0.20", Long: `Oracle VM VirtualBox Command Line Management Interface Version 5.0.20 (C) 2005-2016 Oracle Corporation All rights reserved.`, Run: func(cmd *cobra.Command, args []string) { if version { host := viper.GetString("server.host") port := viper.GetString("server.port") home, err := homedir.Dir() if err != nil { log.Fatal(errors.Wrap(err, "could not detect users home directory")) } caCert, err := ioutil.ReadFile(filepath.Join(home, ".vmproxy", "cert.pem")) if err != nil { log.Fatal(err) } caCertPool := x509.NewCertPool() caCertPool.AppendCertsFromPEM(caCert) client := &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{ RootCAs: caCertPool, }, }, } req, err := http.NewRequest("GET", "https://"+host+":"+port+"/vbox/version", nil) resp, err := client.Do(req) assert(err) respBody, _ := ioutil.ReadAll(resp.Body) fmt.Print(string(respBody)) } else { cmd.Help() os.Exit(0) } }, }
RootCmd represents the base command when called without any subcommands
View Source
var Type string
Type vm start mode
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.