Exemplo n.º 1
0
    def get(self, storage_name):
        """GET.

        Returns the health of storage

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

        health_controller = self._driver.manager.health_controller

        try:
            is_alive = health_controller.is_storage_alive(storage_name)
            return health_response.StorageModel(is_alive)
        except KeyError:
            pecan.response.status = 404
Exemplo n.º 2
0
 def test_storage_is_not_alive(self):
     storage_model = health.StorageModel(False)
     self.assertEqual('false', storage_model['online'])
Exemplo n.º 3
0
 def test_storage_is_alive(self):
     storage_model = health.StorageModel(True)
     self.assertEqual('true', storage_model['online'])