def get_resource_map(self, resource_type=None):

        retries = RETRIES
        status = ""
        self.logger.debug("Running resource health command")

        request_id = Discovery.generate_node_health(rpath=resource_type)
        self.logger.debug(f"Requestid for resource map - {request_id}")

        while retries > 0:
            status = Discovery.get_gen_node_health_status(request_id)
            if "Success" in status:
                break
            elif "Failed" in status:
                raise CortxSetupError(status)
            retries -= 1
            time.sleep(WAIT)
        else:
            if retries == 0 and "Success" not in status:
                raise CortxSetupError(
                    "Timed out error."
                    "Generation of resource map is taking longer than expected.")

        return Discovery.get_node_health(request_id)
 def test_get_node_health_static_store_url(self):
     """Check for static store url."""
     request_id = Discovery.generate_node_health()
     url = Discovery.get_node_health(request_id)
     self.assertIsNotNone(url)
 def test_get_node_health(self):
     """Check for generated resource map location."""
     req_id = Discovery.generate_node_health(valid_rpath)
     url = Discovery.get_node_health(req_id)
     self.assertIsNotNone(url)