Example #1
0
        public async virtual Task <Response <VMwareHost> > UpdateAsync(ResourcePatch body = null, CancellationToken cancellationToken = default)
        {
            using var scope = _vMwareHostHostsClientDiagnostics.CreateScope("VMwareHost.Update");
            scope.Start();
            try
            {
                var response = await _vMwareHostHostsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new VMwareHost(ArmClient, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Example #2
0
        public virtual async Task <Response <VMwareHostResource> > UpdateAsync(ResourcePatch patch, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(patch, nameof(patch));

            using var scope = _vMwareHostHostsClientDiagnostics.CreateScope("VMwareHostResource.Update");
            scope.Start();
            try
            {
                var response = await _vMwareHostHostsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false);

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