/// <summary> /// AuthEnableAsync enables authentication in async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthEnableResponse> AuthEnableAsync(AuthEnableRequest request, Metadata headers = null) { AuthEnableResponse response = new AuthEnableResponse(); bool success = false; int retryCount = 0; while (!success) { try { response = await _balancer.GetConnection().authClient.AuthEnableAsync(request, headers); success = true; } catch (RpcException ex) when(ex.StatusCode == StatusCode.Unavailable) { retryCount++; if (retryCount >= _balancer._numNodes) { throw ex; } } } return(response); }
/// <summary> /// AuthEnableAsync enables authentication in async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthEnableResponse> AuthEnableAsync(AuthEnableRequest request, Metadata headers = null) { AuthEnableResponse response = new AuthEnableResponse(); response = await _balancer.GetConnection().authClient.AuthEnableAsync(request, headers); return(response); }
/// <summary> /// AuthEnable enables authentication /// </summary> /// <param name="request"></param> /// <returns></returns> public AuthEnableResponse AuthEnable(AuthEnableRequest request, Metadata headers = null) { AuthEnableResponse response = new AuthEnableResponse(); response = _balancer.GetConnection().authClient.AuthEnable(request, headers); return(response); }
public AuthEnableResponse AuthEnable() { Etcdserverpb.AuthEnableRequest enableRequest = new Etcdserverpb.AuthEnableRequest(); var rsp = authClient.AuthEnable(enableRequest); AuthEnableResponse response = new AuthEnableResponse(rsp); return(response); //return Util.ToCompletableFuture( // this.stub.authEnable(enableRequest), // new FunctionResponse<Etcdserverpb.AuthEnableRequest, AuthEnableResponse>()); }
/// <summary> /// AuthEnableAsync enables authentication in async /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <AuthEnableResponse> AuthEnableAsync(AuthEnableRequest request) { AuthEnableResponse response = new AuthEnableResponse(); try { response = await _authClient.AuthEnableAsync(request, _headers); } catch (RpcException ex) { ResetConnection(ex); throw; } catch { throw; } return(response); }
/// <summary> /// AuthEnable enables authentication /// </summary> /// <param name="request"></param> /// <returns></returns> public AuthEnableResponse AuthEnable(AuthEnableRequest request) { AuthEnableResponse response = new AuthEnableResponse(); try { response = _authClient.AuthEnable(request, _headers); } catch (RpcException ex) { ResetConnection(ex); throw; } catch { throw; } return(response); }