/// <summary>
 /// AuthDisableAsync disables authentication 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 <AuthDisableResponse> AuthDisableAsync(AuthDisableRequest request,
                                                          Grpc.Core.Metadata headers          = null, DateTime?deadline = null,
                                                          CancellationToken cancellationToken = default)
 {
     return(await CallEtcdAsync(async (connection) => await connection._authClient
                                .AuthDisableAsync(request, headers, deadline, cancellationToken)).ConfigureAwait(false));
 }
 /// <summary>
 /// AuthDisable disables authentication
 /// </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 AuthDisableResponse AuthDisable(AuthDisableRequest request, Grpc.Core.Metadata headers = null,
                                        DateTime?deadline = null,
                                        CancellationToken cancellationToken = default)
 {
     return(CallEtcd((connection) => connection._authClient
                     .AuthDisable(request, headers, deadline, cancellationToken)));
 }
        /// <summary>
        /// AuthDisableAsync disables authentication in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthDisableResponse> AuthDisableAsync(AuthDisableRequest request, Metadata headers = null)
        {
            AuthDisableResponse response = new AuthDisableResponse();
            bool success    = false;
            int  retryCount = 0;

            while (!success)
            {
                try
                {
                    response = await _balancer.GetConnection().authClient.AuthDisableAsync(request, headers);

                    success = true;
                }
                catch (RpcException ex) when(ex.StatusCode == StatusCode.Unavailable)
                {
                    retryCount++;
                    if (retryCount >= _balancer._numNodes)
                    {
                        throw ex;
                    }
                }
            }
            return(response);
        }
Beispiel #4
0
        /// <summary>
        /// AuthDisableAsync disables authentication in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthDisableResponse> AuthDisableAsync(AuthDisableRequest request, Metadata headers = null)
        {
            AuthDisableResponse response = new AuthDisableResponse();

            response = await _balancer.GetConnection().authClient.AuthDisableAsync(request, headers);

            return(response);
        }
Beispiel #5
0
        /// <summary>
        /// AuthDisable disables authentication
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AuthDisableResponse AuthDisable(AuthDisableRequest request, Metadata headers = null)
        {
            AuthDisableResponse response = new AuthDisableResponse();

            response = _balancer.GetConnection().authClient.AuthDisable(request, headers);

            return(response);
        }
Beispiel #6
0
        /// <summary>
        /// AuthDisableAsync disables authentication in async
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <AuthDisableResponse> AuthDisableAsync(AuthDisableRequest request)
        {
            AuthDisableResponse response = new AuthDisableResponse();

            try
            {
                response = await _authClient.AuthDisableAsync(request, _headers);
            }
            catch (RpcException ex)
            {
                ResetConnection(ex);
                throw;
            }
            catch
            {
                throw;
            }
            return(response);
        }
Beispiel #7
0
        /// <summary>
        /// AuthDisable disables authentication
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public AuthDisableResponse AuthDisable(AuthDisableRequest request)
        {
            AuthDisableResponse response = new AuthDisableResponse();

            try
            {
                response = _authClient.AuthDisable(request, _headers);
            }
            catch (RpcException ex)
            {
                ResetConnection(ex);
                throw;
            }
            catch
            {
                throw;
            }
            return(response);
        }