Example #1
0
func DeleteDisk(diskName string) error {
	if len(diskName) == 0 {
		return fmt.Errorf(azure.ParamNotSpecifiedError, "diskName")
	}

	requestURL := fmt.Sprintf(azureVMDiskURL, diskName)
	requestId, err := azure.SendAzureDeleteRequest(requestURL)
	if err != nil {
		return err
	}

	azure.WaitAsyncOperation(requestId)
	return nil
}
Example #2
0
func DeleteVMDeployment(cloudserviceName, deploymentName string) error {
	if len(cloudserviceName) == 0 {
		return fmt.Errorf(azure.ParamNotSpecifiedError, "cloudserviceName")
	}
	if len(deploymentName) == 0 {
		return fmt.Errorf(azure.ParamNotSpecifiedError, "deploymentName")
	}

	requestURL := fmt.Sprintf(deleteAzureDeploymentURL, cloudserviceName, deploymentName)
	requestId, err := azure.SendAzureDeleteRequest(requestURL)
	if err != nil {
		return err
	}

	azure.WaitAsyncOperation(requestId)

	return nil
}
Example #3
0
func DeleteHostedService(dnsName string) error {
	if len(dnsName) == 0 {
		return fmt.Errorf(azure.ParamNotSpecifiedError, "dnsName")
	}

	err := verifyDNSname(dnsName)
	if err != nil {
		return err
	}

	requestURL := fmt.Sprintf(deleteAzureHostedServiceURL, dnsName)
	requestId, err := azure.SendAzureDeleteRequest(requestURL)
	if err != nil {
		return err
	}

	azure.WaitAsyncOperation(requestId)
	return nil
}