Exemplo n.º 1
0
    def show(self, req, tenant_id, id):
        """Return a single instance."""
        LOG.info(_("req : '%s'\n\n") % req)
        LOG.info(_("Showing a database instance for tenant '%s'") % tenant_id)
        LOG.info(_("id : '%s'\n\n") % id)

        context = req.environ[wsgi.CONTEXT_KEY]
        server = models.DetailedMgmtInstance.load(context, id)
        root_history = mysql_models.RootHistory.load(context=context,
                                                     instance_id=id)
        return wsgi.Result(
            views.MgmtInstanceDetailView(server,
                                         req=req,
                                         root_history=root_history).data(),
            200)
Exemplo n.º 2
0
 def show(self, req, tenant_id, id):
     """Return a single instance."""
     LOG.info(
         "Showing a database instance %(id)s for tenant "
         "'%(tenant_id)s'\n"
         "req : '%(req)s'\n\n", {
             "tenant_id": tenant_id,
             "req": req,
             "id": id
         })
     context = req.environ[wsgi.CONTEXT_KEY]
     deleted_q = req.GET.get('deleted', '').lower()
     include_deleted = deleted_q == 'true'
     server = models.DetailedMgmtInstance.load(context, id, include_deleted)
     root_history = mysql_models.RootHistory.load(context=context,
                                                  instance_id=id)
     return wsgi.Result(
         views.MgmtInstanceDetailView(server,
                                      req=req,
                                      root_history=root_history).data(),
         200)