public virtual Response <NetworkPrivateEndpointConnectionResource> Get(string peConnectionName, string expand = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); using var scope = _networkPrivateEndpointConnectionPrivateLinkServicesClientDiagnostics.CreateScope("NetworkPrivateEndpointConnectionCollection.Get"); scope.Start(); try { var response = _networkPrivateEndpointConnectionPrivateLinkServicesRestClient.GetPrivateEndpointConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, expand, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new NetworkPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <PrivateEndpointConnection> GetPrivateEndpointConnection(string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateLinkService.GetPrivateEndpointConnection"); scope.Start(); try { var response = _restClient.GetPrivateEndpointConnection(Id.ResourceGroupName, Id.Parent.Name, Id.Name, expand, cancellationToken); return(response); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <PrivateEndpointConnection> Get(string expand = null, CancellationToken cancellationToken = default) { using var scope = _privateEndpointConnectionPrivateLinkServicesClientDiagnostics.CreateScope("PrivateEndpointConnection.Get"); scope.Start(); try { var response = _privateEndpointConnectionPrivateLinkServicesRestClient.GetPrivateEndpointConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, expand, cancellationToken); if (response.Value == null) { throw _privateEndpointConnectionPrivateLinkServicesClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateEndpointConnection(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }