// Delete deletes a VirtualMachine.
Delete deletes a VirtualMachine.
// Delete deletes a VirtualMachine .
func (c *Client) Delete(ctx context.Context, resourceGroupName string, VMName string) *retry.Error {
	mc := metrics.NewMetricContext("vm", "delete", resourceGroupName, c.subscriptionID, "")
	if !c.rateLimiterWriter.TryAccept() {
		mc.RateLimitedCount()
		return retry.GetRateLimitError(true, "VMDelete")
	}
	if c.RetryAfterWriter.After(time.Now()) {
		mc.ThrottledCount()
		rerr := retry.GetThrottlingError("VMDelete", "client throttled", c.RetryAfterWriter)
		return rerr
	}
	rerr := c.deleteVM(ctx, resourceGroupName, VMName)
	mc.Observe(rerr.Error())
	if rerr != nil {
		if rerr.IsThrottled() {
			c.RetryAfterWriter = rerr.RetryAfter
		}
		return rerr
	}
	return nil
}
func ( c * Client ) Delete ( ctx context . Context , resourceGroupName string , VMName string ) * retry . Error { mc := metrics . NewMetricContext ( " " , " " , resourceGroupName , c . subscriptionID , " " ) if ! c . rateLimiterWriter . TryAccept ( ) { mc . RateLimitedCount ( ) return retry . GetRateLimitError ( true , " " ) } if c . RetryAfterWriter . After ( time . Now ( ) ) { mc . ThrottledCount ( ) rerr := retry . GetThrottlingError ( " " , " " , c . RetryAfterWriter ) return rerr } rerr := c . deleteVM ( ctx , resourceGroupName , VMName ) mc . Observe ( rerr . Error ( ) ) if rerr != nil { if rerr . IsThrottled ( ) { c . RetryAfterWriter = rerr . RetryAfter } return rerr } return nil }
Delete deletes a VirtualMachine.
Delete deletes a VirtualMachine .
// Report errors if the client is rate limited. // Report errors if the client is throttled. // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires.