public virtual Response <ExpressRouteCircuitPeeringResource> Get(string peeringName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peeringName, nameof(peeringName)); using var scope = _expressRouteCircuitPeeringClientDiagnostics.CreateScope("ExpressRouteCircuitPeeringCollection.Get"); scope.Start(); try { var response = _expressRouteCircuitPeeringRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peeringName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ExpressRouteCircuitPeeringResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <ExpressRouteCircuitPeering> Get(string peeringName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitPeeringCollection.Get"); scope.Start(); try { if (peeringName == null) { throw new ArgumentNullException(nameof(peeringName)); } var response = _restClient.Get(Id.ResourceGroupName, Id.Name, peeringName, cancellationToken: cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ExpressRouteCircuitPeering(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <ExpressRouteCircuitPeering> Get(CancellationToken cancellationToken = default) { using var scope = _expressRouteCircuitPeeringClientDiagnostics.CreateScope("ExpressRouteCircuitPeering.Get"); scope.Start(); try { var response = _expressRouteCircuitPeeringRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _expressRouteCircuitPeeringClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ExpressRouteCircuitPeering(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }