public async virtual Task <ArmOperation <ExpressRouteCircuitsArpTableListResult> > GetArpTableExpressRouteCircuitAsync(bool waitForCompletion, string devicePath, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(devicePath, nameof(devicePath)); using var scope = _expressRouteCircuitClientDiagnostics.CreateScope("ExpressRouteCircuitPeering.GetArpTableExpressRouteCircuit"); scope.Start(); try { var response = await _expressRouteCircuitRestClient.ListArpTableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, devicePath, cancellationToken).ConfigureAwait(false); var operation = new NetworkArmOperation <ExpressRouteCircuitsArpTableListResult>(new ExpressRouteCircuitsArpTableListResultOperationSource(), _expressRouteCircuitClientDiagnostics, Pipeline, _expressRouteCircuitRestClient.CreateListArpTableRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, devicePath).Request, response, OperationFinalStateVia.Location); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <ExpressRouteCircuitListArpTableOperation> GetArpTableExpressRouteCircuitAsync(string devicePath, bool waitForCompletion = true, CancellationToken cancellationToken = default) { if (devicePath == null) { throw new ArgumentNullException(nameof(devicePath)); } using var scope = _clientDiagnostics.CreateScope("ExpressRouteCircuitPeering.GetArpTableExpressRouteCircuit"); scope.Start(); try { var response = await _expressRouteCircuitsRestClient.ListArpTableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, devicePath, cancellationToken).ConfigureAwait(false); var operation = new ExpressRouteCircuitListArpTableOperation(_clientDiagnostics, Pipeline, _expressRouteCircuitsRestClient.CreateListArpTableRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, devicePath).Request, response); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }