Esempio n. 1
0
    def get(self, dns_name):
        """GET.

        Returns the health of DNS Provider

        :param dns_name
        :returns JSON storage model or HTTP 404
        """

        health_controller = self._driver.manager.health_controller

        try:
            is_alive = health_controller.is_dns_alive(dns_name)
            return health_response.DNSModel(is_alive)
        except KeyError:
            pecan.response.status = 404
Esempio n. 2
0
 def test_dns_is_not_alive(self):
     dns_model = health.DNSModel(False)
     self.assertEqual('false', dns_model['online'])
Esempio n. 3
0
 def test_dns_is_alive(self):
     dns_model = health.DNSModel(True)
     self.assertEqual('true', dns_model['online'])