robdiciuccio commented on a change in pull request #8941: [dashboards] New,
export api
URL:
https://github.com/apache/incubator-superset/pull/8941#discussion_r366117073
##########
File path: superset/views/dashboard/api.py
##########
@@ -356,3 +361,52 @@ def delete(self, item): # pylint:
disable=arguments-differ
return self.response(200, message="OK")
except SQLAlchemyError as e:
return self.response_422(message=str(e))
+
+ @expose("/export/", methods=["GET"])
+ @protect()
+ @safe
+ @rison(get_export_ids_schema)
+ def export(self, **kwargs):
+ """Export dashboards
+ ---
+ get:
+ parameters:
+ - in: query
+ name: q
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: integer
+ responses:
+ 200:
+ description: Dashboard export
+ content:
+ text/plain:
+ schema:
+ type: string
+ 400:
+ $ref: '#/components/responses/400'
+ 401:
+ $ref: '#/components/responses/401'
+ 404:
+ $ref: '#/components/responses/404'
+ 422:
+ $ref: '#/components/responses/422'
+ 500:
+ $ref: '#/components/responses/500'
+ """
+ query = self.datamodel.session.query(Dashboard).filter(
+ Dashboard.id.in_(kwargs["rison"])
+ )
+ query = self._base_filters.apply_all(query)
+ ids = [item.id for item in query.all()]
+ if not ids:
+ return self.response_404()
+ export = Dashboard.export_dashboards(kwargs["rison"])
Review comment:
`Dashboard.export_dashboards(ids)`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]