Example #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)
}
Example #2
0
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
}
Example #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
}