func (c *Client) Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error {
	mc := metrics.NewMetricContext("vm", "update", resourceGroupName, c.subscriptionID, source)

	// Report errors if the client is rate limited.
	if !c.rateLimiterWriter.TryAccept() {
		mc.RateLimitedCount()
		return retry.GetRateLimitError(true, "VMUpdate")
	}

	// Report errors if the client is throttled.
	if c.RetryAfterWriter.After(time.Now()) {
		mc.ThrottledCount()
		rerr := retry.GetThrottlingError("VMUpdate", "client throttled", c.RetryAfterWriter)
		return rerr
	}

	rerr := c.updateVM(ctx, resourceGroupName, VMName, parameters, source)
	mc.Observe(rerr.Error())
	if rerr != nil {
		if rerr.IsThrottled() {
			// Update RetryAfterReader so that no more requests would be sent until RetryAfter expires.
			c.RetryAfterWriter = rerr.RetryAfter
		}

		return rerr
	}

	return nil
}
// Update updates a VirtualMachine.
Update updates a VirtualMachine.
// Update updates a VirtualMachine .
func (c *Client) Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error {
	mc := metrics.NewMetricContext("vm", "update", resourceGroupName, c.subscriptionID, source)
	if !c.rateLimiterWriter.TryAccept() {
		mc.RateLimitedCount()
		return retry.GetRateLimitError(true, "VMUpdate")
	}
	if c.RetryAfterWriter.After(time.Now()) {
		mc.ThrottledCount()
		rerr := retry.GetThrottlingError("VMUpdate", "client throttled", c.RetryAfterWriter)
		return rerr
	}
	rerr := c.updateVM(ctx, resourceGroupName, VMName, parameters, source)
	mc.Observe(rerr.Error())
	if rerr != nil {
		if rerr.IsThrottled() {
			c.RetryAfterWriter = rerr.RetryAfter
		}
		return rerr
	}
	return nil
}
func ( c * Client ) Update ( ctx context . Context , resourceGroupName string , VMName string , parameters compute . VirtualMachineUpdate , source string ) * retry . Error { mc := metrics . NewMetricContext ( " " , " " , resourceGroupName , c . subscriptionID , source ) 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 . updateVM ( ctx , resourceGroupName , VMName , parameters , source ) mc . Observe ( rerr . Error ( ) ) if rerr != nil { if rerr . IsThrottled ( ) { c . RetryAfterWriter = rerr . RetryAfter } return rerr } return nil }
Update updates a VirtualMachine.
Update updates 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.