You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.6 KiB

  1. from django.urls import path
  2. from rest_framework.authtoken.views import obtain_auth_token
  3. from rest_framework.urlpatterns import format_suffix_patterns
  4. from .views import Me, Features, Users, Health
  5. from .views import ProjectList, ProjectDetail
  6. from .views import LabelList, LabelDetail, ApproveLabelsAPI, LabelUploadAPI
  7. from .views import DocumentList, DocumentDetail
  8. from .views import AnnotationList, AnnotationDetail
  9. from .views import TextUploadAPI, TextDownloadAPI, CloudUploadAPI
  10. from .views import StatisticsAPI
  11. from .views import RoleMappingList, RoleMappingDetail, Roles
  12. urlpatterns = [
  13. path('health', Health.as_view(), name='health'),
  14. path('auth-token', obtain_auth_token),
  15. path('me', Me.as_view(), name='me'),
  16. path('features', Features.as_view(), name='features'),
  17. path('cloud-upload', CloudUploadAPI.as_view(), name='cloud_uploader'),
  18. path('projects', ProjectList.as_view(), name='project_list'),
  19. path('users', Users.as_view(), name='user_list'),
  20. path('roles', Roles.as_view(), name='roles'),
  21. path('projects/<int:project_id>', ProjectDetail.as_view(), name='project_detail'),
  22. path('projects/<int:project_id>/statistics',
  23. StatisticsAPI.as_view(), name='statistics'),
  24. path('projects/<int:project_id>/labels',
  25. LabelList.as_view(), name='label_list'),
  26. path('projects/<int:project_id>/label-upload',
  27. LabelUploadAPI.as_view(), name='label_upload'),
  28. path('projects/<int:project_id>/labels/<int:label_id>',
  29. LabelDetail.as_view(), name='label_detail'),
  30. path('projects/<int:project_id>/docs',
  31. DocumentList.as_view(), name='doc_list'),
  32. path('projects/<int:project_id>/docs/<int:doc_id>',
  33. DocumentDetail.as_view(), name='doc_detail'),
  34. path('projects/<int:project_id>/docs/<int:doc_id>/approve-labels',
  35. ApproveLabelsAPI.as_view(), name='approve_labels'),
  36. path('projects/<int:project_id>/docs/<int:doc_id>/annotations',
  37. AnnotationList.as_view(), name='annotation_list'),
  38. path('projects/<int:project_id>/docs/<int:doc_id>/annotations/<int:annotation_id>',
  39. AnnotationDetail.as_view(), name='annotation_detail'),
  40. path('projects/<int:project_id>/docs/upload',
  41. TextUploadAPI.as_view(), name='doc_uploader'),
  42. path('projects/<int:project_id>/docs/download',
  43. TextDownloadAPI.as_view(), name='doc_downloader'),
  44. path('projects/<int:project_id>/roles',
  45. RoleMappingList.as_view(), name='rolemapping_list'),
  46. path('projects/<int:project_id>/roles/<int:rolemapping_id>',
  47. RoleMappingDetail.as_view(), name='rolemapping_detail'),
  48. ]
  49. # urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'xml'])