• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1from django.conf.urls import defaults
2from autotest_lib.frontend import settings, urls_common
3from autotest_lib.frontend.afe.feeds import feed
4from autotest_lib.frontend.afe import resources
5
6feeds = {
7    'jobs' : feed.JobFeed
8}
9
10urlpatterns, debug_patterns = (
11        urls_common.generate_patterns('frontend.afe', 'AfeClient'))
12
13resource_patterns = defaults.patterns(
14        '',
15        (r'^/?$', resources.ResourceDirectory.dispatch_request),
16        (r'^atomic_group_classes/?$',
17         resources.AtomicGroupClassCollection.dispatch_request),
18        (r'^atomic_group_classes/(?P<ag_name>.+?)/?$',
19         resources.AtomicGroupClass.dispatch_request),
20        (r'^atomic_taggings/?$',
21         resources.AtomicLabelTaggingCollection.dispatch_request),
22        (r'^atomic_taggings/(?P<ag_name>.+?),(?P<label_name>.+?)/?$',
23         resources.AtomicLabelTagging.dispatch_request),
24        (r'^labels/?$', resources.LabelCollection.dispatch_request),
25        (r'^labels/(?P<label_name>.+?)/?$', resources.Label.dispatch_request),
26        (r'^users/?$', resources.UserCollection.dispatch_request),
27        (r'^users/(?P<username>[@\w]+)/?$', resources.User.dispatch_request),
28        (r'^user_acls/?$',
29         resources.UserAclMembershipCollection.dispatch_request),
30        (r'^user_acls/(?P<username>.+?),(?P<acl_name>.+?)/?$',
31         resources.UserAclMembership.dispatch_request),
32        (r'^acls/?$', resources.AclCollection.dispatch_request),
33        (r'^acls/(?P<acl_name>.+?)/?$', resources.Acl.dispatch_request),
34        (r'^hosts/?$', resources.HostCollection.dispatch_request),
35        (r'^hosts/(?P<hostname>.+?)/?$', resources.Host.dispatch_request),
36        (r'^labelings/?$', resources.HostLabelingCollection.dispatch_request),
37        (r'^labelings/(?P<hostname>.+?),(?P<label_name>.+?)/?$',
38         resources.HostLabeling.dispatch_request),
39        (r'^host_acls/?$',
40         resources.HostAclMembershipCollection.dispatch_request),
41        (r'^host_acls/(?P<hostname>.+?),(?P<acl_name>.+?)/?$',
42         resources.HostAclMembership.dispatch_request),
43        (r'^tests/?$', resources.TestCollection.dispatch_request),
44        (r'^tests/(?P<test_name>.+?)/?$', resources.Test.dispatch_request),
45        (r'^test_dependencies/?$',
46         resources.TestDependencyCollection.dispatch_request),
47        (r'^test_dependencies/(?P<test_name>.+?),(?P<label_name>.+?)/?$',
48         resources.TestDependency.dispatch_request),
49        (r'^execution_info/?$', resources.ExecutionInfo.dispatch_request),
50        (r'^queue_entries_request/?$',
51         resources.QueueEntriesRequest.dispatch_request),
52        (r'^jobs/?$', resources.JobCollection.dispatch_request),
53        (r'^jobs/(?P<job_id>\d+)/?$', resources.Job.dispatch_request),
54        (r'^queue_entries/?$', resources.QueueEntryCollection.dispatch_request),
55        (r'^queue_entries/(?P<queue_entry_id>\d+?)/?$',
56         resources.QueueEntry.dispatch_request),
57        (r'^health_tasks/?$', resources.HealthTaskCollection.dispatch_request),
58        (r'^health_tasks/(?P<task_id>\d+)/?$',
59         resources.HealthTask.dispatch_request),
60    )
61
62urlpatterns += defaults.patterns(
63        '', (r'^resources/', defaults.include(resource_patterns)))
64
65# File upload
66urlpatterns += defaults.patterns(
67        '', (r'^upload/', 'frontend.afe.views.handle_file_upload'))
68
69# Job feeds
70debug_patterns += defaults.patterns(
71        '',
72        (r'^model_doc/', 'frontend.afe.views.model_documentation'),
73        (r'^feeds/(?P<url>.*)/$', 'frontend.afe.feeds.feed.feed_view',
74         {'feed_dict': feeds})
75    )
76
77if settings.DEBUG:
78    urlpatterns += debug_patterns
79