diff --git a/cms/djangoapps/contentstore/rest_api/v0/urls.py b/cms/djangoapps/contentstore/rest_api/v0/urls.py index eb435ef338d8..590186d92d14 100644 --- a/cms/djangoapps/contentstore/rest_api/v0/urls.py +++ b/cms/djangoapps/contentstore/rest_api/v0/urls.py @@ -5,8 +5,26 @@ from openedx.core.constants import COURSE_ID_PATTERN from .views import AdvancedCourseSettingsView, CourseTabSettingsView, CourseTabListView, CourseTabReorderView +# The Authoring API is being offered on a short time basis as a v0 version, but this will soon be deprecated and +# only a v1 version will be offered. The views were developed under v1, under a belief this is how we'd be +# introducing the API. For now, just keep them there +from .. import ( + AssetsCreateRetrieveView, + AssetsUpdateDestroyView, + VideoEncodingsDownloadView, + VideoFeaturesView, + VideoImagesView, + VideosCreateUploadView, + VideosUploadsView, + TranscriptView, + XblockCreateView, + XblockView +) + app_name = "v0" +VIDEO_ID_PATTERN = r'(?P[-\w]+)' + urlpatterns = [ re_path( fr"^advanced_settings/{COURSE_ID_PATTERN}$", @@ -28,4 +46,46 @@ CourseTabReorderView.as_view(), name="course_tab_reorder", ), + + # Authoring API + re_path( + fr'^file_assets/{settings.COURSE_ID_PATTERN}/$', + assets.AssetsCreateRetrieveView.as_view(), name='cms_api_create_retrieve_assets' + ), + re_path( + fr'^file_assets/{settings.COURSE_ID_PATTERN}/{settings.ASSET_KEY_PATTERN}$', + assets.AssetsUpdateDestroyView.as_view(), name='cms_api_update_destroy_assets' + ), + re_path( + fr'^videos/encodings/{settings.COURSE_ID_PATTERN}$', + videos.VideoEncodingsDownloadView.as_view(), name='cms_api_videos_encodings' + ), + path( + 'videos/features/', + videos.VideoFeaturesView.as_view(), name='cms_api_videos_features' + ), + re_path( + fr'^videos/images/{settings.COURSE_ID_PATTERN}/{VIDEO_ID_PATTERN}$', + videos.VideoImagesView.as_view(), name='cms_api_videos_images' + ), + re_path( + fr'^videos/uploads/{settings.COURSE_ID_PATTERN}/$', + videos.VideosCreateUploadView.as_view(), name='cms_api_create_videos_upload' + ), + re_path( + fr'^videos/uploads/{settings.COURSE_ID_PATTERN}/{VIDEO_ID_PATTERN}$', + videos.VideosUploadsView.as_view(), name='cms_api_videos_uploads' + ), + re_path( + fr'^video_transcripts/{settings.COURSE_ID_PATTERN}$', + transcripts.TranscriptView.as_view(), name='cms_api_video_transcripts' + ), + re_path( + fr'^xblock/{settings.COURSE_ID_PATTERN}/$', + xblock.XblockCreateView.as_view(), name='cms_api_create_xblock' + ), + re_path( + fr'^xblock/{settings.COURSE_ID_PATTERN}/{settings.USAGE_KEY_PATTERN}$', + xblock.XblockView.as_view(), name='cms_api_xblock' + ), ] diff --git a/cms/djangoapps/contentstore/rest_api/v1/urls.py b/cms/djangoapps/contentstore/rest_api/v1/urls.py index b9f68aa3e982..718f8e874670 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/urls.py +++ b/cms/djangoapps/contentstore/rest_api/v1/urls.py @@ -84,45 +84,6 @@ name="course_rerun" ), - # CMS API - re_path( - fr'^file_assets/{settings.COURSE_ID_PATTERN}/$', - assets.AssetsCreateRetrieveView.as_view(), name='cms_api_create_retrieve_assets' - ), - re_path( - fr'^file_assets/{settings.COURSE_ID_PATTERN}/{settings.ASSET_KEY_PATTERN}$', - assets.AssetsUpdateDestroyView.as_view(), name='cms_api_update_destroy_assets' - ), - re_path( - fr'^videos/encodings/{settings.COURSE_ID_PATTERN}$', - videos.VideoEncodingsDownloadView.as_view(), name='cms_api_videos_encodings' - ), - path( - 'videos/features/', - videos.VideoFeaturesView.as_view(), name='cms_api_videos_features' - ), - re_path( - fr'^videos/images/{settings.COURSE_ID_PATTERN}/{VIDEO_ID_PATTERN}$', - videos.VideoImagesView.as_view(), name='cms_api_videos_images' - ), - re_path( - fr'^videos/uploads/{settings.COURSE_ID_PATTERN}/$', - videos.VideosCreateUploadView.as_view(), name='cms_api_create_videos_upload' - ), - re_path( - fr'^videos/uploads/{settings.COURSE_ID_PATTERN}/{VIDEO_ID_PATTERN}$', - videos.VideosUploadsView.as_view(), name='cms_api_videos_uploads' - ), - re_path( - fr'^video_transcripts/{settings.COURSE_ID_PATTERN}$', - transcripts.TranscriptView.as_view(), name='cms_api_video_transcripts' - ), - re_path( - fr'^xblock/{settings.COURSE_ID_PATTERN}/$', - xblock.XblockCreateView.as_view(), name='cms_api_create_xblock' - ), - re_path( - fr'^xblock/{settings.COURSE_ID_PATTERN}/{settings.USAGE_KEY_PATTERN}$', - xblock.XblockView.as_view(), name='cms_api_xblock' - ), + # Authoring API + # Do not use under v1 yet (Nov. 23). The Authoring API is still experimental and the v0 versions should be used ]