/// <summary> /// RoleListAsync gets lists of all roles async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthRoleListResponse> RoleListAsync(AuthRoleListRequest request, Metadata headers = null) { AuthRoleListResponse response = new AuthRoleListResponse(); bool success = false; int retryCount = 0; while (!success) { try { response = await _balancer.GetConnection().authClient.RoleListAsync(request, headers); success = true; } catch (RpcException ex) when(ex.StatusCode == StatusCode.Unavailable) { retryCount++; if (retryCount >= _balancer._numNodes) { throw ex; } } } return(response); }
/// <summary> /// RoleListAsync gets lists of all roles async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthRoleListResponse> RoleListAsync(AuthRoleListRequest request, Metadata headers = null) { AuthRoleListResponse response = new AuthRoleListResponse(); response = await _balancer.GetConnection().authClient.RoleListAsync(request, headers); return(response); }
/// <summary> /// RoleList gets lists of all roles /// </summary> /// <param name="request"></param> /// <returns></returns> public AuthRoleListResponse RoleList(AuthRoleListRequest request, Metadata headers = null) { AuthRoleListResponse response = new AuthRoleListResponse(); response = _balancer.GetConnection().authClient.RoleList(request, headers); return(response); }
public AuthRoleListResponse RoleList() { Etcdserverpb.AuthRoleListRequest roleListRequest = new Etcdserverpb.AuthRoleListRequest(); var rsp = authClient.RoleList(roleListRequest); AuthRoleListResponse response = new AuthRoleListResponse(rsp); return(response); // return Util.ToCompletableFuture( // this.stub.roleList(roleListRequest), // new FunctionResponse<Etcdserverpb.AuthRoleListRequest, AuthRoleListResponse>()); }
/// <summary> /// RoleListAsync gets lists of all roles async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthRoleListResponse> RoleListAsync(AuthRoleListRequest request) { AuthRoleListResponse response = new AuthRoleListResponse(); try { response = await _authClient.RoleListAsync(request, _headers); } catch (RpcException ex) { ResetConnection(ex); throw; } catch { throw; } return(response); }
/// <summary> /// RoleList gets lists of all roles /// </summary> /// <param name="request"></param> /// <returns></returns> public AuthRoleListResponse RoleList(AuthRoleListRequest request) { AuthRoleListResponse response = new AuthRoleListResponse(); try { response = _authClient.RoleList(request, _headers); } catch (RpcException ex) { ResetConnection(ex); throw; } catch { throw; } return(response); }