|
|
@@ -25,52 +25,49 @@ else:
|
|
|
from django.conf.urls import url as re_path
|
|
|
|
|
|
|
|
|
-# New "query" API
|
|
|
-# https://demo.gethue.com/api/query
|
|
|
-#
|
|
|
-# https://demo.gethue.com/api/query/execute/hive
|
|
|
-# https://demo.gethue.com/api/query/status
|
|
|
-# https://demo.gethue.com/api/query/result
|
|
|
-# https://demo.gethue.com/api/query/logs
|
|
|
+# "New" query API (i.e. connector based, lean arguments).
|
|
|
+# e.g. https://demo.gethue.com/api/query/execute/hive
|
|
|
urlpatterns = [
|
|
|
re_path(r'^query/create_notebook/?$', api_public.create_notebook, name='api_create_notebook'),
|
|
|
re_path(r'^query/autocomplete/?$', api_public.autocomplete, name='api_autocomplete_databases'),
|
|
|
]
|
|
|
|
|
|
-# Compatibility with private API
|
|
|
-# https://demo.gethue.com/notebook/api/editor/execute/hive
|
|
|
+# Compatibility with "old" private API.
|
|
|
+# e.g. https://demo.gethue.com/notebook/api/execute/hive
|
|
|
urlpatterns += [
|
|
|
- re_path(r'^create_notebook/?$', api_public.create_notebook, name='api_create_notebook'),
|
|
|
- re_path(r'^create_session/?$', api_public.create_session, name='create_session'),
|
|
|
- re_path(r'^close_session/?$', api_public.close_session, name='close_session'),
|
|
|
- re_path(r'^execute(?:/(?P<dialect>.+))?/?$', api_public.execute, name='execute'),
|
|
|
- re_path(r'^check_status/?$', api_public.check_status, name='check_status'),
|
|
|
- re_path(r'^fetch_result_data/?$', api_public.fetch_result_data, name='fetch_result_data'),
|
|
|
- re_path(r'^fetch_result_metadata/?$', api_public.fetch_result_metadata, name='fetch_result_metadata'),
|
|
|
- re_path(r'^fetch_result_size/?$', api_public.fetch_result_size, name='fetch_result_size'),
|
|
|
- re_path(r'^cancel_statement/?$', api_public.cancel_statement, name='cancel_statement'),
|
|
|
- re_path(r'^close_statement/?$', api_public.close_statement, name='close_statement'),
|
|
|
- re_path(r'^get_logs/?$', api_public.get_logs, name='get_logs'),
|
|
|
+ re_path(r'^iam/get_config/?$', api_public.get_config),
|
|
|
+
|
|
|
+ re_path(r'^editor/create_notebook/?$', api_public.create_notebook, name='api_create_notebook'),
|
|
|
+ re_path(r'^editor/create_session/?$', api_public.create_session, name='api_create_session'),
|
|
|
+ re_path(r'^editor/close_session/?$', api_public.close_session, name='api_close_session'),
|
|
|
+ re_path(r'^editor/execute(?:/(?P<dialect>.+))?/?$', api_public.execute, name='api_execute'),
|
|
|
+ re_path(r'^editor/check_status/?$', api_public.check_status, name='api_check_status'),
|
|
|
+ re_path(r'^editor/fetch_result_data/?$', api_public.fetch_result_data, name='api_fetch_result_data'),
|
|
|
+ re_path(r'^editor/fetch_result_metadata/?$', api_public.fetch_result_metadata, name='api_fetch_result_metadata'),
|
|
|
+ re_path(r'^editor/fetch_result_size/?$', api_public.fetch_result_size, name='api_fetch_result_size'),
|
|
|
+ re_path(r'^editor/cancel_statement/?$', api_public.cancel_statement, name='api_cancel_statement'),
|
|
|
+ re_path(r'^editor/close_statement/?$', api_public.close_statement, name='api_close_statement'),
|
|
|
+ re_path(r'^editor/get_logs/?$', api_public.get_logs, name='api_get_logs'),
|
|
|
|
|
|
re_path(r'^editor/autocomplete/?$', api_public.autocomplete, name='api_autocomplete_databases'),
|
|
|
re_path(
|
|
|
- r"^autocomplete/(?P<database>[^/?]*)/?$",
|
|
|
+ r"^editor/autocomplete/(?P<database>[^/?]*)/?$",
|
|
|
api_public.autocomplete,
|
|
|
- name="autocomplete_tables",
|
|
|
+ name="api_autocomplete_tables",
|
|
|
),
|
|
|
re_path(
|
|
|
- r"^autocomplete/(?P<database>[^/?]*)/(?P<table>[\w_\-]+)/?$",
|
|
|
+ r"^editor/autocomplete/(?P<database>[^/?]*)/(?P<table>[\w_\-]+)/?$",
|
|
|
api_public.autocomplete,
|
|
|
- name="autocomplete_columns",
|
|
|
+ name="api_autocomplete_columns",
|
|
|
),
|
|
|
re_path(
|
|
|
- r"^autocomplete/(?P<database>[^/?]*)/(?P<table>[\w_\-]+)/(?P<column>\w+)/?$",
|
|
|
+ r"^editor/autocomplete/(?P<database>[^/?]*)/(?P<table>[\w_\-]+)/(?P<column>\w+)/?$",
|
|
|
api_public.autocomplete,
|
|
|
- name="autocomplete_column",
|
|
|
+ name="api_autocomplete_column",
|
|
|
),
|
|
|
re_path(
|
|
|
- r"^autocomplete/(?P<database>[^/?]*)/(?P<table>[\w_\-]+)/(?P<column>\w+)/(?P<nested>.+)/?$",
|
|
|
+ r"^editor/autocomplete/(?P<database>[^/?]*)/(?P<table>[\w_\-]+)/(?P<column>\w+)/(?P<nested>.+)/?$",
|
|
|
api_public.autocomplete,
|
|
|
- name="autocomplete_nested",
|
|
|
+ name="api_autocomplete_nested",
|
|
|
),
|
|
|
]
|