def request_patroni(member: Member, method: str = 'GET',
                    endpoint: Optional[str] = None, data: Optional[Any] = None) -> urllib3.response.HTTPResponse:
    """Perform a request to Patroni REST API.

    :param member: DCS member, used to get the base URL of its REST API server.
    :param method: HTTP method to be used, e.g. ``GET``.
    :param endpoint: URL path of the request, e.g. ``patroni``.
    :param data: anything to be used as the request body.

    :returns: the response for the request.
    """
    ctx = click.get_current_context()  # the current click context
    request_executor = ctx.obj.get('__request_patroni')
    if not request_executor:
        request_executor = ctx.obj['__request_patroni'] = PatroniRequest(_get_configuration())
    return request_executor(member, method, endpoint, data)
Perform a request to Patroni REST API.

    :param member: DCS member, used to get the base URL of its REST API server.
    :param method: HTTP method to be used, e.g. ``GET``.
    :param endpoint: URL path of the request, e.g. ``patroni``.
    :param data: anything to be used as the request body.

    :returns: the response for the request.
    
patroni/ctl.py