예제 #1
0
        public async virtual Task <Response <ScalingPlan> > UpdateAsync(ScalingPlanUpdateOptions options = null, CancellationToken cancellationToken = default)
        {
            using var scope = _scalingPlanClientDiagnostics.CreateScope("ScalingPlan.Update");
            scope.Start();
            try
            {
                var response = await _scalingPlanRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, options, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new ScalingPlan(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
예제 #2
0
        public virtual async Task <Response <ScalingPlanResource> > UpdateAsync(PatchableScalingPlanData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _scalingPlanClientDiagnostics.CreateScope("ScalingPlanResource.Update");
            scope.Start();
            try
            {
                var response = await _scalingPlanRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new ScalingPlanResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }