mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[api] add available_domains/ endpoint (#7097)
* [api] add available_domains/ endpoint * [available_domains] no trailing whitespaces
This commit is contained in:
@@ -44,7 +44,7 @@ from werkzeug.routing import BaseConverter
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
from superset import (
|
||||
app, appbuilder, cache, db, results_backend,
|
||||
app, appbuilder, cache, conf, db, results_backend,
|
||||
security_manager, sql_lab, viz)
|
||||
from superset.connectors.connector_registry import ConnectorRegistry
|
||||
from superset.connectors.sqla.models import AnnotationDatasource, SqlaTable
|
||||
@@ -1880,6 +1880,20 @@ class Superset(BaseSupersetView):
|
||||
mimetype='text/json',
|
||||
)
|
||||
|
||||
@api
|
||||
@has_access_api
|
||||
@expose('/available_domains/', methods=['GET'])
|
||||
def available_domains(self):
|
||||
"""
|
||||
Returns the list of available Superset Webserver domains (if any)
|
||||
defined in config. This enables charts embedded in other apps to
|
||||
leverage domain sharding if appropriately configured.
|
||||
"""
|
||||
return Response(
|
||||
json.dumps(conf.get('SUPERSET_WEBSERVER_DOMAINS')),
|
||||
mimetype='text/json',
|
||||
)
|
||||
|
||||
@api
|
||||
@has_access_api
|
||||
@expose('/fave_dashboards_by_username/<username>/', methods=['GET'])
|
||||
|
||||
Reference in New Issue
Block a user