コード例 #1
0
 def index(self, req, tenant_id):
     """Return all instances."""
     LOG.info(_("req : '%s'\n\n") % req)
     LOG.info(_("Indexing a database instance for tenant '%s'") % tenant_id)
     context = req.environ[wsgi.CONTEXT_KEY]
     servers, marker = models.Instances.load(context)
     view = views.InstancesView(servers, req=req)
     paged = pagination.SimplePaginatedDataView(req.url, 'instances', view,
                                                marker)
     return wsgi.Result(paged.data(), 200)
コード例 #2
0
ファイル: service.py プロジェクト: riddhi89/reddwarf
 def index(self, req, tenant_id, instance_id):
     """Return all users."""
     LOG.info(_("Listing users for instance '%s'") % instance_id)
     LOG.info(_("req : '%s'\n\n") % req)
     context = req.environ[wsgi.CONTEXT_KEY]
     users, next_marker = models.Users.load(context, instance_id)
     view = views.UsersView(users)
     paged = pagination.SimplePaginatedDataView(req.url, 'users', view,
                                                next_marker)
     return wsgi.Result(paged.data(), 200)