/// <summary> /// RoleGetASync gets detailed role information in async /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public async Task <AuthRoleGetResponse> RoleGetASync(AuthRoleGetRequest request, Grpc.Core.Metadata headers = null, DateTime?deadline = null, CancellationToken cancellationToken = default) { return(await CallEtcdAsync(async (connection) => await connection._authClient .RoleGetAsync(request, headers, deadline, cancellationToken)).ConfigureAwait(false)); }
/// <summary> /// RoleGet gets detailed role information /// </summary> /// <param name="request">The request to send to the server.</param> /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> /// <param name="cancellationToken">An optional token for canceling the call.</param> /// <returns>The response received from the server.</returns> public AuthRoleGetResponse RoleGet(AuthRoleGetRequest request, Grpc.Core.Metadata headers = null, DateTime?deadline = null, CancellationToken cancellationToken = default) { return(CallEtcd((connection) => connection._authClient .RoleGet(request, headers, deadline, cancellationToken))); }
/// <summary> /// RoleGetASync gets detailed role information in async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthRoleGetResponse> RoleGetASync(AuthRoleGetRequest request, Metadata headers = null) { AuthRoleGetResponse response = new AuthRoleGetResponse(); bool success = false; int retryCount = 0; while (!success) { try { response = await _balancer.GetConnection().authClient.RoleGetAsync(request, headers); success = true; } catch (RpcException ex) when(ex.StatusCode == StatusCode.Unavailable) { retryCount++; if (retryCount >= _balancer._numNodes) { throw ex; } } } return(response); }
/// <summary> /// RoleGetASync gets detailed role information in async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthRoleGetResponse> RoleGetASync(AuthRoleGetRequest request, Metadata headers = null) { AuthRoleGetResponse response = new AuthRoleGetResponse(); response = await _balancer.GetConnection().authClient.RoleGetAsync(request, headers); return(response); }
/// <summary> /// RoleGet gets detailed role information /// </summary> /// <param name="request"></param> /// <returns></returns> public AuthRoleGetResponse RoleGet(AuthRoleGetRequest request, Metadata headers = null) { AuthRoleGetResponse response = new AuthRoleGetResponse(); response = _balancer.GetConnection().authClient.RoleGet(request, headers); return(response); }
/// <summary> /// RoleGetASync gets detailed role information in async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthRoleGetResponse> RoleGetASync(AuthRoleGetRequest request) { AuthRoleGetResponse response = new AuthRoleGetResponse(); try { response = await _authClient.RoleGetAsync(request, _headers); } catch (RpcException ex) { ResetConnection(ex); throw; } catch { throw; } return(response); }
/// <summary> /// RoleGet gets detailed role information /// </summary> /// <param name="request"></param> /// <returns></returns> public AuthRoleGetResponse RoleGet(AuthRoleGetRequest request) { AuthRoleGetResponse response = new AuthRoleGetResponse(); try { response = _authClient.RoleGet(request, _headers); } catch (RpcException ex) { ResetConnection(ex); throw; } catch { throw; } return(response); }