public async virtual Task<Response<IscsiTarget>> GetAsync(CancellationToken cancellationToken = default)
{
using var scope = _iscsiTargetClientDiagnostics.CreateScope("IscsiTarget.Get");
scope.Start();
try
{
var response = await _iscsiTargetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
if (response.Value == null)
throw await _iscsiTargetClientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false);
return Response.FromValue(new IscsiTarget(ArmClient, response.Value), response.GetRawResponse());
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}