feat: add REST API for task creation & status retrieve#32
Merged
kdmccormick merged 1 commit intokdmccormick:kdmccormick/import-from-modulestorefrom Jun 24, 2025
Conversation
kdmccormick
approved these changes
Jun 24, 2025
d78da49
into
kdmccormick:kdmccormick/import-from-modulestore
24 of 25 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements a REST API for creating and tracking modulestore migration tasks.
POST
/api/modulestore_migrator/v0/imports/Creates a new import task.
Request and response include source, target, composition level, and replace options.
Request Example:
{ "source": "course-v1:edX+DemoX+2024_T1", "target": "library-v1:org1+lib_1", "composition_level": "unit", "replace_existing": true, "target_collection_slug": "algebra" }Response Example:
{ "name": "migrate_from_modulestore", "state": "Validating migration parameters", "state_text": "Cancelling any redundant migration tasks", "completed_steps": 0, "total_steps": 11, "attempts": 1, "created": "2025-06-01T10:00:00Z", "modified": "2025-06-01T10:00:00Z", "artifacts": [], "modulestoremigration": { "source": "course-v1:edX+DemoX+2024_T1", "target": "library-v1:org1+lib_1", "composition_level": "unit", "replace_existing": true, "target_collection_slug": "videos" } }GET
/api/modulestore_migrator/v0/imports/<uuid>/Retrieves the status and details of an import task by UUID.
Response Example:
{ "name": "migrate_from_modulestore", "state": "Running", "state_text": "Importing course structure", "completed_steps": 5, "total_steps": 11, "attempts": 1, "created": "2025-06-01T10:00:00Z", "modified": "2025-06-01T10:02:00Z", "artifacts": [], "modulestoremigration": { "source": "course-v1:edX+DemoX+2024_T1", "target": "library-v1:org1+lib_1", "composition_level": "unit", "replace_existing": true, "target_collection_slug": "videos" } }This enables asynchronous content migration with real-time status tracking via the API, improving automation and observability for admin-driven content workflows.