def root_index(self, req, tenant_id, instance_id, is_cluster): """Returns True if root is enabled; False otherwise.""" if is_cluster: raise exception.ClusterOperationNotSupported(operation='show_root') LOG.info(_LI("Getting root enabled for instance '%s'.") % instance_id) LOG.info(_LI("req : '%s'\n\n") % req) context = req.environ[wsgi.CONTEXT_KEY] is_root_enabled = models.Root.load(context, instance_id) return wsgi.Result(views.RootEnabledView(is_root_enabled).data(), 200)
def instance_root_index(self, req, tenant_id, instance_id): LOG.info(_LI("Getting root enabled for instance '%s'.") % instance_id) LOG.info(_LI("req : '%s'\n\n") % req) context = req.environ[wsgi.CONTEXT_KEY] try: is_root_enabled = models.ClusterRoot.load(context, instance_id) except exception.UnprocessableEntity: raise exception.UnprocessableEntity( _("Cluster %s is not ready.") % instance_id) return wsgi.Result(views.RootEnabledView(is_root_enabled).data(), 200)
def instance_root_index(self, req, tenant_id, instance_id): LOG.info(_LI("Getting root enabled for instance '%s'.") % instance_id) LOG.info(_LI("req : '%s'\n\n") % req) context = req.environ[wsgi.CONTEXT_KEY] is_root_enabled = models.VerticaRoot.load(context, instance_id) return wsgi.Result(views.RootEnabledView(is_root_enabled).data(), 200)