urls.py 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. import sys
  18. from oozie.views import editor as oozie_views_editor
  19. from oozie.views import editor2 as oozie_views_editor2
  20. from oozie.views import api as oozie_views_api
  21. from oozie.views import dashboard as oozie_views_dashboard
  22. if sys.version_info[0] > 2:
  23. from django.urls import re_path
  24. else:
  25. from django.conf.urls import url as re_path
  26. IS_URL_NAMESPACED = True
  27. urlpatterns = [
  28. re_path(r'^list_workflows/?$', oozie_views_editor.list_workflows, name='list_workflows'),
  29. re_path(r'^list_trashed_workflows/?$', oozie_views_editor.list_trashed_workflows, name='list_trashed_workflows'),
  30. re_path(r'^create_workflow/?$', oozie_views_editor.create_workflow, name='create_workflow'),
  31. re_path(r'^edit_workflow/(?P<workflow>\d+)/?$', oozie_views_editor.edit_workflow, name='edit_workflow'),
  32. re_path(r'^delete_workflow$', oozie_views_editor.delete_workflow, name='delete_workflow'),
  33. re_path(r'^restore_workflow/?$', oozie_views_editor.restore_workflow, name='restore_workflow'),
  34. re_path(r'^clone_workflow/(?P<workflow>\d+)$', oozie_views_editor.clone_workflow, name='clone_workflow'),
  35. re_path(r'^submit_workflow/(?P<workflow>\d+)$', oozie_views_editor.submit_workflow, name='submit_workflow'),
  36. re_path(r'^schedule_workflow/(?P<workflow>\d+)$', oozie_views_editor.schedule_workflow, name='schedule_workflow'),
  37. re_path(r'^import_workflow/?$', oozie_views_editor.import_workflow, name='import_workflow'),
  38. re_path(r'^import_coordinator/?$', oozie_views_editor.import_coordinator, name='import_coordinator'),
  39. re_path(r'^export_workflow/(?P<workflow>\d+)$', oozie_views_editor.export_workflow, name='export_workflow'),
  40. re_path(r'^list_coordinators(?:/(?P<workflow_id>[-\w]+))?/?$', oozie_views_editor.list_coordinators, name='list_coordinators'),
  41. re_path(r'^list_trashed_coordinators/?$', oozie_views_editor.list_trashed_coordinators, name='list_trashed_coordinators'),
  42. re_path(r'^create_coordinator(?:/(?P<workflow>[-\w]+))?/?$', oozie_views_editor.create_coordinator, name='create_coordinator'),
  43. re_path(r'^edit_coordinator/(?P<coordinator>[-\w]+)$', oozie_views_editor.edit_coordinator, name='edit_coordinator'),
  44. re_path(r'^delete_coordinator$', oozie_views_editor.delete_coordinator, name='delete_coordinator'),
  45. re_path(r'^restore_coordinator$', oozie_views_editor.restore_coordinator, name='restore_coordinator'),
  46. re_path(r'^clone_coordinator/(?P<coordinator>\d+)$', oozie_views_editor.clone_coordinator, name='clone_coordinator'),
  47. re_path(
  48. r'^create_coordinator_dataset/(?P<coordinator>[-\w]+)$',
  49. oozie_views_editor.create_coordinator_dataset,
  50. name='create_coordinator_dataset'
  51. ),
  52. re_path(r'^edit_coordinator_dataset/(?P<dataset>\d+)$', oozie_views_editor.edit_coordinator_dataset, name='edit_coordinator_dataset'),
  53. re_path(
  54. r'^create_coordinator_data/(?P<coordinator>[-\w]+)/(?P<data_type>(input|output))$',
  55. oozie_views_editor.create_coordinator_data,
  56. name='create_coordinator_data'
  57. ),
  58. re_path(r'^submit_coordinator/(?P<coordinator>\d+)$', oozie_views_editor.submit_coordinator, name='submit_coordinator'),
  59. re_path(r'^list_bundles$', oozie_views_editor.list_bundles, name='list_bundles'),
  60. re_path(r'^list_trashed_bundles$', oozie_views_editor.list_trashed_bundles, name='list_trashed_bundles'),
  61. re_path(r'^create_bundle$', oozie_views_editor.create_bundle, name='create_bundle'),
  62. re_path(r'^edit_bundle/(?P<bundle>\d+)$', oozie_views_editor.edit_bundle, name='edit_bundle'),
  63. re_path(r'^submit_bundle/(?P<bundle>\d+)$', oozie_views_editor.submit_bundle, name='submit_bundle'),
  64. re_path(r'^clone_bundle/(?P<bundle>\d+)$', oozie_views_editor.clone_bundle, name='clone_bundle'),
  65. re_path(r'^delete_bundle$', oozie_views_editor.delete_bundle, name='delete_bundle'),
  66. re_path(r'^restore_bundle$', oozie_views_editor.restore_bundle, name='restore_bundle'),
  67. re_path(r'^create_bundled_coordinator/(?P<bundle>\d+)$', oozie_views_editor.create_bundled_coordinator, name='create_bundled_coordinator'),
  68. re_path(
  69. r'^edit_bundled_coordinator/(?P<bundle>\d+)/(?P<bundled_coordinator>\d+)$',
  70. oozie_views_editor.edit_bundled_coordinator,
  71. name='edit_bundled_coordinator'
  72. ),
  73. re_path(r'^list_history$', oozie_views_editor.list_history, name='list_history'), # Unused
  74. re_path(r'^list_history/(?P<record_id>[-\w]+)$', oozie_views_editor.list_history_record, name='list_history_record'),
  75. re_path(r'^install_examples/?$', oozie_views_editor.install_examples, name='install_examples'),
  76. ]
  77. urlpatterns += [
  78. re_path(r'^editor/workflow/list/?$', oozie_views_editor2.list_editor_workflows, name='list_editor_workflows'),
  79. re_path(r'^editor/workflow/edit/?$', oozie_views_editor2.edit_workflow, name='edit_workflow'),
  80. re_path(r'^editor/workflow/new/?$', oozie_views_editor2.new_workflow, name='new_workflow'),
  81. re_path(r'^editor/workflow/delete/?$', oozie_views_editor2.delete_job, name='delete_editor_workflow'),
  82. re_path(r'^editor/workflow/copy/?$', oozie_views_editor2.copy_workflow, name='copy_workflow'),
  83. re_path(r'^editor/workflow/save/?$', oozie_views_editor2.save_workflow, name='save_workflow'),
  84. re_path(r'^editor/workflow/submit/(?P<doc_id>\d+)$', oozie_views_editor2.submit_workflow, name='editor_submit_workflow'),
  85. re_path(
  86. r'^editor/workflow/submit_single_action/(?P<doc_id>\d+)/(?P<node_id>.+)$',
  87. oozie_views_editor2.submit_single_action,
  88. name='submit_single_action'
  89. ),
  90. re_path(r'^editor/workflow/new_node/?$', oozie_views_editor2.new_node, name='new_node'),
  91. re_path(r'^editor/workflow/add_node/?$', oozie_views_editor2.add_node, name='add_node'),
  92. re_path(r'^editor/workflow/parameters/?$', oozie_views_editor2.workflow_parameters, name='workflow_parameters'),
  93. re_path(r'^editor/workflow/action/parameters/?$', oozie_views_editor2.action_parameters, name='action_parameters'),
  94. re_path(r'^editor/workflow/gen_xml/?$', oozie_views_editor2.gen_xml_workflow, name='gen_xml_workflow'),
  95. re_path(r'^editor/workflow/open_v1/?$', oozie_views_editor2.open_old_workflow, name='open_old_workflow'),
  96. re_path(r'^editor/coordinator/list/?$', oozie_views_editor2.list_editor_coordinators, name='list_editor_coordinators'),
  97. re_path(r'^editor/coordinator/edit/?$', oozie_views_editor2.edit_coordinator, name='edit_coordinator'),
  98. re_path(r'^editor/coordinator/new/?$', oozie_views_editor2.new_coordinator, name='new_coordinator'),
  99. re_path(r'^editor/coordinator/delete/?$', oozie_views_editor2.delete_job, name='delete_editor_coordinator'),
  100. re_path(r'^editor/coordinator/copy/?$', oozie_views_editor2.copy_coordinator, name='copy_coordinator'),
  101. re_path(r'^editor/coordinator/save/?$', oozie_views_editor2.save_coordinator, name='save_coordinator'),
  102. re_path(r'^editor/coordinator/submit/(?P<doc_id>[-\w]+)$', oozie_views_editor2.submit_coordinator, name='editor_submit_coordinator'),
  103. re_path(r'^editor/coordinator/gen_xml/?$', oozie_views_editor2.gen_xml_coordinator, name='gen_xml_coordinator'),
  104. re_path(r'^editor/coordinator/open_v1/?$', oozie_views_editor2.open_old_coordinator, name='open_old_coordinator'),
  105. re_path(r'^editor/coordinator/parameters/?$', oozie_views_editor2.coordinator_parameters, name='coordinator_parameters'),
  106. re_path(r'^editor/bundle/list/?$', oozie_views_editor2.list_editor_bundles, name='list_editor_bundles'),
  107. re_path(r'^editor/bundle/edit/?$', oozie_views_editor2.edit_bundle, name='edit_bundle'),
  108. re_path(r'^editor/bundle/new/?$', oozie_views_editor2.new_bundle, name='new_bundle'),
  109. re_path(r'^editor/bundle/delete/?$', oozie_views_editor2.delete_job, name='delete_editor_bundle'),
  110. re_path(r'^editor/bundle/copy/?$', oozie_views_editor2.copy_bundle, name='copy_bundle'),
  111. re_path(r'^editor/bundle/save/?$', oozie_views_editor2.save_bundle, name='save_bundle'),
  112. re_path(r'^editor/bundle/submit/(?P<doc_id>\d+)$', oozie_views_editor2.submit_bundle, name='editor_submit_bundle'),
  113. re_path(r'^editor/bundle/open_v1/?$', oozie_views_editor2.open_old_bundle, name='open_old_bundle'),
  114. ]
  115. urlpatterns += [
  116. re_path(r'^workflows/?$', oozie_views_api.workflows, name='workflows'),
  117. re_path(r'^workflows/(?P<workflow>\d+)$', oozie_views_api.workflow, name='workflow'),
  118. re_path(r'^workflows/(?P<workflow>\d+)/save$', oozie_views_api.workflow_save, name='workflow_save'),
  119. re_path(r'^workflows/(?P<workflow>\d+)/actions$', oozie_views_api.workflow_actions, name='workflow_actions'),
  120. re_path(
  121. r'^workflows/(?P<workflow>\d+)/nodes/(?P<node_type>\w+)/validate$',
  122. oozie_views_api.workflow_validate_node,
  123. name='workflow_validate_node'
  124. ),
  125. re_path(r'^workflows/autocomplete_properties/?$', oozie_views_api.autocomplete_properties, name='autocomplete_properties'),
  126. ]
  127. urlpatterns += [
  128. re_path(r'^$', oozie_views_dashboard.list_oozie_workflows, name='index'),
  129. re_path(r'^list_oozie_workflows/?$', oozie_views_dashboard.list_oozie_workflows, name='list_oozie_workflows'),
  130. re_path(r'^list_oozie_coordinators/?$', oozie_views_dashboard.list_oozie_coordinators, name='list_oozie_coordinators'),
  131. re_path(r'^list_oozie_bundles/?$', oozie_views_dashboard.list_oozie_bundles, name='list_oozie_bundles'),
  132. re_path(r'^list_oozie_workflow/(?P<job_id>[-\w]+)/?$', oozie_views_dashboard.list_oozie_workflow, name='list_oozie_workflow'),
  133. re_path(r'^list_oozie_coordinator/(?P<job_id>[-\w]+)/?$', oozie_views_dashboard.list_oozie_coordinator, name='list_oozie_coordinator'),
  134. re_path(
  135. r'^list_oozie_workflow_action/(?P<action>[-\w@]+)/?$',
  136. oozie_views_dashboard.list_oozie_workflow_action,
  137. name='list_oozie_workflow_action'
  138. ),
  139. re_path(r'^list_oozie_bundle/(?P<job_id>[-\w]+)$', oozie_views_dashboard.list_oozie_bundle, name='list_oozie_bundle'),
  140. re_path(r'^rerun_oozie_job/(?P<job_id>[-\w]+)(?:/(?P<app_path>.+?))?/?$', oozie_views_dashboard.rerun_oozie_job, name='rerun_oozie_job'),
  141. re_path(
  142. r'^rerun_oozie_coord/(?P<job_id>[-\w]+)(?:/(?P<app_path>.+?))?/?$',
  143. oozie_views_dashboard.rerun_oozie_coordinator,
  144. name='rerun_oozie_coord'
  145. ),
  146. re_path(r'^rerun_oozie_bundle/(?P<job_id>[-\w]+)/(?P<app_path>.+?)$', oozie_views_dashboard.rerun_oozie_bundle, name='rerun_oozie_bundle'),
  147. re_path(r'^sync_coord_workflow/(?P<job_id>[-\w]+)$', oozie_views_dashboard.sync_coord_workflow, name='sync_coord_workflow'),
  148. re_path(
  149. r'^manage_oozie_jobs/(?P<job_id>[-\w]+)/(?P<action>(start|suspend|resume|kill|rerun|change|ignore))$',
  150. oozie_views_dashboard.manage_oozie_jobs,
  151. name='manage_oozie_jobs'
  152. ),
  153. re_path(r'^bulk_manage_oozie_jobs/?$', oozie_views_dashboard.bulk_manage_oozie_jobs, name='bulk_manage_oozie_jobs'),
  154. re_path(r'^submit_external_job/(?P<application_path>.+?)$', oozie_views_dashboard.submit_external_job, name='submit_external_job'),
  155. re_path(r'^get_oozie_job_log/(?P<job_id>[-\w]+)$', oozie_views_dashboard.get_oozie_job_log, name='get_oozie_job_log'),
  156. re_path(r'^list_oozie_info/?$', oozie_views_dashboard.list_oozie_info, name='list_oozie_info'),
  157. re_path(r'^list_oozie_sla/?$', oozie_views_dashboard.list_oozie_sla, name='list_oozie_sla'),
  158. ]