public virtual Response <SiteDetector> Get(string detectorName, DateTimeOffset?startTime = null, DateTimeOffset?endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(detectorName, nameof(detectorName)); using var scope = _siteDetectorDiagnosticsClientDiagnostics.CreateScope("SiteDetectorCollection.Get"); scope.Start(); try { var response = _siteDetectorDiagnosticsRestClient.GetSiteDetectorResponse(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, detectorName, startTime, endTime, timeGrain, cancellationToken); if (response.Value == null) { throw _siteDetectorDiagnosticsClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new SiteDetector(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <SiteDetector> Get(DateTimeOffset?startTime = null, DateTimeOffset?endTime = null, string timeGrain = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SiteDetector.Get"); scope.Start(); try { var response = _diagnosticsRestClient.GetSiteDetectorResponse(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, startTime, endTime, timeGrain, cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new SiteDetector(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }