public virtual Response<ScVmmServerResource> Get(string vmmServerName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(vmmServerName, nameof(vmmServerName));

            using var scope = _scVmmServerVmmServersClientDiagnostics.CreateScope("ScVmmServerCollection.Get");
            scope.Start();
            try
            {
                var response = _scVmmServerVmmServersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vmmServerName, cancellationToken);
                if (response.Value == null)
                    throw new RequestFailedException(response.GetRawResponse());
                return Response.FromValue(new ScVmmServerResource(Client, response.Value), response.GetRawResponse());
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Ejemplo n.º 2
0
 public virtual Response <ScVmmServerResource> Get(CancellationToken cancellationToken = default)
 {
     using var scope = _scVmmServerVmmServersClientDiagnostics.CreateScope("ScVmmServerResource.Get");
     scope.Start();
     try
     {
         var response = _scVmmServerVmmServersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         if (response.Value == null)
         {
             throw new RequestFailedException(response.GetRawResponse());
         }
         return(Response.FromValue(new ScVmmServerResource(Client, response.Value), response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }