urls.py 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/env python
  2. # Licensed to Cloudera, Inc. under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. Cloudera, Inc. licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. from django.conf.urls import patterns, url
  18. from indexer.conf import ENABLE_NEW_INDEXER
  19. urlpatterns = patterns('indexer.views',
  20. url(r'^install_examples$', 'install_examples', name='install_examples'),
  21. url(r'^importer/$', 'importer', name='importer'),
  22. url(r'^importer/prefill/(?P<source_type>[^/]+)/(?P<target_type>[^/]+)/(?P<target_path>[^/]+)?$', 'importer_prefill', name='importer_prefill'),
  23. )
  24. if ENABLE_NEW_INDEXER.get():
  25. urlpatterns += patterns('indexer.views',
  26. url(r'^$', 'indexes', name='indexes'),
  27. url(r'^indexes/$', 'indexes', name='indexes'),
  28. url(r'^indexes/(?P<index>\w+)/?$', 'indexes', name='indexes'),
  29. url(r'^collections$', 'collections', name='collections'), # Old page
  30. )
  31. else:
  32. urlpatterns += patterns('indexer.views',
  33. url(r'^$', 'collections', name='collections'),
  34. url(r'^indexes/$', 'indexes', name='indexes'),
  35. )
  36. urlpatterns += patterns('indexer.solr_api',
  37. # V2
  38. url(r'^api/aliases/create/$', 'create_alias', name='create_alias'),
  39. url(r'^api/configs/list/$', 'list_configs', name='list_configs'),
  40. url(r'^api/indexe/list/$', 'list_index', name='list_index'),
  41. url(r'^api/indexes/list/$', 'list_indexes', name='list_indexes'),
  42. url(r'^api/indexes/create/$', 'create_index', name='create_index'),
  43. url(r'^api/indexes/sample/$', 'sample_index', name='sample_index'),
  44. url(r'^api/indexes/delete/$', 'delete_indexes', name='delete_indexes'),
  45. )
  46. urlpatterns += patterns('indexer.api3',
  47. # Importer
  48. url(r'^api/indexer/guess_format/$', 'guess_format', name='guess_format'),
  49. url(r'^api/indexer/guess_field_types/$', 'guess_field_types', name='guess_field_types'),
  50. url(r'^api/importer/submit', 'importer_submit', name='importer_submit')
  51. )
  52. # Deprecated
  53. urlpatterns += patterns('indexer.api',
  54. url(r'^api/fields/parse/$', 'parse_fields', name='api_parse_fields'),
  55. url(r'^api/autocomplete/$', 'autocomplete', name='api_autocomplete'),
  56. url(r'^api/collections/$', 'collections', name='api_collections'),
  57. url(r'^api/collections/create/$', 'collections_create', name='api_collections_create'),
  58. url(r'^api/collections/import/$', 'collections_import', name='api_collections_import'),
  59. url(r'^api/collections/remove/$', 'collections_remove', name='api_collections_remove'),
  60. url(r'^api/collections/(?P<collection>[^/]+)/fields/$', 'collections_fields', name='api_collections_fields'),
  61. url(r'^api/collections/(?P<collection>[^/]+)/update/$', 'collections_update', name='api_collections_update'),
  62. url(r'^api/collections/(?P<collection>[^/]+)/data/$', 'collections_data', name='api_collections_data'),
  63. )