예제 #1
0
func (d *Driver) Remove() error {
	if err := d.setUserSubscription(); err != nil {
		return err
	}

	if available, _, err := vmClient.CheckHostedServiceNameAvailability(d.MachineName); err != nil {
		return err
	} else if available {
		return nil
	}

	return vmClient.DeleteHostedService(d.MachineName)
}
예제 #2
0
파일: azure.go 프로젝트: robebeye/machine
func (d *Driver) PreCreateCheck() error {
	if err := d.setUserSubscription(); err != nil {
		return err
	}

	// check azure DNS to make sure name is available
	available, response, err := vmClient.CheckHostedServiceNameAvailability(d.MachineName)
	if err != nil {
		return err
	}

	if !available {
		return errors.New(response)
	}

	return nil
}
예제 #3
0
func (driver *Driver) Remove() error {
	err := driver.setUserSubscription()
	if err != nil {
		return err
	}
	available, _, err := vmClient.CheckHostedServiceNameAvailability(driver.Name)
	if err != nil {
		return err
	}
	if available {
		return nil
	}

	log.Debugf("removing %s", driver.Name)

	err = vmClient.DeleteHostedService(driver.Name)
	if err != nil {
		return err
	}

	return nil
}