Esempio n. 1
0
 def index(self, req, tenant_id, instance_id):
     """Return all schemas."""
     LOG.info(_("Listing schemas for instance '%s'") % instance_id)
     LOG.info(_("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     schemas, next_marker = models.Schemas.load(context, instance_id)
     view = views.SchemasView(schemas)
     paged = pagination.SimplePaginatedDataView(req.url, 'databases', view,
                                                next_marker)
     return wsgi.Result(paged.data(), 200)
Esempio n. 2
0
    def index(self, req, tenant_id, instance_id):
        """Return all schemas."""
        LOG.info("Listing schemas for instance '%(id)s'\n"
                 "req : '%(req)s'\n\n",
                 {"id": instance_id, "req": req})

        context = req.environ[wsgi.CONTEXT_KEY]
        self.authorize_target_action(
            context, 'database:index', instance_id)
        schemas, next_marker = models.Schemas.load(context, instance_id)
        view = views.SchemasView(schemas)
        paged = pagination.SimplePaginatedDataView(req.url, 'databases', view,
                                                   next_marker)
        return wsgi.Result(paged.data(), 200)