public virtual Response <DiskPool> Get(CancellationToken cancellationToken = default) { using var scope = _diskPoolClientDiagnostics.CreateScope("DiskPool.Get"); scope.Start(); try { var response = _diskPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) { throw _diskPoolClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new DiskPool(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <DiskPool> Get(string diskPoolName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(diskPoolName, nameof(diskPoolName)); using var scope = _diskPoolClientDiagnostics.CreateScope("DiskPoolCollection.Get"); scope.Start(); try { var response = _diskPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, diskPoolName, cancellationToken); if (response.Value == null) { throw _diskPoolClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new DiskPool(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }