Example #1
0
func runDriver(driverName string) {
	switch driverName {
	case "amazonec2":
		plugin.RegisterDriver(amazonec2.NewDriver("", ""))
	case "digitalocean":
		plugin.RegisterDriver(digitalocean.NewDriver("", ""))
	case "exoscale":
		plugin.RegisterDriver(exoscale.NewDriver("", ""))
	case "generic":
		plugin.RegisterDriver(generic.NewDriver("", ""))
	case "google":
		plugin.RegisterDriver(google.NewDriver("", ""))
	case "hyperv":
		plugin.RegisterDriver(hyperv.NewDriver("", ""))
	case "none":
		plugin.RegisterDriver(none.NewDriver("", ""))
	case "openstack":
		plugin.RegisterDriver(openstack.NewDriver("", ""))
	case "rackspace":
		plugin.RegisterDriver(rackspace.NewDriver("", ""))
	case "softlayer":
		plugin.RegisterDriver(softlayer.NewDriver("", ""))
	case "virtualbox":
		plugin.RegisterDriver(virtualbox.NewDriver("", ""))
	case "vmwarefusion":
		plugin.RegisterDriver(vmwarefusion.NewDriver("", ""))
	case "vmwarevcloudair":
		plugin.RegisterDriver(vmwarevcloudair.NewDriver("", ""))
	case "vmwarevsphere":
		plugin.RegisterDriver(vmwarevsphere.NewDriver("", ""))
	default:
		fmt.Fprintf(os.Stderr, "Unsupported driver: %s\n", driverName)
		os.Exit(1)
	}
}
Example #2
0
func NewDriver(driverName, hostName, storePath string) (drivers.Driver, error) {
	var (
		driver drivers.Driver
	)

	switch driverName {
	case "virtualbox":
		driver = virtualbox.NewDriver(hostName, storePath)
	case "digitalocean":
		driver = digitalocean.NewDriver(hostName, storePath)
	case "amazonec2":
		driver = amazonec2.NewDriver(hostName, storePath)
	case "azure":
		driver = azure.NewDriver(hostName, storePath)
	case "exoscale":
		driver = exoscale.NewDriver(hostName, storePath)
	case "generic":
		driver = generic.NewDriver(hostName, storePath)
	case "google":
		driver = google.NewDriver(hostName, storePath)
	case "hyperv":
		driver = hyperv.NewDriver(hostName, storePath)
	case "openstack":
		driver = openstack.NewDriver(hostName, storePath)
	case "rackspace":
		driver = rackspace.NewDriver(hostName, storePath)
	case "softlayer":
		driver = softlayer.NewDriver(hostName, storePath)
	case "vmwarefusion":
		driver = vmwarefusion.NewDriver(hostName, storePath)
	case "vmwarevcloudair":
		driver = vmwarevcloudair.NewDriver(hostName, storePath)
	case "vmwarevsphere":
		driver = vmwarevsphere.NewDriver(hostName, storePath)
	case "none":
		driver = none.NewDriver(hostName, storePath)
	case "aiyara":
		driver = aiyara.NewDriver(hostName, storePath)
	default:
		return nil, fmt.Errorf("Driver %q not recognized", driverName)
	}

	return driver, nil
}
Example #3
0
func RunDriver(driverName string) error {
	switch driverName {
	case "amazonec2":
		plugin.RegisterDriver(amazonec2.NewDriver("", ""))
	case "azure":
		plugin.RegisterDriver(azure.NewDriver("", ""))
	case "digitalocean":
		plugin.RegisterDriver(digitalocean.NewDriver("", ""))
	case "exoscale":
		plugin.RegisterDriver(exoscale.NewDriver("", ""))
	case "generic":
		plugin.RegisterDriver(generic.NewDriver("", ""))
	case "google":
		plugin.RegisterDriver(google.NewDriver("", ""))
	case "hyperv":
		plugin.RegisterDriver(hyperv.NewDriver("", ""))
	case "none":
		plugin.RegisterDriver(none.NewDriver("", ""))
	case "openstack":
		plugin.RegisterDriver(openstack.NewDriver("", ""))
	case "rackspace":
		plugin.RegisterDriver(rackspace.NewDriver("", ""))
	case "softlayer":
		plugin.RegisterDriver(softlayer.NewDriver("", ""))
	case "virtualbox":
		plugin.RegisterDriver(virtualbox.NewDriver("", ""))
	case "vmwarefusion":
		plugin.RegisterDriver(vmwarefusion.NewDriver("", ""))
	case "vmwarevcloudair":
		plugin.RegisterDriver(vmwarevcloudair.NewDriver("", ""))
	case "vmwarevsphere":
		plugin.RegisterDriver(vmwarevsphere.NewDriver("", ""))
	case "cloudstack":
		plugin.RegisterDriver(cloudstack.NewDriver("", ""))
	default:
		return errors.Errorf("Unsupported driver: %s\n", driverName)
	}
	return nil
}
func main() {
	plugin.RegisterDriver(vmwarevsphere.NewDriver("", ""))
}