def index(self, req, tenant_id): """ Return all backups information for a tenant ID. """ LOG.debug("Listing backups for tenant %s", tenant_id) datastore = req.GET.get('datastore') instance_id = req.GET.get('instance_id') project_id = req.GET.get('project_id') all_projects = strutils.bool_from_string(req.GET.get('all_projects')) context = req.environ[wsgi.CONTEXT_KEY] if project_id or all_projects: policy.authorize_on_tenant(context, 'backup:index:all_projects') else: policy.authorize_on_tenant(context, 'backup:index') backups, marker = Backup.list(context, datastore=datastore, instance_id=instance_id, project_id=project_id, all_projects=all_projects) view = views.BackupViews(backups) paged = pagination.SimplePaginatedDataView(req.url, 'backups', view, marker) return wsgi.Result(paged.data(), 200)
def backups(self, req, tenant_id, id): """Return all backups for the specified instance.""" LOG.info(_("req : '%s'\n\n") % req) LOG.info(_("Indexing backups for instance '%s'") % id) backups = backup_model.list_for_instance(id) return wsgi.Result(backup_views.BackupViews(backups).data(), 200)
def index(self, req, tenant_id): """ Return all backups information for a tenant ID. """ LOG.debug("Listing Backups for tenant '%s'" % tenant_id) context = req.environ[wsgi.CONTEXT_KEY] backups = Backup.list(context) return wsgi.Result(views.BackupViews(backups).data(), 200)
def backups(self, req, tenant_id, id): """Return all backups for the specified instance.""" LOG.info(_LI("Listing backups for instance '%s'"), id) LOG.debug("req : '%s'\n\n", req) context = req.environ[wsgi.CONTEXT_KEY] backups, marker = backup_model.list_for_instance(context, id) view = backup_views.BackupViews(backups) paged = pagination.SimplePaginatedDataView(req.url, 'backups', view, marker) return wsgi.Result(paged.data(), 200)
def index(self, req, tenant_id): """ Return all backups information for a tenant ID. """ LOG.debug("Listing Backups for tenant '%s'" % tenant_id) context = req.environ[wsgi.CONTEXT_KEY] backups, marker = Backup.list(context) view = views.BackupViews(backups) paged = pagination.SimplePaginatedDataView(req.url, 'backups', view, marker) return wsgi.Result(paged.data(), 200)
def index(self, req, tenant_id): """ Return all backups information for a tenant ID. """ LOG.debug("Listing backups for tenant %s", tenant_id) datastore = req.GET.get('datastore') context = req.environ[wsgi.CONTEXT_KEY] policy.authorize_on_tenant(context, 'backup:index') backups, marker = Backup.list(context, datastore) view = views.BackupViews(backups) paged = pagination.SimplePaginatedDataView(req.url, 'backups', view, marker) return wsgi.Result(paged.data(), 200)