# Path: aioconsul/client/bases.py
# class EndpointBase:
# 
#     def __init__(self, api):
#         self._api = api
# 
#     def __repr__(self):
#         return "<%s(%r)>" % (self.__class__.__name__, str(self._api.address))
# 
# Path: aioconsul/util.py
# def extract_attr(obj, *, keys):
#     if isinstance(obj, Mapping):
#         for key in keys:
#             if key in obj:
#                 return obj[key]
#         raise TypeError("%s not found in obj %s" % (keys, obj))
#     return obj


from .bases import EndpointBase
from aioconsul.util import extract_attr
        role in the Raft configuration.

        **Voter** is ``True`` or ``False``, indicating if the server has a
        vote in the Raft configuration. Future versions of Consul may add
        support for non-voting servers.

        The **Index** value is the Raft corresponding to this configuration.
        Note that the latest configuration may not yet be committed if changes
        are in flight.
        """
        response = await self._api.get("/v1/operator/raft/configuration",
                                       params={"dc": dc},
                                       consistency=consistency)
        return response.body

    async def peer_delete(self, *, dc=None, address):
        """Remove the server with given address from the Raft configuration

        Parameters:
            dc (str): Specify datacenter that will be used.
                      Defaults to the agent's local datacenter.
            address (str): "IP:port" of the server to remove.
        Returns:
            bool: ``True`` on success

        There are rare cases where a peer may be left behind in the Raft
        configuration even though the server is no longer present and known
        to the cluster. This endpoint can be used to remove the failed server
        so that it is no longer affects the Raft quorum.
        """

# Path: aioconsul/client/bases.py
# class EndpointBase:
# 
#     def __init__(self, api):
#         self._api = api
# 
#     def __repr__(self):
#         return "<%s(%r)>" % (self.__class__.__name__, str(self._api.address))
# 
# Path: aioconsul/util.py
# def extract_attr(obj, *, keys):
#     if isinstance(obj, Mapping):
#         for key in keys:
#             if key in obj:
#                 return obj[key]
#         raise TypeError("%s not found in obj %s" % (keys, obj))
#     return obj


# Path: aioconsul/client/operator_endpoint.py
from .bases import EndpointBase
from aioconsul.util import extract_attr

        role in the Raft configuration.

        **Voter** is ``True`` or ``False``, indicating if the server has a
        vote in the Raft configuration. Future versions of Consul may add
        support for non-voting servers.

        The **Index** value is the Raft corresponding to this configuration.
        Note that the latest configuration may not yet be committed if changes
        are in flight.
        """
        response = await self._api.get("/v1/operator/raft/configuration",
                                       params={"dc": dc},
                                       consistency=consistency)
        return response.body

    async def peer_delete(self, *, dc=None, address):
        """Remove the server with given address from the Raft configuration

        Parameters:
            dc (str): Specify datacenter that will be used.
                      Defaults to the agent's local datacenter.
            address (str): "IP:port" of the server to remove.
        Returns:
            bool: ``True`` on success

        There are rare cases where a peer may be left behind in the Raft
        configuration even though the server is no longer present and known
        to the cluster. This endpoint can be used to remove the failed server
        so that it is no longer affects the Raft quorum.
        """

        address = extract_attr(address, keys=["Address"])