# 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/api.py
# @singledispatch
# def consul(obj, meta=None):
#     meta = meta or {}
#     return ConsulValue(obj, meta=meta)
# 
# 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.api import consul
from aioconsul.util import extract_attr
                "Output": "",
                "ServiceID": "",
                "ServiceName": ""
              },
              {
                "Node": "foobar",
                "CheckID": "service:redis",
                "Name": "Service 'redis' check",
                "Status": "passing",
                "Notes": "",
                "Output": "",
                "ServiceID": "redis",
                "ServiceName": "redis"
              }
            ]

        In this case, we can see there is a system level check (that is, a
        check with no associated ``ServiceID``) as well as a service check for
        Redis. The "serfHealth" check is special in that it is automatically
        present on every node. When a node joins the Consul cluster, it is
        part of a distributed failure detection provided by Serf. If a node
        fails, it is detected and the status is automatically changed to
        ``critical``.
        """
        node_id = extract_attr(node, keys=["Node", "ID"])
        params = {"dc": dc}
        response = await self._api.get("/v1/health/node", node_id,
                                       params=params,
                                       watch=watch,
                                       consistency=consistency)

# 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/api.py
# @singledispatch
# def consul(obj, meta=None):
#     meta = meta or {}
#     return ConsulValue(obj, meta=meta)
# 
# 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/health_endpoint.py
from .bases import EndpointBase
from aioconsul.api import consul
from aioconsul.util import extract_attr

                "Output": "",
                "ServiceID": "",
                "ServiceName": ""
              },
              {
                "Node": "foobar",
                "CheckID": "service:redis",
                "Name": "Service 'redis' check",
                "Status": "passing",
                "Notes": "",
                "Output": "",
                "ServiceID": "redis",
                "ServiceName": "redis"
              }
            ]

        In this case, we can see there is a system level check (that is, a
        check with no associated ``ServiceID``) as well as a service check for
        Redis. The "serfHealth" check is special in that it is automatically
        present on every node. When a node joins the Consul cluster, it is
        part of a distributed failure detection provided by Serf. If a node
        fails, it is detected and the status is automatically changed to
        ``critical``.
        """
        node_id = extract_attr(node, keys=["Node", "ID"])
        params = {"dc": dc}
        response = await self._api.get("/v1/health/node", node_id,
                                       params=params,
                                       watch=watch,
                                       consistency=consistency)

        return consul(response)