From 6d6bbbb6279b9bd3ab453a6ba083d05e63d06d82 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Thu, 9 Nov 2017 17:24:04 -0500 Subject: [PATCH] Update URL strucuture, fixed string based calls --- awx/api/urls.py | 420 --------------------- awx/api/urls/Pipfile | 0 awx/api/urls/__init__.py | 7 + awx/api/urls/activity_stream.py | 17 + awx/api/urls/ad_hoc_command.py | 29 ++ awx/api/urls/ad_hoc_command_event.py | 17 + awx/api/urls/credential.py | 27 ++ awx/api/urls/credential_type.py | 21 ++ awx/api/urls/group.py | 37 ++ awx/api/urls/host.py | 43 +++ awx/api/urls/instance.py | 21 ++ awx/api/urls/instance_group.py | 21 ++ awx/api/urls/inventory.py | 45 +++ awx/api/urls/inventory_script.py | 19 + awx/api/urls/inventory_source.py | 35 ++ awx/api/urls/inventory_update.py | 23 ++ awx/api/urls/invetory.py | 47 +++ awx/api/urls/job.py | 37 ++ awx/api/urls/job_event.py | 21 ++ awx/api/urls/job_host_summary.py | 15 + awx/api/urls/job_template.py | 43 +++ awx/api/urls/label.py | 17 + awx/api/urls/notification.py | 17 + awx/api/urls/notification_template.py | 21 ++ awx/api/urls/organization.py | 47 +++ awx/api/urls/project.py | 43 +++ awx/api/urls/project_update.py | 25 ++ awx/api/urls/role.py | 25 ++ awx/api/urls/schedule.py | 19 + awx/api/urls/system_job.py | 21 ++ awx/api/urls/system_job_template.py | 29 ++ awx/api/urls/team.py | 31 ++ awx/api/urls/url_template.py | 13 + awx/api/urls/urls.py | 118 ++++++ awx/api/urls/user.py | 33 ++ awx/api/urls/workflow_job.py | 29 ++ awx/api/urls/workflow_job_node.py | 23 ++ awx/api/urls/workflow_job_template.py | 43 +++ awx/api/urls/workflow_job_template_node.py | 23 ++ awx/conf/serializers.py | 2 +- awx/conf/urls.py | 22 +- awx/sso/backends.py | 6 +- awx/sso/middleware.py | 6 +- awx/sso/strategies/__init__.py | 2 - awx/sso/strategies/django_strategy.py | 27 -- awx/sso/urls.py | 23 +- awx/sso/views.py | 2 +- awx/ui/urls.py | 19 +- awx/urls.py | 36 +- 49 files changed, 1166 insertions(+), 501 deletions(-) delete mode 100644 awx/api/urls.py create mode 100644 awx/api/urls/Pipfile create mode 100644 awx/api/urls/__init__.py create mode 100644 awx/api/urls/activity_stream.py create mode 100644 awx/api/urls/ad_hoc_command.py create mode 100644 awx/api/urls/ad_hoc_command_event.py create mode 100644 awx/api/urls/credential.py create mode 100644 awx/api/urls/credential_type.py create mode 100644 awx/api/urls/group.py create mode 100644 awx/api/urls/host.py create mode 100644 awx/api/urls/instance.py create mode 100644 awx/api/urls/instance_group.py create mode 100644 awx/api/urls/inventory.py create mode 100644 awx/api/urls/inventory_script.py create mode 100644 awx/api/urls/inventory_source.py create mode 100644 awx/api/urls/inventory_update.py create mode 100644 awx/api/urls/invetory.py create mode 100644 awx/api/urls/job.py create mode 100644 awx/api/urls/job_event.py create mode 100644 awx/api/urls/job_host_summary.py create mode 100644 awx/api/urls/job_template.py create mode 100644 awx/api/urls/label.py create mode 100644 awx/api/urls/notification.py create mode 100644 awx/api/urls/notification_template.py create mode 100644 awx/api/urls/organization.py create mode 100644 awx/api/urls/project.py create mode 100644 awx/api/urls/project_update.py create mode 100644 awx/api/urls/role.py create mode 100644 awx/api/urls/schedule.py create mode 100644 awx/api/urls/system_job.py create mode 100644 awx/api/urls/system_job_template.py create mode 100644 awx/api/urls/team.py create mode 100644 awx/api/urls/url_template.py create mode 100644 awx/api/urls/urls.py create mode 100644 awx/api/urls/user.py create mode 100644 awx/api/urls/workflow_job.py create mode 100644 awx/api/urls/workflow_job_node.py create mode 100644 awx/api/urls/workflow_job_template.py create mode 100644 awx/api/urls/workflow_job_template_node.py delete mode 100644 awx/sso/strategies/__init__.py delete mode 100644 awx/sso/strategies/django_strategy.py diff --git a/awx/api/urls.py b/awx/api/urls.py deleted file mode 100644 index f2eb18777f..0000000000 --- a/awx/api/urls.py +++ /dev/null @@ -1,420 +0,0 @@ -# Copyright (c) 2015 Ansible, Inc. -# All Rights Reserved. - -# noqa - -from django.conf.urls import include, patterns, url as original_url - -def url(regex, view, kwargs=None, name=None, prefix=''): - # Set default name from view name (if a string). - if isinstance(view, basestring) and name is None: - name = view - return original_url(regex, view, kwargs, name, prefix) - -organization_urls = patterns('awx.api.views', - url(r'^$', 'organization_list'), - url(r'^(?P[0-9]+)/$', 'organization_detail'), - url(r'^(?P[0-9]+)/users/$', 'organization_users_list'), - url(r'^(?P[0-9]+)/admins/$', 'organization_admins_list'), - url(r'^(?P[0-9]+)/inventories/$', 'organization_inventories_list'), - url(r'^(?P[0-9]+)/projects/$', 'organization_projects_list'), - url(r'^(?P[0-9]+)/workflow_job_templates/$', 'organization_workflow_job_templates_list'), - url(r'^(?P[0-9]+)/teams/$', 'organization_teams_list'), - url(r'^(?P[0-9]+)/credentials/$', 'organization_credential_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'organization_activity_stream_list'), - url(r'^(?P[0-9]+)/notification_templates/$', 'organization_notification_templates_list'), - url(r'^(?P[0-9]+)/notification_templates_any/$', 'organization_notification_templates_any_list'), - url(r'^(?P[0-9]+)/notification_templates_error/$', 'organization_notification_templates_error_list'), - url(r'^(?P[0-9]+)/notification_templates_success/$', 'organization_notification_templates_success_list'), - url(r'^(?P[0-9]+)/instance_groups/$', 'organization_instance_groups_list'), - url(r'^(?P[0-9]+)/object_roles/$', 'organization_object_roles_list'), - url(r'^(?P[0-9]+)/access_list/$', 'organization_access_list'), -) - -user_urls = patterns('awx.api.views', - url(r'^$', 'user_list'), - url(r'^(?P[0-9]+)/$', 'user_detail'), - url(r'^(?P[0-9]+)/teams/$', 'user_teams_list'), - url(r'^(?P[0-9]+)/organizations/$', 'user_organizations_list'), - url(r'^(?P[0-9]+)/admin_of_organizations/$', 'user_admin_of_organizations_list'), - url(r'^(?P[0-9]+)/projects/$', 'user_projects_list'), - url(r'^(?P[0-9]+)/credentials/$', 'user_credentials_list'), - url(r'^(?P[0-9]+)/roles/$', 'user_roles_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'user_activity_stream_list'), - url(r'^(?P[0-9]+)/access_list/$', 'user_access_list'), - -) - -project_urls = patterns('awx.api.views', - url(r'^$', 'project_list'), - url(r'^(?P[0-9]+)/$', 'project_detail'), - url(r'^(?P[0-9]+)/playbooks/$', 'project_playbooks'), - url(r'^(?P[0-9]+)/inventories/$', 'project_inventories'), - url(r'^(?P[0-9]+)/scm_inventory_sources/$', 'project_scm_inventory_sources'), - url(r'^(?P[0-9]+)/teams/$', 'project_teams_list'), - url(r'^(?P[0-9]+)/update/$', 'project_update_view'), - url(r'^(?P[0-9]+)/project_updates/$', 'project_updates_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'project_activity_stream_list'), - url(r'^(?P[0-9]+)/schedules/$', 'project_schedules_list'), - url(r'^(?P[0-9]+)/notification_templates_any/$', 'project_notification_templates_any_list'), - url(r'^(?P[0-9]+)/notification_templates_error/$', 'project_notification_templates_error_list'), - url(r'^(?P[0-9]+)/notification_templates_success/$', 'project_notification_templates_success_list'), - url(r'^(?P[0-9]+)/object_roles/$', 'project_object_roles_list'), - url(r'^(?P[0-9]+)/access_list/$', 'project_access_list'), -) - -project_update_urls = patterns('awx.api.views', - url(r'^$', 'project_update_list'), - url(r'^(?P[0-9]+)/$', 'project_update_detail'), - url(r'^(?P[0-9]+)/cancel/$', 'project_update_cancel'), - url(r'^(?P[0-9]+)/stdout/$', 'project_update_stdout'), - url(r'^(?P[0-9]+)/scm_inventory_updates/$', 'project_update_scm_inventory_updates'), - url(r'^(?P[0-9]+)/notifications/$', 'project_update_notifications_list'), -) - -team_urls = patterns('awx.api.views', - url(r'^$', 'team_list'), - url(r'^(?P[0-9]+)/$', 'team_detail'), - url(r'^(?P[0-9]+)/projects/$', 'team_projects_list'), - url(r'^(?P[0-9]+)/users/$', 'team_users_list'), - url(r'^(?P[0-9]+)/credentials/$', 'team_credentials_list'), - url(r'^(?P[0-9]+)/roles/$', 'team_roles_list'), - url(r'^(?P[0-9]+)/object_roles/$', 'team_object_roles_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'team_activity_stream_list'), - url(r'^(?P[0-9]+)/access_list/$', 'team_access_list'), -) - -inventory_urls = patterns('awx.api.views', - url(r'^$', 'inventory_list'), - url(r'^(?P[0-9]+)/$', 'inventory_detail'), - url(r'^(?P[0-9]+)/hosts/$', 'inventory_hosts_list'), - url(r'^(?P[0-9]+)/groups/$', 'inventory_groups_list'), - url(r'^(?P[0-9]+)/root_groups/$', 'inventory_root_groups_list'), - url(r'^(?P[0-9]+)/variable_data/$', 'inventory_variable_data'), - url(r'^(?P[0-9]+)/script/$', 'inventory_script_view'), - url(r'^(?P[0-9]+)/tree/$', 'inventory_tree_view'), - url(r'^(?P[0-9]+)/inventory_sources/$', 'inventory_inventory_sources_list'), - url(r'^(?P[0-9]+)/update_inventory_sources/$', 'inventory_inventory_sources_update'), - url(r'^(?P[0-9]+)/activity_stream/$', 'inventory_activity_stream_list'), - url(r'^(?P[0-9]+)/job_templates/$', 'inventory_job_template_list'), - url(r'^(?P[0-9]+)/ad_hoc_commands/$', 'inventory_ad_hoc_commands_list'), - url(r'^(?P[0-9]+)/access_list/$', 'inventory_access_list'), - url(r'^(?P[0-9]+)/object_roles/$', 'inventory_object_roles_list'), - url(r'^(?P[0-9]+)/instance_groups/$', 'inventory_instance_groups_list'), - #url(r'^(?P[0-9]+)/single_fact/$', 'inventory_single_fact_view'), -) - -host_urls = patterns('awx.api.views', - url(r'^$', 'host_list'), - url(r'^(?P[0-9]+)/$', 'host_detail'), - url(r'^(?P[0-9]+)/variable_data/$', 'host_variable_data'), - url(r'^(?P[0-9]+)/groups/$', 'host_groups_list'), - url(r'^(?P[0-9]+)/all_groups/$', 'host_all_groups_list'), - url(r'^(?P[0-9]+)/job_events/', 'host_job_events_list'), - url(r'^(?P[0-9]+)/job_host_summaries/$', 'host_job_host_summaries_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'host_activity_stream_list'), - url(r'^(?P[0-9]+)/inventory_sources/$', 'host_inventory_sources_list'), - url(r'^(?P[0-9]+)/smart_inventories/$', 'host_smart_inventories_list'), - url(r'^(?P[0-9]+)/ad_hoc_commands/$', 'host_ad_hoc_commands_list'), - url(r'^(?P[0-9]+)/ad_hoc_command_events/$', 'host_ad_hoc_command_events_list'), - #url(r'^(?P[0-9]+)/single_fact/$', 'host_single_fact_view'), - url(r'^(?P[0-9]+)/fact_versions/$', 'host_fact_versions_list'), - url(r'^(?P[0-9]+)/fact_view/$', 'host_fact_compare_view'), - url(r'^(?P[0-9]+)/insights/$', 'host_insights'), -) - -group_urls = patterns('awx.api.views', - url(r'^$', 'group_list'), - url(r'^(?P[0-9]+)/$', 'group_detail'), - url(r'^(?P[0-9]+)/children/$', 'group_children_list'), - url(r'^(?P[0-9]+)/hosts/$', 'group_hosts_list'), - url(r'^(?P[0-9]+)/all_hosts/$', 'group_all_hosts_list'), - url(r'^(?P[0-9]+)/variable_data/$', 'group_variable_data'), - url(r'^(?P[0-9]+)/job_events/$', 'group_job_events_list'), - url(r'^(?P[0-9]+)/job_host_summaries/$', 'group_job_host_summaries_list'), - url(r'^(?P[0-9]+)/potential_children/$', 'group_potential_children_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'group_activity_stream_list'), - url(r'^(?P[0-9]+)/inventory_sources/$', 'group_inventory_sources_list'), - url(r'^(?P[0-9]+)/ad_hoc_commands/$', 'group_ad_hoc_commands_list'), - #url(r'^(?P[0-9]+)/single_fact/$', 'group_single_fact_view'), -) - -inventory_source_urls = patterns('awx.api.views', - url(r'^$', 'inventory_source_list'), - url(r'^(?P[0-9]+)/$', 'inventory_source_detail'), - url(r'^(?P[0-9]+)/update/$', 'inventory_source_update_view'), - url(r'^(?P[0-9]+)/inventory_updates/$', 'inventory_source_updates_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'inventory_source_activity_stream_list'), - url(r'^(?P[0-9]+)/schedules/$', 'inventory_source_schedules_list'), - url(r'^(?P[0-9]+)/groups/$', 'inventory_source_groups_list'), - url(r'^(?P[0-9]+)/hosts/$', 'inventory_source_hosts_list'), - url(r'^(?P[0-9]+)/notification_templates_any/$', 'inventory_source_notification_templates_any_list'), - url(r'^(?P[0-9]+)/notification_templates_error/$', 'inventory_source_notification_templates_error_list'), - url(r'^(?P[0-9]+)/notification_templates_success/$', 'inventory_source_notification_templates_success_list'), -) - -inventory_update_urls = patterns('awx.api.views', - url(r'^$', 'inventory_update_list'), - url(r'^(?P[0-9]+)/$', 'inventory_update_detail'), - url(r'^(?P[0-9]+)/cancel/$', 'inventory_update_cancel'), - url(r'^(?P[0-9]+)/stdout/$', 'inventory_update_stdout'), - url(r'^(?P[0-9]+)/notifications/$', 'inventory_update_notifications_list'), -) - -inventory_script_urls = patterns('awx.api.views', - url(r'^$', 'inventory_script_list'), - url(r'^(?P[0-9]+)/$', 'inventory_script_detail'), - url(r'^(?P[0-9]+)/object_roles/$', 'inventory_script_object_roles_list'), -) - -credential_type_urls = patterns('awx.api.views', - url(r'^$', 'credential_type_list'), - url(r'^(?P[0-9]+)/$', 'credential_type_detail'), - url(r'^(?P[0-9]+)/credentials/$', 'credential_type_credential_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'credential_type_activity_stream_list'), -) - -credential_urls = patterns('awx.api.views', - url(r'^$', 'credential_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'credential_activity_stream_list'), - url(r'^(?P[0-9]+)/$', 'credential_detail'), - url(r'^(?P[0-9]+)/access_list/$', 'credential_access_list'), - url(r'^(?P[0-9]+)/object_roles/$', 'credential_object_roles_list'), - url(r'^(?P[0-9]+)/owner_users/$', 'credential_owner_users_list'), - url(r'^(?P[0-9]+)/owner_teams/$', 'credential_owner_teams_list'), - # See also credentials resources on users/teams. -) - -role_urls = patterns('awx.api.views', - url(r'^$', 'role_list'), - url(r'^(?P[0-9]+)/$', 'role_detail'), - url(r'^(?P[0-9]+)/users/$', 'role_users_list'), - url(r'^(?P[0-9]+)/teams/$', 'role_teams_list'), - url(r'^(?P[0-9]+)/parents/$', 'role_parents_list'), - url(r'^(?P[0-9]+)/children/$', 'role_children_list'), -) - -job_template_urls = patterns('awx.api.views', - url(r'^$', 'job_template_list'), - url(r'^(?P[0-9]+)/$', 'job_template_detail'), - url(r'^(?P[0-9]+)/launch/$', 'job_template_launch'), - url(r'^(?P[0-9]+)/jobs/$', 'job_template_jobs_list'), - url(r'^(?P[0-9]+)/callback/$', 'job_template_callback'), - url(r'^(?P[0-9]+)/schedules/$', 'job_template_schedules_list'), - url(r'^(?P[0-9]+)/survey_spec/$', 'job_template_survey_spec'), - url(r'^(?P[0-9]+)/activity_stream/$', 'job_template_activity_stream_list'), - url(r'^(?P[0-9]+)/notification_templates_any/$', 'job_template_notification_templates_any_list'), - url(r'^(?P[0-9]+)/notification_templates_error/$', 'job_template_notification_templates_error_list'), - url(r'^(?P[0-9]+)/notification_templates_success/$', 'job_template_notification_templates_success_list'), - url(r'^(?P[0-9]+)/instance_groups/$', 'job_template_instance_groups_list'), - url(r'^(?P[0-9]+)/access_list/$', 'job_template_access_list'), - url(r'^(?P[0-9]+)/object_roles/$', 'job_template_object_roles_list'), - url(r'^(?P[0-9]+)/labels/$', 'job_template_label_list'), -) - -job_urls = patterns('awx.api.views', - url(r'^$', 'job_list'), - url(r'^(?P[0-9]+)/$', 'job_detail'), - url(r'^(?P[0-9]+)/start/$', 'job_start'), # TODO: remove in 3.3 - url(r'^(?P[0-9]+)/cancel/$', 'job_cancel'), - url(r'^(?P[0-9]+)/relaunch/$', 'job_relaunch'), - url(r'^(?P[0-9]+)/job_host_summaries/$', 'job_job_host_summaries_list'), - url(r'^(?P[0-9]+)/job_events/$', 'job_job_events_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'job_activity_stream_list'), - url(r'^(?P[0-9]+)/stdout/$', 'job_stdout'), - url(r'^(?P[0-9]+)/notifications/$', 'job_notifications_list'), - url(r'^(?P[0-9]+)/labels/$', 'job_label_list'), -) - -job_host_summary_urls = patterns('awx.api.views', - url(r'^(?P[0-9]+)/$', 'job_host_summary_detail'), -) - -job_event_urls = patterns('awx.api.views', - url(r'^$', 'job_event_list'), - url(r'^(?P[0-9]+)/$', 'job_event_detail'), - url(r'^(?P[0-9]+)/children/$', 'job_event_children_list'), - url(r'^(?P[0-9]+)/hosts/$', 'job_event_hosts_list'), -) - -ad_hoc_command_urls = patterns('awx.api.views', - url(r'^$', 'ad_hoc_command_list'), - url(r'^(?P[0-9]+)/$', 'ad_hoc_command_detail'), - url(r'^(?P[0-9]+)/cancel/$', 'ad_hoc_command_cancel'), - url(r'^(?P[0-9]+)/relaunch/$', 'ad_hoc_command_relaunch'), - url(r'^(?P[0-9]+)/events/$', 'ad_hoc_command_ad_hoc_command_events_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'ad_hoc_command_activity_stream_list'), - url(r'^(?P[0-9]+)/notifications/$', 'ad_hoc_command_notifications_list'), - url(r'^(?P[0-9]+)/stdout/$', 'ad_hoc_command_stdout'), -) - -ad_hoc_command_event_urls = patterns('awx.api.views', - url(r'^$', 'ad_hoc_command_event_list'), - url(r'^(?P[0-9]+)/$', 'ad_hoc_command_event_detail'), -) - -system_job_template_urls = patterns('awx.api.views', - url(r'^$', 'system_job_template_list'), - url(r'^(?P[0-9]+)/$', 'system_job_template_detail'), - url(r'^(?P[0-9]+)/launch/$', 'system_job_template_launch'), - url(r'^(?P[0-9]+)/jobs/$', 'system_job_template_jobs_list'), - url(r'^(?P[0-9]+)/schedules/$', 'system_job_template_schedules_list'), - url(r'^(?P[0-9]+)/notification_templates_any/$', 'system_job_template_notification_templates_any_list'), - url(r'^(?P[0-9]+)/notification_templates_error/$', 'system_job_template_notification_templates_error_list'), - url(r'^(?P[0-9]+)/notification_templates_success/$', 'system_job_template_notification_templates_success_list'), -) - -system_job_urls = patterns('awx.api.views', - url(r'^$', 'system_job_list'), - url(r'^(?P[0-9]+)/$', 'system_job_detail'), - url(r'^(?P[0-9]+)/cancel/$', 'system_job_cancel'), - url(r'^(?P[0-9]+)/notifications/$', 'system_job_notifications_list'), -) - -workflow_job_template_urls = patterns('awx.api.views', - url(r'^$', 'workflow_job_template_list'), - url(r'^(?P[0-9]+)/$', 'workflow_job_template_detail'), - url(r'^(?P[0-9]+)/workflow_jobs/$', 'workflow_job_template_jobs_list'), - url(r'^(?P[0-9]+)/launch/$', 'workflow_job_template_launch'), - url(r'^(?P[0-9]+)/copy/$', 'workflow_job_template_copy'), - url(r'^(?P[0-9]+)/schedules/$', 'workflow_job_template_schedules_list'), - url(r'^(?P[0-9]+)/survey_spec/$', 'workflow_job_template_survey_spec'), - url(r'^(?P[0-9]+)/workflow_nodes/$', 'workflow_job_template_workflow_nodes_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'workflow_job_template_activity_stream_list'), - url(r'^(?P[0-9]+)/notification_templates_any/$', 'workflow_job_template_notification_templates_any_list'), - url(r'^(?P[0-9]+)/notification_templates_error/$', 'workflow_job_template_notification_templates_error_list'), - url(r'^(?P[0-9]+)/notification_templates_success/$', 'workflow_job_template_notification_templates_success_list'), - url(r'^(?P[0-9]+)/access_list/$', 'workflow_job_template_access_list'), - url(r'^(?P[0-9]+)/object_roles/$', 'workflow_job_template_object_roles_list'), - url(r'^(?P[0-9]+)/labels/$', 'workflow_job_template_label_list'), -) - -workflow_job_urls = patterns('awx.api.views', - url(r'^$', 'workflow_job_list'), - url(r'^(?P[0-9]+)/$', 'workflow_job_detail'), - url(r'^(?P[0-9]+)/workflow_nodes/$', 'workflow_job_workflow_nodes_list'), - url(r'^(?P[0-9]+)/labels/$', 'workflow_job_label_list'), - url(r'^(?P[0-9]+)/cancel/$', 'workflow_job_cancel'), - url(r'^(?P[0-9]+)/relaunch/$', 'workflow_job_relaunch'), - url(r'^(?P[0-9]+)/notifications/$', 'workflow_job_notifications_list'), - url(r'^(?P[0-9]+)/activity_stream/$', 'workflow_job_activity_stream_list'), -) - - -notification_template_urls = patterns('awx.api.views', - url(r'^$', 'notification_template_list'), - url(r'^(?P[0-9]+)/$', 'notification_template_detail'), - url(r'^(?P[0-9]+)/test/$', 'notification_template_test'), - url(r'^(?P[0-9]+)/notifications/$', 'notification_template_notification_list'), -) - -notification_urls = patterns('awx.api.views', - url(r'^$', 'notification_list'), - url(r'^(?P[0-9]+)/$', 'notification_detail'), -) - -label_urls = patterns('awx.api.views', - url(r'^$', 'label_list'), - url(r'^(?P[0-9]+)/$', 'label_detail'), -) - -workflow_job_template_node_urls = patterns('awx.api.views', - url(r'^$', 'workflow_job_template_node_list'), - url(r'^(?P[0-9]+)/$', 'workflow_job_template_node_detail'), - url(r'^(?P[0-9]+)/success_nodes/$', 'workflow_job_template_node_success_nodes_list'), - url(r'^(?P[0-9]+)/failure_nodes/$', 'workflow_job_template_node_failure_nodes_list'), - url(r'^(?P[0-9]+)/always_nodes/$', 'workflow_job_template_node_always_nodes_list'), -) - -workflow_job_node_urls = patterns('awx.api.views', - url(r'^$', 'workflow_job_node_list'), - url(r'^(?P[0-9]+)/$', 'workflow_job_node_detail'), - url(r'^(?P[0-9]+)/success_nodes/$', 'workflow_job_node_success_nodes_list'), - url(r'^(?P[0-9]+)/failure_nodes/$', 'workflow_job_node_failure_nodes_list'), - url(r'^(?P[0-9]+)/always_nodes/$', 'workflow_job_node_always_nodes_list'), -) - -schedule_urls = patterns('awx.api.views', - url(r'^$', 'schedule_list'), - url(r'^(?P[0-9]+)/$', 'schedule_detail'), - url(r'^(?P[0-9]+)/jobs/$', 'schedule_unified_jobs_list'), -) - -activity_stream_urls = patterns('awx.api.views', - url(r'^$', 'activity_stream_list'), - url(r'^(?P[0-9]+)/$', 'activity_stream_detail'), -) - -instance_urls = patterns('awx.api.views', - url(r'^$', 'instance_list'), - url(r'^(?P[0-9]+)/$', 'instance_detail'), - url(r'^(?P[0-9]+)/jobs/$', 'instance_unified_jobs_list'), - url(r'^(?P[0-9]+)/instance_groups/$', 'instance_instance_groups_list'), -) - -instance_group_urls = patterns('awx.api.views', - url(r'^$', 'instance_group_list'), - url(r'^(?P[0-9]+)/$', 'instance_group_detail'), - url(r'^(?P[0-9]+)/jobs/$', 'instance_group_unified_jobs_list'), - url(r'^(?P[0-9]+)/instances/$', 'instance_group_instance_list'), -) - -v1_urls = patterns('awx.api.views', - url(r'^$', 'api_v1_root_view'), - url(r'^ping/$', 'api_v1_ping_view'), - url(r'^config/$', 'api_v1_config_view'), - url(r'^auth/$', 'auth_view'), - url(r'^authtoken/$', 'auth_token_view'), - url(r'^me/$', 'user_me_list'), - url(r'^dashboard/$', 'dashboard_view'), - url(r'^dashboard/graphs/jobs/$','dashboard_jobs_graph_view'), - url(r'^settings/', include('awx.conf.urls')), - url(r'^instances/', include(instance_urls)), - url(r'^instance_groups/', include(instance_group_urls)), - url(r'^schedules/', include(schedule_urls)), - url(r'^organizations/', include(organization_urls)), - url(r'^users/', include(user_urls)), - url(r'^projects/', include(project_urls)), - url(r'^project_updates/', include(project_update_urls)), - url(r'^teams/', include(team_urls)), - url(r'^inventories/', include(inventory_urls)), - url(r'^hosts/', include(host_urls)), - url(r'^groups/', include(group_urls)), - url(r'^inventory_sources/', include(inventory_source_urls)), - url(r'^inventory_updates/', include(inventory_update_urls)), - url(r'^inventory_scripts/', include(inventory_script_urls)), - url(r'^credentials/', include(credential_urls)), - url(r'^roles/', include(role_urls)), - url(r'^job_templates/', include(job_template_urls)), - url(r'^jobs/', include(job_urls)), - url(r'^job_host_summaries/', include(job_host_summary_urls)), - url(r'^job_events/', include(job_event_urls)), - url(r'^ad_hoc_commands/', include(ad_hoc_command_urls)), - url(r'^ad_hoc_command_events/', include(ad_hoc_command_event_urls)), - url(r'^system_job_templates/', include(system_job_template_urls)), - url(r'^system_jobs/', include(system_job_urls)), - url(r'^notification_templates/', include(notification_template_urls)), - url(r'^notifications/', include(notification_urls)), - url(r'^workflow_job_templates/',include(workflow_job_template_urls)), - url(r'^workflow_jobs/' ,include(workflow_job_urls)), - url(r'^labels/', include(label_urls)), - url(r'^workflow_job_template_nodes/', include(workflow_job_template_node_urls)), - url(r'^workflow_job_nodes/', include(workflow_job_node_urls)), - url(r'^unified_job_templates/$','unified_job_template_list'), - url(r'^unified_jobs/$', 'unified_job_list'), - url(r'^activity_stream/', include(activity_stream_urls)), -) - -v2_urls = patterns('awx.api.views', - url(r'^$', 'api_v2_root_view'), - url(r'^credential_types/', include(credential_type_urls)), - url(r'^hosts/(?P[0-9]+)/ansible_facts/$', 'host_ansible_facts_detail'), - url(r'^jobs/(?P[0-9]+)/extra_credentials/$', 'job_extra_credentials_list'), - url(r'^job_templates/(?P[0-9]+)/extra_credentials/$', 'job_template_extra_credentials_list'), -) - -urlpatterns = patterns('awx.api.views', - url(r'^$', 'api_root_view'), - url(r'^(?P(v2))/', include(v2_urls)), - url(r'^(?P(v1|v2))/', include(v1_urls)) -) diff --git a/awx/api/urls/Pipfile b/awx/api/urls/Pipfile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/awx/api/urls/__init__.py b/awx/api/urls/__init__.py new file mode 100644 index 0000000000..22c0a39999 --- /dev/null +++ b/awx/api/urls/__init__.py @@ -0,0 +1,7 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from __future__ import absolute_import, unicode_literals +from .urls import urlpatterns + +__all__ = ['urlpatterns'] diff --git a/awx/api/urls/activity_stream.py b/awx/api/urls/activity_stream.py new file mode 100644 index 0000000000..cfca532970 --- /dev/null +++ b/awx/api/urls/activity_stream.py @@ -0,0 +1,17 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + ActivityStreamList, + ActivityStreamDetail, +) + + +urls = [ + url(r'^$', ActivityStreamList.as_view(), name='activity_stream_list'), + url(r'^(?P[0-9]+)/$', ActivityStreamDetail.as_view(), name='activity_stream_detail'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/ad_hoc_command.py b/awx/api/urls/ad_hoc_command.py new file mode 100644 index 0000000000..cc1277adcf --- /dev/null +++ b/awx/api/urls/ad_hoc_command.py @@ -0,0 +1,29 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + AdHocCommandList, + AdHocCommandDetail, + AdHocCommandCancel, + AdHocCommandRelaunch, + AdHocCommandAdHocCommandEventsList, + AdHocCommandActivityStreamList, + AdHocCommandNotificationsList, + AdHocCommandStdout, +) + + +urls = [ + url(r'^$', AdHocCommandList.as_view(), name='ad_hoc_command_list'), + url(r'^(?P[0-9]+)/$', AdHocCommandDetail.as_view(), name='ad_hoc_command_detail'), + url(r'^(?P[0-9]+)/cancel/$', AdHocCommandCancel.as_view(), name='ad_hoc_command_cancel'), + url(r'^(?P[0-9]+)/relaunch/$', AdHocCommandRelaunch.as_view(), name='ad_hoc_command_relaunch'), + url(r'^(?P[0-9]+)/events/$', AdHocCommandAdHocCommandEventsList.as_view(), name='ad_hoc_command_ad_hoc_command_events_list'), + url(r'^(?P[0-9]+)/activity_stream/$', AdHocCommandActivityStreamList.as_view(), name='ad_hoc_command_activity_stream_list'), + url(r'^(?P[0-9]+)/notifications/$', AdHocCommandNotificationsList.as_view(), name='ad_hoc_command_notifications_list'), + url(r'^(?P[0-9]+)/stdout/$', AdHocCommandStdout.as_view(), name='ad_hoc_command_stdout'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/ad_hoc_command_event.py b/awx/api/urls/ad_hoc_command_event.py new file mode 100644 index 0000000000..21af85d2ad --- /dev/null +++ b/awx/api/urls/ad_hoc_command_event.py @@ -0,0 +1,17 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + AdHocCommandEventList, + AdHocCommandEventDetail, +) + + +urls = [ + url(r'^$', AdHocCommandEventList.as_view(), name='ad_hoc_command_event_list'), + url(r'^(?P[0-9]+)/$', AdHocCommandEventDetail.as_view(), name='ad_hoc_command_event_detail'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/credential.py b/awx/api/urls/credential.py new file mode 100644 index 0000000000..b8480ab4e8 --- /dev/null +++ b/awx/api/urls/credential.py @@ -0,0 +1,27 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + CredentialList, + CredentialActivityStreamList, + CredentialDetail, + CredentialAccessList, + CredentialObjectRolesList, + CredentialOwnerUsersList, + CredentialOwnerTeamsList, +) + + +urls = [ + url(r'^$', CredentialList.as_view(), name='credential_list'), + url(r'^(?P[0-9]+)/activity_stream/$', CredentialActivityStreamList.as_view(), name='credential_activity_stream_list'), + url(r'^(?P[0-9]+)/$', CredentialDetail.as_view(), name='credential_detail'), + url(r'^(?P[0-9]+)/access_list/$', CredentialAccessList.as_view(), name='credential_access_list'), + url(r'^(?P[0-9]+)/object_roles/$', CredentialObjectRolesList.as_view(), name='credential_object_roles_list'), + url(r'^(?P[0-9]+)/owner_users/$', CredentialOwnerUsersList.as_view(), name='credential_owner_users_list'), + url(r'^(?P[0-9]+)/owner_teams/$', CredentialOwnerTeamsList.as_view(), name='credential_owner_teams_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/credential_type.py b/awx/api/urls/credential_type.py new file mode 100644 index 0000000000..22c097523b --- /dev/null +++ b/awx/api/urls/credential_type.py @@ -0,0 +1,21 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + CredentialTypeList, + CredentialTypeDetail, + CredentialTypeCredentialList, + CredentialTypeActivityStreamList, +) + + +urls = [ + url(r'^$', CredentialTypeList.as_view(), name='credential_type_list'), + url(r'^(?P[0-9]+)/$', CredentialTypeDetail.as_view(), name='credential_type_detail'), + url(r'^(?P[0-9]+)/credentials/$', CredentialTypeCredentialList.as_view(), name='credential_type_credential_list'), + url(r'^(?P[0-9]+)/activity_stream/$', CredentialTypeActivityStreamList.as_view(), name='credential_type_activity_stream_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/group.py b/awx/api/urls/group.py new file mode 100644 index 0000000000..416479def6 --- /dev/null +++ b/awx/api/urls/group.py @@ -0,0 +1,37 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + GroupList, + GroupDetail, + GroupChildrenList, + GroupHostsList, + GroupAllHostsList, + GroupVariableData, + GroupJobEventsList, + GroupJobHostSummariesList, + GroupPotentialChildrenList, + GroupActivityStreamList, + GroupInventorySourcesList, + GroupAdHocCommandsList, +) + + +urls = [ + url(r'^$', GroupList.as_view(), name='group_list'), + url(r'^(?P[0-9]+)/$', GroupDetail.as_view(), name='group_detail'), + url(r'^(?P[0-9]+)/children/$', GroupChildrenList.as_view(), name='group_children_list'), + url(r'^(?P[0-9]+)/hosts/$', GroupHostsList.as_view(), name='group_hosts_list'), + url(r'^(?P[0-9]+)/all_hosts/$', GroupAllHostsList.as_view(), name='group_all_hosts_list'), + url(r'^(?P[0-9]+)/variable_data/$', GroupVariableData.as_view(), name='group_variable_data'), + url(r'^(?P[0-9]+)/job_events/$', GroupJobEventsList.as_view(), name='group_job_events_list'), + url(r'^(?P[0-9]+)/job_host_summaries/$', GroupJobHostSummariesList.as_view(), name='group_job_host_summaries_list'), + url(r'^(?P[0-9]+)/potential_children/$', GroupPotentialChildrenList.as_view(), name='group_potential_children_list'), + url(r'^(?P[0-9]+)/activity_stream/$', GroupActivityStreamList.as_view(), name='group_activity_stream_list'), + url(r'^(?P[0-9]+)/inventory_sources/$', GroupInventorySourcesList.as_view(), name='group_inventory_sources_list'), + url(r'^(?P[0-9]+)/ad_hoc_commands/$', GroupAdHocCommandsList.as_view(), name='group_ad_hoc_commands_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/host.py b/awx/api/urls/host.py new file mode 100644 index 0000000000..8bcf73dc44 --- /dev/null +++ b/awx/api/urls/host.py @@ -0,0 +1,43 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + HostList, + HostDetail, + HostVariableData, + HostGroupsList, + HostAllGroupsList, + HostJobEventsList, + HostJobHostSummariesList, + HostActivityStreamList, + HostInventorySourcesList, + HostSmartInventoriesList, + HostAdHocCommandsList, + HostAdHocCommandEventsList, + HostFactVersionsList, + HostFactCompareView, + HostInsights, +) + + +urls = [ + url(r'^$', HostList.as_view(), name='host_list'), + url(r'^(?P[0-9]+)/$', HostDetail.as_view(), name='host_detail'), + url(r'^(?P[0-9]+)/variable_data/$', HostVariableData.as_view(), name='host_variable_data'), + url(r'^(?P[0-9]+)/groups/$', HostGroupsList.as_view(), name='host_groups_list'), + url(r'^(?P[0-9]+)/all_groups/$', HostAllGroupsList.as_view(), name='host_all_groups_list'), + url(r'^(?P[0-9]+)/job_events/', HostJobEventsList.as_view(), name='host_job_events_list'), + url(r'^(?P[0-9]+)/job_host_summaries/$', HostJobHostSummariesList.as_view(), name='host_job_host_summaries_list'), + url(r'^(?P[0-9]+)/activity_stream/$', HostActivityStreamList.as_view(), name='host_activity_stream_list'), + url(r'^(?P[0-9]+)/inventory_sources/$', HostInventorySourcesList.as_view(), name='host_inventory_sources_list'), + url(r'^(?P[0-9]+)/smart_inventories/$', HostSmartInventoriesList.as_view(), name='host_smart_inventories_list'), + url(r'^(?P[0-9]+)/ad_hoc_commands/$', HostAdHocCommandsList.as_view(), name='host_ad_hoc_commands_list'), + url(r'^(?P[0-9]+)/ad_hoc_command_events/$', HostAdHocCommandEventsList.as_view(), name='host_ad_hoc_command_events_list'), + url(r'^(?P[0-9]+)/fact_versions/$', HostFactVersionsList.as_view(), name='host_fact_versions_list'), + url(r'^(?P[0-9]+)/fact_view/$', HostFactCompareView.as_view(), name='host_fact_compare_view'), + url(r'^(?P[0-9]+)/insights/$', HostInsights.as_view(), name='host_insights'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/instance.py b/awx/api/urls/instance.py new file mode 100644 index 0000000000..d72f949f07 --- /dev/null +++ b/awx/api/urls/instance.py @@ -0,0 +1,21 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + InstanceList, + InstanceDetail, + InstanceUnifiedJobsList, + InstanceInstanceGroupsList, +) + + +urls = [ + url(r'^$', InstanceList.as_view(), name='instance_list'), + url(r'^(?P[0-9]+)/$', InstanceDetail.as_view()), + url(r'^(?P[0-9]+)/jobs/$', InstanceUnifiedJobsList.as_view()), + url(r'^(?P[0-9]+)/instance_groups/$', InstanceInstanceGroupsList.as_view()), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/instance_group.py b/awx/api/urls/instance_group.py new file mode 100644 index 0000000000..4192cfe858 --- /dev/null +++ b/awx/api/urls/instance_group.py @@ -0,0 +1,21 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + InstanceGroupList, + InstanceGroupDetail, + InstanceGroupUnifiedJobsList, + InstanceGroupInstanceList, +) + + +urls = [ + url(r'^$', InstanceGroupList.as_view(), name='instance_group_list'), + url(r'^(?P[0-9]+)/$', InstanceGroupDetail.as_view()), + url(r'^(?P[0-9]+)/jobs/$', InstanceGroupUnifiedJobsList.as_view()), + url(r'^(?P[0-9]+)/instances/$', InstanceGroupInstanceList.as_view()), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/inventory.py b/awx/api/urls/inventory.py new file mode 100644 index 0000000000..0d8e2ca8d5 --- /dev/null +++ b/awx/api/urls/inventory.py @@ -0,0 +1,45 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + InventoryList, + InventoryDetail, + InventoryHostsList, + InventoryGroupsList, + InventoryRootGroupsList, + InventoryVariableData, + InventoryScriptView, + InventoryTreeView, + InventoryInventorySourcesList, + InventoryInventorySourcesUpdate, + InventoryActivityStreamList, + InventoryJobTemplateList, + InventoryAdHocCommandsList, + InventoryAccessList, + InventoryObjectRolesList, + InventoryInstanceGroupsList, +) + + +urls = [ + url(r'^$', InventoryList.as_view(), name='inventory_list'), + url(r'^(?P[0-9]+)/$', InventoryDetail.as_view(), name='inventory_detail'), + url(r'^(?P[0-9]+)/hosts/$', InventoryHostsList.as_view(), name='inventory_hosts_list'), + url(r'^(?P[0-9]+)/groups/$', InventoryGroupsList.as_view(), name='inventory_groups_list'), + url(r'^(?P[0-9]+)/root_groups/$', InventoryRootGroupsList.as_view(), name='inventory_root_groups_list'), + url(r'^(?P[0-9]+)/variable_data/$', InventoryVariableData.as_view(), name='inventory_variable_data'), + url(r'^(?P[0-9]+)/script/$', InventoryScriptView.as_view(), name='inventory_script_view'), + url(r'^(?P[0-9]+)/tree/$', InventoryTreeView.as_view(), name='inventory_tree_view'), + url(r'^(?P[0-9]+)/inventory_sources/$', InventoryInventorySourcesList.as_view(), name='inventory_inventory_sources_list'), + url(r'^(?P[0-9]+)/update_inventory_sources/$', InventoryInventorySourcesUpdate.as_view(), name='inventory_inventory_sources_update'), + url(r'^(?P[0-9]+)/activity_stream/$', InventoryActivityStreamList.as_view(), name='inventory_activity_stream_list'), + url(r'^(?P[0-9]+)/job_templates/$', InventoryJobTemplateList.as_view(), name='inventory_job_template_list'), + url(r'^(?P[0-9]+)/ad_hoc_commands/$', InventoryAdHocCommandsList.as_view(), name='inventory_ad_hoc_commands_list'), + url(r'^(?P[0-9]+)/access_list/$', InventoryAccessList.as_view(), name='inventory_access_list'), + url(r'^(?P[0-9]+)/object_roles/$', InventoryObjectRolesList.as_view(), name='inventory_object_roles_list'), + url(r'^(?P[0-9]+)/instance_groups/$', InventoryInstanceGroupsList.as_view(), name='inventory_instance_groups_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/inventory_script.py b/awx/api/urls/inventory_script.py new file mode 100644 index 0000000000..088ccf21ca --- /dev/null +++ b/awx/api/urls/inventory_script.py @@ -0,0 +1,19 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + InventoryScriptList, + InventoryScriptDetail, + InventoryScriptObjectRolesList, +) + + +urls = [ + url(r'^$', InventoryScriptList.as_view(), name='inventory_script_list'), + url(r'^(?P[0-9]+)/$', InventoryScriptDetail.as_view(), name='inventory_script_detail'), + url(r'^(?P[0-9]+)/object_roles/$', InventoryScriptObjectRolesList.as_view(), name='inventory_script_object_roles_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/inventory_source.py b/awx/api/urls/inventory_source.py new file mode 100644 index 0000000000..da19ce6695 --- /dev/null +++ b/awx/api/urls/inventory_source.py @@ -0,0 +1,35 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + InventorySourceList, + InventorySourceDetail, + InventorySourceUpdateView, + InventorySourceUpdatesList, + InventorySourceActivityStreamList, + InventorySourceSchedulesList, + InventorySourceGroupsList, + InventorySourceHostsList, + InventorySourceNotificationTemplatesAnyList, + InventorySourceNotificationTemplatesErrorList, + InventorySourceNotificationTemplatesSuccessList, +) + + +urls = [ + url(r'^$', InventorySourceList.as_view(), name='inventory_source_list'), + url(r'^(?P[0-9]+)/$', InventorySourceDetail.as_view(), name='inventory_source_detail'), + url(r'^(?P[0-9]+)/update/$', InventorySourceUpdateView.as_view(), name='inventory_source_update_view'), + url(r'^(?P[0-9]+)/inventory_updates/$', InventorySourceUpdatesList.as_view(), name='inventory_source_updates_list'), + url(r'^(?P[0-9]+)/activity_stream/$', InventorySourceActivityStreamList.as_view(), name='inventory_source_activity_stream_list'), + url(r'^(?P[0-9]+)/schedules/$', InventorySourceSchedulesList.as_view(), name='inventory_source_schedules_list'), + url(r'^(?P[0-9]+)/groups/$', InventorySourceGroupsList.as_view(), name='inventory_source_groups_list'), + url(r'^(?P[0-9]+)/hosts/$', InventorySourceHostsList.as_view(), name='inventory_source_hosts_list'), + url(r'^(?P[0-9]+)/notification_templates_any/$', InventorySourceNotificationTemplatesAnyList.as_view(), name='inventory_source_notification_templates_any_list'), + url(r'^(?P[0-9]+)/notification_templates_error/$', InventorySourceNotificationTemplatesErrorList.as_view(), name='inventory_source_notification_templates_error_list'), + url(r'^(?P[0-9]+)/notification_templates_success/$', InventorySourceNotificationTemplatesSuccessList.as_view(), name='inventory_source_notification_templates_success_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/inventory_update.py b/awx/api/urls/inventory_update.py new file mode 100644 index 0000000000..2636f846a8 --- /dev/null +++ b/awx/api/urls/inventory_update.py @@ -0,0 +1,23 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + InventoryUpdateList, + InventoryUpdateDetail, + InventoryUpdateCancel, + InventoryUpdateStdout, + InventoryUpdateNotificationsList, +) + + +urls = [ + url(r'^$', InventoryUpdateList.as_view(), name='inventory_update_list'), + url(r'^(?P[0-9]+)/$', InventoryUpdateDetail.as_view(), name='inventory_update_detail'), + url(r'^(?P[0-9]+)/cancel/$', InventoryUpdateCancel.as_view(), name='inventory_update_cancel'), + url(r'^(?P[0-9]+)/stdout/$', InventoryUpdateStdout.as_view(), name='inventory_update_stdout'), + url(r'^(?P[0-9]+)/notifications/$', InventoryUpdateNotificationsList.as_view(), name='inventory_update_notifications_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/invetory.py b/awx/api/urls/invetory.py new file mode 100644 index 0000000000..4f26a92812 --- /dev/null +++ b/awx/api/urls/invetory.py @@ -0,0 +1,47 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + InventoryList, + InventoryDetail, + InventoryHostsList, + InventoryGroupsList, + InventoryRootGroupsList, + InventoryVariableData, + InventoryScriptView, + InventoryTreeView, + InventoryInventorySourcesList, + InventoryInventorySourcesUpdate, + InventoryActivityStreamList, + InventoryJobTemplateList, + InventoryAdHocCommandsList, + InventoryAccessList, + InventoryObjectRolesList, + InventoryInstanceGroupsList, + InventorySingleFactView, +) + + +urls = [ + url(r'^$', InventoryList.as_view(), name='inventory_list'), + url(r'^(?P[0-9]+)/$', InventoryDetail.as_view(), name='inventory_detail'), + url(r'^(?P[0-9]+)/hosts/$', InventoryHostsList.as_view(), name='inventory_hosts_list'), + url(r'^(?P[0-9]+)/groups/$', InventoryGroupsList.as_view(), name='inventory_groups_list'), + url(r'^(?P[0-9]+)/root_groups/$', InventoryRootGroupsList.as_view(), name='inventory_root_groups_list'), + url(r'^(?P[0-9]+)/variable_data/$', InventoryVariableData.as_view(), name='inventory_variable_data'), + url(r'^(?P[0-9]+)/script/$', InventoryScriptView.as_view(), name='inventory_script_view'), + url(r'^(?P[0-9]+)/tree/$', InventoryTreeView.as_view(), name='inventory_tree_view'), + url(r'^(?P[0-9]+)/inventory_sources/$', InventoryInventorySourcesList.as_view(), name='inventory_inventory_sources_list'), + url(r'^(?P[0-9]+)/update_inventory_sources/$', InventoryInventorySourcesUpdate.as_view(), name='inventory_inventory_sources_update'), + url(r'^(?P[0-9]+)/activity_stream/$', InventoryActivityStreamList.as_view(), name='inventory_activity_stream_list'), + url(r'^(?P[0-9]+)/job_templates/$', InventoryJobTemplateList.as_view(), name='inventory_job_template_list'), + url(r'^(?P[0-9]+)/ad_hoc_commands/$', InventoryAdHocCommandsList.as_view(), name='inventory_ad_hoc_commands_list'), + url(r'^(?P[0-9]+)/access_list/$', InventoryAccessList.as_view(), name='inventory_access_list'), + url(r'^(?P[0-9]+)/object_roles/$', InventoryObjectRolesList.as_view(), name='inventory_object_roles_list'), + url(r'^(?P[0-9]+)/instance_groups/$', InventoryInstanceGroupsList.as_view(), name='inventory_instance_groups_list'), + #url(r'^(?P[0-9]+)/single_fact/$', InventorySingleFactView.as_view(), name='inventory_single_fact_view'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/job.py b/awx/api/urls/job.py new file mode 100644 index 0000000000..6c0d045378 --- /dev/null +++ b/awx/api/urls/job.py @@ -0,0 +1,37 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + JobList, + JobDetail, + JobStart, + JobCancel, + JobRelaunch, + JobJobHostSummariesList, + JobJobEventsList, + JobActivityStreamList, + JobStdout, + JobNotificationsList, + JobLabelList, + JobHostSummaryDetail, +) + + +urls = [ + url(r'^$', JobList.as_view(), name='job_list'), + url(r'^(?P[0-9]+)/$', JobDetail.as_view(), name='job_detail'), + url(r'^(?P[0-9]+)/start/$', JobStart.as_view(), name='job_start'), # Todo: Remove In 3.3 + url(r'^(?P[0-9]+)/cancel/$', JobCancel.as_view(), name='job_cancel'), + url(r'^(?P[0-9]+)/relaunch/$', JobRelaunch.as_view(), name='job_relaunch'), + url(r'^(?P[0-9]+)/job_host_summaries/$', JobJobHostSummariesList.as_view(), name='job_job_host_summaries_list'), + url(r'^(?P[0-9]+)/job_events/$', JobJobEventsList.as_view(), name='job_job_events_list'), + url(r'^(?P[0-9]+)/activity_stream/$', JobActivityStreamList.as_view(), name='job_activity_stream_list'), + url(r'^(?P[0-9]+)/stdout/$', JobStdout.as_view(), name='job_stdout'), + url(r'^(?P[0-9]+)/notifications/$', JobNotificationsList.as_view(), name='job_notifications_list'), + url(r'^(?P[0-9]+)/labels/$', JobLabelList.as_view(), name='job_label_list'), + url(r'^(?P[0-9]+)/$', JobHostSummaryDetail.as_view(), name='job_host_summary_detail'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/job_event.py b/awx/api/urls/job_event.py new file mode 100644 index 0000000000..b91c6731a6 --- /dev/null +++ b/awx/api/urls/job_event.py @@ -0,0 +1,21 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + JobEventList, + JobEventDetail, + JobEventChildrenList, + JobEventHostsList, +) + + +urls = [ + url(r'^$', JobEventList.as_view(), name='job_event_list'), + url(r'^(?P[0-9]+)/$', JobEventDetail.as_view(), name='job_event_detail'), + url(r'^(?P[0-9]+)/children/$', JobEventChildrenList.as_view(), name='job_event_children_list'), + url(r'^(?P[0-9]+)/hosts/$', JobEventHostsList.as_view(), name='job_event_hosts_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/job_host_summary.py b/awx/api/urls/job_host_summary.py new file mode 100644 index 0000000000..808511e178 --- /dev/null +++ b/awx/api/urls/job_host_summary.py @@ -0,0 +1,15 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + JobHostSummaryDetail, +) + + +urls = [ + url(r'^(?P[0-9]+)/$', JobHostSummaryDetail.as_view(), name='job_host_summary_detail'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/job_template.py b/awx/api/urls/job_template.py new file mode 100644 index 0000000000..e27346b84e --- /dev/null +++ b/awx/api/urls/job_template.py @@ -0,0 +1,43 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + JobTemplateList, + JobTemplateDetail, + JobTemplateLaunch, + JobTemplateJobsList, + JobTemplateCallback, + JobTemplateSchedulesList, + JobTemplateSurveySpec, + JobTemplateActivityStreamList, + JobTemplateNotificationTemplatesAnyList, + JobTemplateNotificationTemplatesErrorList, + JobTemplateNotificationTemplatesSuccessList, + JobTemplateInstanceGroupsList, + JobTemplateAccessList, + JobTemplateObjectRolesList, + JobTemplateLabelList, +) + + +urls = [ + url(r'^$', JobTemplateList.as_view(), name='job_template_list'), + url(r'^(?P[0-9]+)/$', JobTemplateDetail.as_view(), name='job_template_detail'), + url(r'^(?P[0-9]+)/launch/$', JobTemplateLaunch.as_view(), name='job_template_launch'), + url(r'^(?P[0-9]+)/jobs/$', JobTemplateJobsList.as_view(), name='job_template_jobs_list'), + url(r'^(?P[0-9]+)/callback/$', JobTemplateCallback.as_view(), name='job_template_callback'), + url(r'^(?P[0-9]+)/schedules/$', JobTemplateSchedulesList.as_view(), name='job_template_schedules_list'), + url(r'^(?P[0-9]+)/survey_spec/$', JobTemplateSurveySpec.as_view(), name='job_template_survey_spec'), + url(r'^(?P[0-9]+)/activity_stream/$', JobTemplateActivityStreamList.as_view(), name='job_template_activity_stream_list'), + url(r'^(?P[0-9]+)/notification_templates_any/$', JobTemplateNotificationTemplatesAnyList.as_view(), name='job_template_notification_templates_any_list'), + url(r'^(?P[0-9]+)/notification_templates_error/$', JobTemplateNotificationTemplatesErrorList.as_view(), name='job_template_notification_templates_error_list'), + url(r'^(?P[0-9]+)/notification_templates_success/$', JobTemplateNotificationTemplatesSuccessList.as_view(), name='job_template_notification_templates_success_list'), + url(r'^(?P[0-9]+)/instance_groups/$', JobTemplateInstanceGroupsList.as_view(), name='job_template_instance_groups_list'), + url(r'^(?P[0-9]+)/access_list/$', JobTemplateAccessList.as_view(), name='job_template_access_list'), + url(r'^(?P[0-9]+)/object_roles/$', JobTemplateObjectRolesList.as_view(), name='job_template_object_roles_list'), + url(r'^(?P[0-9]+)/labels/$', JobTemplateLabelList.as_view(), name='job_template_label_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/label.py b/awx/api/urls/label.py new file mode 100644 index 0000000000..60d70a5bd1 --- /dev/null +++ b/awx/api/urls/label.py @@ -0,0 +1,17 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + LabelList, + LabelDetail, +) + + +urls = [ + url(r'^$', LabelList.as_view(), name='label_list'), + url(r'^(?P[0-9]+)/$', LabelDetail.as_view(), name='label_detail'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/notification.py b/awx/api/urls/notification.py new file mode 100644 index 0000000000..12089afdaa --- /dev/null +++ b/awx/api/urls/notification.py @@ -0,0 +1,17 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + NotificationList, + NotificationDetail, +) + + +urls = [ + url(r'^$', NotificationList.as_view(), name='notification_list'), + url(r'^(?P[0-9]+)/$', NotificationDetail.as_view(), name='notification_detail'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/notification_template.py b/awx/api/urls/notification_template.py new file mode 100644 index 0000000000..eba6be5ef3 --- /dev/null +++ b/awx/api/urls/notification_template.py @@ -0,0 +1,21 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + NotificationTemplateList, + NotificationTemplateDetail, + NotificationTemplateTest, + NotificationTemplateNotificationList, +) + + +urls = [ + url(r'^$', NotificationTemplateList.as_view(), name='notification_template_list'), + url(r'^(?P[0-9]+)/$', NotificationTemplateDetail.as_view(), name='notification_template_detail'), + url(r'^(?P[0-9]+)/test/$', NotificationTemplateTest.as_view(), name='notification_template_test'), + url(r'^(?P[0-9]+)/notifications/$', NotificationTemplateNotificationList.as_view(), name='notification_template_notification_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/organization.py b/awx/api/urls/organization.py new file mode 100644 index 0000000000..84b4c89943 --- /dev/null +++ b/awx/api/urls/organization.py @@ -0,0 +1,47 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + OrganizationList, + OrganizationDetail, + OrganizationUsersList, + OrganizationAdminsList, + OrganizationInventoriesList, + OrganizationProjectsList, + OrganizationWorkflowJobTemplatesList, + OrganizationTeamsList, + OrganizationCredentialList, + OrganizationActivityStreamList, + OrganizationNotificationTemplatesList, + OrganizationNotificationTemplatesAnyList, + OrganizationNotificationTemplatesErrorList, + OrganizationNotificationTemplatesSuccessList, + OrganizationInstanceGroupsList, + OrganizationObjectRolesList, + OrganizationAccessList, +) + + +urls = [ + url(r'^$', OrganizationList.as_view(), name='organization_list'), + url(r'^(?P[0-9]+)/$', OrganizationDetail.as_view(), name='organization_detail'), + url(r'^(?P[0-9]+)/users/$', OrganizationUsersList.as_view(), name='organization_users_list'), + url(r'^(?P[0-9]+)/admins/$', OrganizationAdminsList.as_view(), name='organization_admins_list'), + url(r'^(?P[0-9]+)/inventories/$', OrganizationInventoriesList.as_view(), name='organization_inventories_list'), + url(r'^(?P[0-9]+)/projects/$', OrganizationProjectsList.as_view(), name='organization_projects_list'), + url(r'^(?P[0-9]+)/workflow_job_templates/$', OrganizationWorkflowJobTemplatesList.as_view(), name='organization_workflow_job_templates_list'), + url(r'^(?P[0-9]+)/teams/$', OrganizationTeamsList.as_view(), name='organization_teams_list'), + url(r'^(?P[0-9]+)/credentials/$', OrganizationCredentialList.as_view(), name='organization_credential_list'), + url(r'^(?P[0-9]+)/activity_stream/$', OrganizationActivityStreamList.as_view(), name='organization_activity_stream_list'), + url(r'^(?P[0-9]+)/notification_templates/$', OrganizationNotificationTemplatesList.as_view(), name='organization_notification_templates_list'), + url(r'^(?P[0-9]+)/notification_templates_any/$', OrganizationNotificationTemplatesAnyList.as_view(), name='organization_notification_templates_any_list'), + url(r'^(?P[0-9]+)/notification_templates_error/$', OrganizationNotificationTemplatesErrorList.as_view(), name='organization_notification_templates_error_list'), + url(r'^(?P[0-9]+)/notification_templates_success/$', OrganizationNotificationTemplatesSuccessList.as_view(), name='organization_notification_templates_success_list'), + url(r'^(?P[0-9]+)/instance_groups/$', OrganizationInstanceGroupsList.as_view(), name='organization_instance_groups_list'), + url(r'^(?P[0-9]+)/object_roles/$', OrganizationObjectRolesList.as_view(), name='organization_object_roles_list'), + url(r'^(?P[0-9]+)/access_list/$', OrganizationAccessList.as_view(), name='organization_access_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/project.py b/awx/api/urls/project.py new file mode 100644 index 0000000000..d69ae886d3 --- /dev/null +++ b/awx/api/urls/project.py @@ -0,0 +1,43 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + ProjectList, + ProjectDetail, + ProjectPlaybooks, + ProjectInventories, + ProjectScmInventorySources, + ProjectTeamsList, + ProjectUpdateView, + ProjectUpdatesList, + ProjectActivityStreamList, + ProjectSchedulesList, + ProjectNotificationTemplatesAnyList, + ProjectNotificationTemplatesErrorList, + ProjectNotificationTemplatesSuccessList, + ProjectObjectRolesList, + ProjectAccessList, +) + + +urls = [ + url(r'^$', ProjectList.as_view(), name='project_list'), + url(r'^(?P[0-9]+)/$', ProjectDetail.as_view(), name='project_detail'), + url(r'^(?P[0-9]+)/playbooks/$', ProjectPlaybooks.as_view(), name='project_playbooks'), + url(r'^(?P[0-9]+)/inventories/$', ProjectInventories.as_view(), name='project_inventories'), + url(r'^(?P[0-9]+)/scm_inventory_sources/$', ProjectScmInventorySources.as_view(), name='project_scm_inventory_sources'), + url(r'^(?P[0-9]+)/teams/$', ProjectTeamsList.as_view(), name='project_teams_list'), + url(r'^(?P[0-9]+)/update/$', ProjectUpdateView.as_view(), name='project_update_view'), + url(r'^(?P[0-9]+)/project_updates/$', ProjectUpdatesList.as_view(), name='project_updates_list'), + url(r'^(?P[0-9]+)/activity_stream/$', ProjectActivityStreamList.as_view(), name='project_activity_stream_list'), + url(r'^(?P[0-9]+)/schedules/$', ProjectSchedulesList.as_view(), name='project_schedules_list'), + url(r'^(?P[0-9]+)/notification_templates_any/$', ProjectNotificationTemplatesAnyList.as_view(), name='project_notification_templates_any_list'), + url(r'^(?P[0-9]+)/notification_templates_error/$', ProjectNotificationTemplatesErrorList.as_view(), name='project_notification_templates_error_list'), + url(r'^(?P[0-9]+)/notification_templates_success/$', ProjectNotificationTemplatesSuccessList.as_view(), name='project_notification_templates_success_list'), + url(r'^(?P[0-9]+)/object_roles/$', ProjectObjectRolesList.as_view(), name='project_object_roles_list'), + url(r'^(?P[0-9]+)/access_list/$', ProjectAccessList.as_view(), name='project_access_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/project_update.py b/awx/api/urls/project_update.py new file mode 100644 index 0000000000..2f77f20718 --- /dev/null +++ b/awx/api/urls/project_update.py @@ -0,0 +1,25 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + ProjectUpdateList, + ProjectUpdateDetail, + ProjectUpdateCancel, + ProjectUpdateStdout, + ProjectUpdateScmInventoryUpdates, + ProjectUpdateNotificationsList, +) + + +urls = [ + url(r'^$', ProjectUpdateList.as_view(), name='project_update_list'), + url(r'^(?P[0-9]+)/$', ProjectUpdateDetail.as_view(), name='project_update_detail'), + url(r'^(?P[0-9]+)/cancel/$', ProjectUpdateCancel.as_view(), name='project_update_cancel'), + url(r'^(?P[0-9]+)/stdout/$', ProjectUpdateStdout.as_view(), name='project_update_stdout'), + url(r'^(?P[0-9]+)/scm_inventory_updates/$', ProjectUpdateScmInventoryUpdates.as_view(), name='project_update_scm_inventory_updates'), + url(r'^(?P[0-9]+)/notifications/$', ProjectUpdateNotificationsList.as_view(), name='project_update_notifications_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/role.py b/awx/api/urls/role.py new file mode 100644 index 0000000000..f404aa6640 --- /dev/null +++ b/awx/api/urls/role.py @@ -0,0 +1,25 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + RoleList, + RoleDetail, + RoleUsersList, + RoleTeamsList, + RoleParentsList, + RoleChildrenList, +) + + +urls = [ + url(r'^$', RoleList.as_view(), name='role_list'), + url(r'^(?P[0-9]+)/$', RoleDetail.as_view(), name='role_detail'), + url(r'^(?P[0-9]+)/users/$', RoleUsersList.as_view(), name='role_users_list'), + url(r'^(?P[0-9]+)/teams/$', RoleTeamsList.as_view(), name='role_teams_list'), + url(r'^(?P[0-9]+)/parents/$', RoleParentsList.as_view(), name='role_parents_list'), + url(r'^(?P[0-9]+)/children/$', RoleChildrenList.as_view(), name='role_children_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/schedule.py b/awx/api/urls/schedule.py new file mode 100644 index 0000000000..d02bed0b05 --- /dev/null +++ b/awx/api/urls/schedule.py @@ -0,0 +1,19 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + ScheduleList, + ScheduleDetail, + ScheduleUnifiedJobsList, +) + + +urls = [ + url(r'^$', ScheduleList.as_view(), name='schedule_list'), + url(r'^(?P[0-9]+)/$', ScheduleDetail.as_view(), name='schedule_detail'), + url(r'^(?P[0-9]+)/jobs/$', ScheduleUnifiedJobsList.as_view(), name='schedule_unified_jobs_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/system_job.py b/awx/api/urls/system_job.py new file mode 100644 index 0000000000..1d7ca6e105 --- /dev/null +++ b/awx/api/urls/system_job.py @@ -0,0 +1,21 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + SystemJobList, + SystemJobDetail, + SystemJobCancel, + SystemJobNotificationsList, +) + + +urls = [ + url(r'^$', SystemJobList.as_view(), name='system_job_list'), + url(r'^(?P[0-9]+)/$', SystemJobDetail.as_view(), name='system_job_detail'), + url(r'^(?P[0-9]+)/cancel/$', SystemJobCancel.as_view(), name='system_job_cancel'), + url(r'^(?P[0-9]+)/notifications/$', SystemJobNotificationsList.as_view(), name='system_job_notifications_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/system_job_template.py b/awx/api/urls/system_job_template.py new file mode 100644 index 0000000000..dd2ca5986e --- /dev/null +++ b/awx/api/urls/system_job_template.py @@ -0,0 +1,29 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + SystemJobTemplateList, + SystemJobTemplateDetail, + SystemJobTemplateLaunch, + SystemJobTemplateJobsList, + SystemJobTemplateSchedulesList, + SystemJobTemplateNotificationTemplatesAnyList, + SystemJobTemplateNotificationTemplatesErrorList, + SystemJobTemplateNotificationTemplatesSuccessList, +) + + +urls = [ + url(r'^$', SystemJobTemplateList.as_view(), name='system_job_template_list'), + url(r'^(?P[0-9]+)/$', SystemJobTemplateDetail.as_view(), name='system_job_template_detail'), + url(r'^(?P[0-9]+)/launch/$', SystemJobTemplateLaunch.as_view(), name='system_job_template_launch'), + url(r'^(?P[0-9]+)/jobs/$', SystemJobTemplateJobsList.as_view(), name='system_job_template_jobs_list'), + url(r'^(?P[0-9]+)/schedules/$', SystemJobTemplateSchedulesList.as_view(), name='system_job_template_schedules_list'), + url(r'^(?P[0-9]+)/notification_templates_any/$', SystemJobTemplateNotificationTemplatesAnyList.as_view(), name='system_job_template_notification_templates_any_list'), + url(r'^(?P[0-9]+)/notification_templates_error/$', SystemJobTemplateNotificationTemplatesErrorList.as_view(), name='system_job_template_notification_templates_error_list'), + url(r'^(?P[0-9]+)/notification_templates_success/$', SystemJobTemplateNotificationTemplatesSuccessList.as_view(), name='system_job_template_notification_templates_success_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/team.py b/awx/api/urls/team.py new file mode 100644 index 0000000000..185c86e42a --- /dev/null +++ b/awx/api/urls/team.py @@ -0,0 +1,31 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + TeamList, + TeamDetail, + TeamProjectsList, + TeamUsersList, + TeamCredentialsList, + TeamRolesList, + TeamObjectRolesList, + TeamActivityStreamList, + TeamAccessList, +) + + +urls = [ + url(r'^$', TeamList.as_view(), name='team_list'), + url(r'^(?P[0-9]+)/$', TeamDetail.as_view(), name='team_detail'), + url(r'^(?P[0-9]+)/projects/$', TeamProjectsList.as_view(), name='team_projects_list'), + url(r'^(?P[0-9]+)/users/$', TeamUsersList.as_view(), name='team_users_list'), + url(r'^(?P[0-9]+)/credentials/$', TeamCredentialsList.as_view(), name='team_credentials_list'), + url(r'^(?P[0-9]+)/roles/$', TeamRolesList.as_view(), name='team_roles_list'), + url(r'^(?P[0-9]+)/object_roles/$', TeamObjectRolesList.as_view(), name='team_object_roles_list'), + url(r'^(?P[0-9]+)/activity_stream/$', TeamActivityStreamList.as_view(), name='team_activity_stream_list'), + url(r'^(?P[0-9]+)/access_list/$', TeamAccessList.as_view(), name='team_access_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/url_template.py b/awx/api/urls/url_template.py new file mode 100644 index 0000000000..733c404422 --- /dev/null +++ b/awx/api/urls/url_template.py @@ -0,0 +1,13 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( +) + + +urls = [ +] + +__all__ = ['urls'] diff --git a/awx/api/urls/urls.py b/awx/api/urls/urls.py new file mode 100644 index 0000000000..5b80331927 --- /dev/null +++ b/awx/api/urls/urls.py @@ -0,0 +1,118 @@ +# Copyright (c) 2015 Ansible, Inc. +# All Rights Reserved. + +from __future__ import absolute_import, unicode_literals +from django.conf.urls import include, url + +from awx.api.views import ( + ApiRootView, + ApiV1RootView, + ApiV2RootView, + ApiV1PingView, + ApiV1ConfigView, + AuthView, + AuthTokenView, + UserMeList, + DashboardView, + DashboardJobsGraphView, + UnifiedJobTemplateList, + UnifiedJobList, + HostAnsibleFactsDetail, + JobExtraCredentialsList, + JobTemplateExtraCredentialsList, +) + +from .organization import urls as organization_urls +from .user import urls as user_urls +from .project import urls as project_urls +from .project_update import urls as project_update_urls +from .inventory import urls as inventory_urls +from .team import urls as team_urls +from .host import urls as host_urls +from .group import urls as group_urls +from .inventory_source import urls as inventory_source_urls +from .inventory_update import urls as inventory_update_urls +from .inventory_script import urls as inventory_script_urls +from .credential_type import urls as credential_type_urls +from .credential import urls as credential_urls +from .role import urls as role_urls +from .job_template import urls as job_template_urls +from .job import urls as job_urls +from .job_host_summary import urls as job_host_summary_urls +from .job_event import urls as job_event_urls +from .ad_hoc_command import urls as ad_hoc_command_urls +from .ad_hoc_command_event import urls as ad_hoc_command_event_urls +from .system_job_template import urls as system_job_template_urls +from .system_job import urls as system_job_urls +from .workflow_job_template import urls as workflow_job_template_urls +from .workflow_job import urls as workflow_job_urls +from .notification_template import urls as notification_template_urls +from .notification import urls as notification_urls +from .label import urls as label_urls +from .workflow_job_template_node import urls as workflow_job_template_node_urls +from .workflow_job_node import urls as workflow_job_node_urls +from .schedule import urls as schedule_urls +from .activity_stream import urls as activity_stream_urls +from .instance import urls as instance_urls +from .instance_group import urls as instance_group_urls + + +v1_urls = [ + url(r'^$', ApiV1RootView.as_view(), name='api_v1_root_view'), + url(r'^ping/$', ApiV1PingView.as_view(), name='api_v1_ping_view'), + url(r'^config/$', ApiV1ConfigView.as_view(), name='api_v1_config_view'), + url(r'^auth/$', AuthView.as_view()), + url(r'^authtoken/$', AuthTokenView.as_view(), name='auth_token_view'), + url(r'^me/$', UserMeList.as_view(), name='user_me_list'), + url(r'^dashboard/$', DashboardView.as_view(), name='dashboard_view'), + url(r'^dashboard/graphs/jobs/$', DashboardJobsGraphView.as_view(), name='dashboard_jobs_graph_view'), + url(r'^settings/', include('awx.conf.urls')), + url(r'^instances/', include(instance_urls)), + url(r'^instance_groups/', include(instance_group_urls)), + url(r'^schedules/', include(schedule_urls)), + url(r'^organizations/', include(organization_urls)), + url(r'^users/', include(user_urls)), + url(r'^projects/', include(project_urls)), + url(r'^project_updates/', include(project_update_urls)), + url(r'^teams/', include(team_urls)), + url(r'^inventories/', include(inventory_urls)), + url(r'^hosts/', include(host_urls)), + url(r'^groups/', include(group_urls)), + url(r'^inventory_sources/', include(inventory_source_urls)), + url(r'^inventory_updates/', include(inventory_update_urls)), + url(r'^inventory_scripts/', include(inventory_script_urls)), + url(r'^credentials/', include(credential_urls)), + url(r'^roles/', include(role_urls)), + url(r'^job_templates/', include(job_template_urls)), + url(r'^jobs/', include(job_urls)), + url(r'^job_host_summaries/', include(job_host_summary_urls)), + url(r'^job_events/', include(job_event_urls)), + url(r'^ad_hoc_commands/', include(ad_hoc_command_urls)), + url(r'^ad_hoc_command_events/', include(ad_hoc_command_event_urls)), + url(r'^system_job_templates/', include(system_job_template_urls)), + url(r'^system_jobs/', include(system_job_urls)), + url(r'^notification_templates/', include(notification_template_urls)), + url(r'^notifications/', include(notification_urls)), + url(r'^workflow_job_templates/', include(workflow_job_template_urls)), + url(r'^workflow_jobs/', include(workflow_job_urls)), + url(r'^labels/', include(label_urls)), + url(r'^workflow_job_template_nodes/', include(workflow_job_template_node_urls)), + url(r'^workflow_job_nodes/', include(workflow_job_node_urls)), + url(r'^unified_job_templates/$', UnifiedJobTemplateList.as_view(), name='unified_job_template_list'), + url(r'^unified_jobs/$', UnifiedJobList.as_view(), name='unified_job_list'), + url(r'^activity_stream/', include(activity_stream_urls)), +] + +v2_urls = [ + url(r'^$', ApiV2RootView.as_view(), name='api_v2_root_view'), + url(r'^credential_types/', include(credential_type_urls)), + url(r'^hosts/(?P[0-9]+)/ansible_facts/$', HostAnsibleFactsDetail.as_view(), name='host_ansible_facts_detail'), + url(r'^jobs/(?P[0-9]+)/extra_credentials/$', JobExtraCredentialsList.as_view(), name='job_extra_credentials_list'), + url(r'^job_templates/(?P[0-9]+)/extra_credentials/$', JobTemplateExtraCredentialsList.as_view(), name='job_template_extra_credentials_list'), +] + +urlpatterns = [ + url(r'^$', ApiRootView.as_view(), name='api_root_view'), + url(r'^(?P(v2))/', include(v2_urls)), + url(r'^(?P(v1|v2))/', include(v1_urls)) +] diff --git a/awx/api/urls/user.py b/awx/api/urls/user.py new file mode 100644 index 0000000000..c0ab4bb469 --- /dev/null +++ b/awx/api/urls/user.py @@ -0,0 +1,33 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + UserList, + UserDetail, + UserTeamsList, + UserOrganizationsList, + UserAdminOfOrganizationsList, + UserProjectsList, + UserCredentialsList, + UserRolesList, + UserActivityStreamList, + UserAccessList, +) + + +urls = [ + url(r'^$', UserList.as_view(), name='user_list'), + url(r'^(?P[0-9]+)/$', UserDetail.as_view(), name='user_detail'), + url(r'^(?P[0-9]+)/teams/$', UserTeamsList.as_view(), name='user_teams_list'), + url(r'^(?P[0-9]+)/organizations/$', UserOrganizationsList.as_view(), name='user_organizations_list'), + url(r'^(?P[0-9]+)/admin_of_organizations/$', UserAdminOfOrganizationsList.as_view(), name='user_admin_of_organizations_list'), + url(r'^(?P[0-9]+)/projects/$', UserProjectsList.as_view(), name='user_projects_list'), + url(r'^(?P[0-9]+)/credentials/$', UserCredentialsList.as_view(), name='user_credentials_list'), + url(r'^(?P[0-9]+)/roles/$', UserRolesList.as_view(), name='user_roles_list'), + url(r'^(?P[0-9]+)/activity_stream/$', UserActivityStreamList.as_view(), name='user_activity_stream_list'), + url(r'^(?P[0-9]+)/access_list/$', UserAccessList.as_view(), name='user_access_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/workflow_job.py b/awx/api/urls/workflow_job.py new file mode 100644 index 0000000000..1ecbb39373 --- /dev/null +++ b/awx/api/urls/workflow_job.py @@ -0,0 +1,29 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + WorkflowJobList, + WorkflowJobDetail, + WorkflowJobWorkflowNodesList, + WorkflowJobLabelList, + WorkflowJobCancel, + WorkflowJobRelaunch, + WorkflowJobNotificationsList, + WorkflowJobActivityStreamList, +) + + +urls = [ + url(r'^$', WorkflowJobList.as_view(), name='workflow_job_list'), + url(r'^(?P[0-9]+)/$', WorkflowJobDetail.as_view(), name='workflow_job_detail'), + url(r'^(?P[0-9]+)/workflow_nodes/$', WorkflowJobWorkflowNodesList.as_view(), name='workflow_job_workflow_nodes_list'), + url(r'^(?P[0-9]+)/labels/$', WorkflowJobLabelList.as_view(), name='workflow_job_label_list'), + url(r'^(?P[0-9]+)/cancel/$', WorkflowJobCancel.as_view(), name='workflow_job_cancel'), + url(r'^(?P[0-9]+)/relaunch/$', WorkflowJobRelaunch.as_view(), name='workflow_job_relaunch'), + url(r'^(?P[0-9]+)/notifications/$', WorkflowJobNotificationsList.as_view(), name='workflow_job_notifications_list'), + url(r'^(?P[0-9]+)/activity_stream/$', WorkflowJobActivityStreamList.as_view(), name='workflow_job_activity_stream_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/workflow_job_node.py b/awx/api/urls/workflow_job_node.py new file mode 100644 index 0000000000..d7c2acf9d6 --- /dev/null +++ b/awx/api/urls/workflow_job_node.py @@ -0,0 +1,23 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + WorkflowJobNodeList, + WorkflowJobNodeDetail, + WorkflowJobNodeSuccessNodesList, + WorkflowJobNodeFailureNodesList, + WorkflowJobNodeAlwaysNodesList, +) + + +urls = [ + url(r'^$', WorkflowJobNodeList.as_view(), name='workflow_job_node_list'), + url(r'^(?P[0-9]+)/$', WorkflowJobNodeDetail.as_view(), name='workflow_job_node_detail'), + url(r'^(?P[0-9]+)/success_nodes/$', WorkflowJobNodeSuccessNodesList.as_view(), name='workflow_job_node_success_nodes_list'), + url(r'^(?P[0-9]+)/failure_nodes/$', WorkflowJobNodeFailureNodesList.as_view(), name='workflow_job_node_failure_nodes_list'), + url(r'^(?P[0-9]+)/always_nodes/$', WorkflowJobNodeAlwaysNodesList.as_view(), name='workflow_job_node_always_nodes_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/workflow_job_template.py b/awx/api/urls/workflow_job_template.py new file mode 100644 index 0000000000..7fd8bf76e7 --- /dev/null +++ b/awx/api/urls/workflow_job_template.py @@ -0,0 +1,43 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + WorkflowJobTemplateList, + WorkflowJobTemplateDetail, + WorkflowJobTemplateJobsList, + WorkflowJobTemplateLaunch, + WorkflowJobTemplateCopy, + WorkflowJobTemplateSchedulesList, + WorkflowJobTemplateSurveySpec, + WorkflowJobTemplateWorkflowNodesList, + WorkflowJobTemplateActivityStreamList, + WorkflowJobTemplateNotificationTemplatesAnyList, + WorkflowJobTemplateNotificationTemplatesErrorList, + WorkflowJobTemplateNotificationTemplatesSuccessList, + WorkflowJobTemplateAccessList, + WorkflowJobTemplateObjectRolesList, + WorkflowJobTemplateLabelList, +) + + +urls = [ + url(r'^$', WorkflowJobTemplateList.as_view(), name='workflow_job_template_list'), + url(r'^(?P[0-9]+)/$', WorkflowJobTemplateDetail.as_view(), name='workflow_job_template_detail'), + url(r'^(?P[0-9]+)/workflow_jobs/$', WorkflowJobTemplateJobsList.as_view(), name='workflow_job_template_jobs_list'), + url(r'^(?P[0-9]+)/launch/$', WorkflowJobTemplateLaunch.as_view(), name='workflow_job_template_launch'), + url(r'^(?P[0-9]+)/copy/$', WorkflowJobTemplateCopy.as_view(), name='workflow_job_template_copy'), + url(r'^(?P[0-9]+)/schedules/$', WorkflowJobTemplateSchedulesList.as_view(), name='workflow_job_template_schedules_list'), + url(r'^(?P[0-9]+)/survey_spec/$', WorkflowJobTemplateSurveySpec.as_view(), name='workflow_job_template_survey_spec'), + url(r'^(?P[0-9]+)/workflow_nodes/$', WorkflowJobTemplateWorkflowNodesList.as_view(), name='workflow_job_template_workflow_nodes_list'), + url(r'^(?P[0-9]+)/activity_stream/$', WorkflowJobTemplateActivityStreamList.as_view(), name='workflow_job_template_activity_stream_list'), + url(r'^(?P[0-9]+)/notification_templates_any/$', WorkflowJobTemplateNotificationTemplatesAnyList.as_view(), name='workflow_job_template_notification_templates_any_list'), + url(r'^(?P[0-9]+)/notification_templates_error/$', WorkflowJobTemplateNotificationTemplatesErrorList.as_view(), name='workflow_job_template_notification_templates_error_list'), + url(r'^(?P[0-9]+)/notification_templates_success/$', WorkflowJobTemplateNotificationTemplatesSuccessList.as_view(), name='workflow_job_template_notification_templates_success_list'), + url(r'^(?P[0-9]+)/access_list/$', WorkflowJobTemplateAccessList.as_view(), name='workflow_job_template_access_list'), + url(r'^(?P[0-9]+)/object_roles/$', WorkflowJobTemplateObjectRolesList.as_view(), name='workflow_job_template_object_roles_list'), + url(r'^(?P[0-9]+)/labels/$', WorkflowJobTemplateLabelList.as_view(), name='workflow_job_template_label_list'), +] + +__all__ = ['urls'] diff --git a/awx/api/urls/workflow_job_template_node.py b/awx/api/urls/workflow_job_template_node.py new file mode 100644 index 0000000000..a1b8beb349 --- /dev/null +++ b/awx/api/urls/workflow_job_template_node.py @@ -0,0 +1,23 @@ +# Copyright (c) 2017 Ansible, Inc. +# All Rights Reserved. + +from django.conf.urls import url + +from awx.api.views import ( + WorkflowJobTemplateNodeList, + WorkflowJobTemplateNodeDetail, + WorkflowJobTemplateNodeSuccessNodesList, + WorkflowJobTemplateNodeFailureNodesList, + WorkflowJobTemplateNodeAlwaysNodesList, +) + + +urls = [ + url(r'^$', WorkflowJobTemplateNodeList.as_view(), name='workflow_job_template_node_list'), + url(r'^(?P[0-9]+)/$', WorkflowJobTemplateNodeDetail.as_view(), name='workflow_job_template_node_detail'), + url(r'^(?P[0-9]+)/success_nodes/$', WorkflowJobTemplateNodeSuccessNodesList.as_view(), name='workflow_job_template_node_success_nodes_list'), + url(r'^(?P[0-9]+)/failure_nodes/$', WorkflowJobTemplateNodeFailureNodesList.as_view(), name='workflow_job_template_node_failure_nodes_list'), + url(r'^(?P[0-9]+)/always_nodes/$', WorkflowJobTemplateNodeAlwaysNodesList.as_view(), name='workflow_job_template_node_always_nodes_list'), +] + +__all__ = ['urls'] diff --git a/awx/conf/serializers.py b/awx/conf/serializers.py index 0f588d7ee7..46f2e93467 100644 --- a/awx/conf/serializers.py +++ b/awx/conf/serializers.py @@ -16,7 +16,7 @@ class SettingSerializer(BaseSerializer): class Meta: model = Setting fields = ('id', 'key', 'value') - readonly_fields = ('id', 'key', 'value') + read_only_fields = ('id', 'key', 'value') def __init__(self, instance=None, data=serializers.empty, **kwargs): if instance is None and data is not serializers.empty and 'key' in data: diff --git a/awx/conf/urls.py b/awx/conf/urls.py index 2c4f3ec91d..fab56784b3 100644 --- a/awx/conf/urls.py +++ b/awx/conf/urls.py @@ -1,16 +1,16 @@ # Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. -# Django -from django.conf.urls import patterns -# Tower -from awx.api.urls import url - - -urlpatterns = patterns( - 'awx.conf.views', - url(r'^$', 'setting_category_list'), - url(r'^(?P[a-z0-9-]+)/$', 'setting_singleton_detail'), - url(r'^logging/test/$', 'setting_logging_test'), +from django.conf.urls import url +from awx.conf.views import ( + SettingCategoryList, + SettingSingletonDetail, + SettingLoggingTest, ) + +urlpatterns = [ + url(r'^$', SettingCategoryList.as_view(), name='setting_category_list'), + url(r'^(?P[a-z0-9-]+)/$', SettingSingletonDetail.as_view()), + url(r'^logging/test/$', SettingLoggingTest.as_view()), +] diff --git a/awx/sso/backends.py b/awx/sso/backends.py index 2f95b1d462..b11844abd1 100644 --- a/awx/sso/backends.py +++ b/awx/sso/backends.py @@ -25,9 +25,9 @@ from radiusauth.backends import RADIUSBackend as BaseRADIUSBackend import tacacs_plus # social -from social.backends.saml import OID_USERID -from social.backends.saml import SAMLAuth as BaseSAMLAuth -from social.backends.saml import SAMLIdentityProvider as BaseSAMLIdentityProvider +from social_core.backends.saml import OID_USERID +from social_core.backends.saml import SAMLAuth as BaseSAMLAuth +from social_core.backends.saml import SAMLIdentityProvider as BaseSAMLIdentityProvider # Ansible Tower from awx.conf.license import feature_enabled diff --git a/awx/sso/middleware.py b/awx/sso/middleware.py index 7690dbd0ce..7b414b9715 100644 --- a/awx/sso/middleware.py +++ b/awx/sso/middleware.py @@ -13,9 +13,9 @@ from django.shortcuts import redirect from django.utils.timezone import now # Python Social Auth -from social.exceptions import SocialAuthBaseException -from social.utils import social_logger -from social.apps.django_app.middleware import SocialAuthExceptionMiddleware +from social_core.exceptions import SocialAuthBaseException +from social_core.utils import social_logger +from social_django.middleware import SocialAuthExceptionMiddleware # Ansible Tower from awx.main.models import AuthToken diff --git a/awx/sso/strategies/__init__.py b/awx/sso/strategies/__init__.py deleted file mode 100644 index 46176c348f..0000000000 --- a/awx/sso/strategies/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (c) 2017 Ansible, Inc. -# All Rights Reserved. diff --git a/awx/sso/strategies/django_strategy.py b/awx/sso/strategies/django_strategy.py deleted file mode 100644 index 74fcb94117..0000000000 --- a/awx/sso/strategies/django_strategy.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2017 Ansible, Inc. -# All Rights Reserved. - -from social.strategies.django_strategy import DjangoStrategy - - -class AWXDjangoStrategy(DjangoStrategy): - """A DjangoStrategy for python-social-auth containing - fixes and updates from social-app-django - - TODO: Revert back to using the default DjangoStrategy after - we upgrade to social-core / social-app-django. We will also - want to ensure we update the SOCIAL_AUTH_STRATEGY setting. - """ - - def request_port(self): - """Port in use for this request - https://github.com/python-social-auth/social-app-django/blob/master/social_django/strategy.py#L76 - """ - try: # django >= 1.9 - return self.request.get_port() - except AttributeError: # django < 1.9 - host_parts = self.request.get_host().split(':') - try: - return host_parts[1] - except IndexError: - return self.request.META['SERVER_PORT'] diff --git a/awx/sso/urls.py b/awx/sso/urls.py index 876b697146..7fce884b33 100644 --- a/awx/sso/urls.py +++ b/awx/sso/urls.py @@ -1,13 +1,18 @@ # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. -# Django -from django.conf.urls import patterns, url - -urlpatterns = patterns( - 'awx.sso.views', - url(r'^complete/$', 'sso_complete', name='sso_complete'), - url(r'^error/$', 'sso_error', name='sso_error'), - url(r'^inactive/$', 'sso_inactive', name='sso_inactive'), - url(r'^metadata/saml/$', 'saml_metadata', name='saml_metadata'), +from django.conf.urls import url +from awx.sso.views import ( + sso_complete, + sso_error, + sso_inactive, + saml_metadata, ) + + +urlpatterns = [ + url(r'^complete/$', sso_complete, name='sso_complete'), + url(r'^error/$', sso_error, name='sso_error'), + url(r'^inactive/$', sso_inactive, name='sso_inactive'), + url(r'^metadata/saml/$', saml_metadata, name='saml_metadata'), +] diff --git a/awx/sso/views.py b/awx/sso/views.py index 9e680186a9..bce30302c9 100644 --- a/awx/sso/views.py +++ b/awx/sso/views.py @@ -79,7 +79,7 @@ sso_complete = CompleteView.as_view() class MetadataView(View): def get(self, request, *args, **kwargs): - from social.apps.django_app.utils import load_backend, load_strategy + from social_django.utils import load_backend, load_strategy complete_url = reverse('social:complete', args=('saml', )) saml_backend = load_backend( load_strategy(request), diff --git a/awx/ui/urls.py b/awx/ui/urls.py index f92787d28d..0ec33dc040 100644 --- a/awx/ui/urls.py +++ b/awx/ui/urls.py @@ -1,11 +1,16 @@ # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. -from django.conf import settings -from django.conf.urls import * - -urlpatterns = patterns('awx.ui.views', - url(r'^$', 'index', name='index'), - url(r'^migrations_notran/$', 'migrations_notran', name='migrations_notran'), - url(r'^portal/$', 'portal_redirect', name='portal_redirect'), +from django.conf.urls import url, include +from awx.ui.views import ( + index, + portal_redirect, + migrations_notran, ) + + +urlpatterns = [ + url(r'^$', index, name='index'), + url(r'^migrations_notran/$', migrations_notran, name='migrations_notran'), + url(r'^portal/$', portal_redirect, name='portal_redirect'), +] diff --git a/awx/urls.py b/awx/urls.py index 27d81416dd..9e1937b201 100644 --- a/awx/urls.py +++ b/awx/urls.py @@ -1,25 +1,27 @@ # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. -from django.conf.urls import url, patterns, include +from django.conf.urls import url, include +from awx.main.views import ( + handle_400, + handle_403, + handle_404, + handle_500, +) + + +urlpatterns = [ + url(r'', include('awx.ui.urls', namespace='ui', app_name='ui')), + url(r'^api/', include('awx.api.urls', namespace='api', app_name='api')), + url(r'^sso/', include('awx.sso.urls', namespace='sso', app_name='sso')), + url(r'^sso/', include('social_django.urls', namespace='social')), + url(r'^(?:api/)?400.html$', handle_400), + url(r'^(?:api/)?403.html$', handle_403), + url(r'^(?:api/)?404.html$', handle_404), + url(r'^(?:api/)?500.html$', handle_500), +] handler400 = 'awx.main.views.handle_400' handler403 = 'awx.main.views.handle_403' handler404 = 'awx.main.views.handle_404' handler500 = 'awx.main.views.handle_500' - -urlpatterns = patterns( - '', - url(r'', include('awx.ui.urls', namespace='ui', app_name='ui')), - url(r'^api/', include('awx.api.urls', namespace='api', app_name='api')), - url(r'^sso/', include('awx.sso.urls', namespace='sso', app_name='sso')), - url(r'^sso/', include('social.apps.django_app.urls', namespace='social')), -) - -urlpatterns += patterns( - 'awx.main.views', - url(r'^(?:api/)?400.html$', 'handle_400'), - url(r'^(?:api/)?403.html$', 'handle_403'), - url(r'^(?:api/)?404.html$', 'handle_404'), - url(r'^(?:api/)?500.html$', 'handle_500'), -)