Problem Statement
...
- Sunbird Platform will expose an API for end user to initiate update content
- Sunbird Platform will log the request in DB and pass the user a generated process Id
- Sunbird Platform will send the request with processId to kafka message queue
- Request will be picked up by Learning platform and would start the processing of update content based on the request
- Sunbird Platform will use a listener to get the status update and store in DB from the kafka based on processId
...
pros and cons of both approaches
approachesĀ | pros | cons |
---|---|---|
1.without content service | loosely coupled | |
2.with content serviceĀ | reply on content service |
Problem Statement
What is the API for update content?
...
status code | error code | error message |
---|---|---|
400 | MANDATORY_PARAMETER_MISSING | Mandatory parameter {script,version} is missing. |
400 | UPDATE_FAILED | Data updation failed due to invalid Request |
Sample Request and Response:
No Format | ||
---|---|---|
| ||
Request { request : { "script" : "course_rename", "version" : "1.2", "content" : { "oldName" : "AB", "newName" : "ab" } } } Response { "id": "api.content.update", "result": { "processId" : "01262366359399628812" } } |
...
status code | error code | error message |
---|---|---|
400 | INVALID_PROCESS_ID | Invalid Process Id |
Sample Request and Response:
No Format | ||
---|---|---|
| ||
Request GET /v1/content/update/status/01262366359399628812 Response { "id": "api.content.update.status", "result": { "status" : "FAILURE", "message" : "Operation to update failed" } } |
...
returns an array of processes related to user
name | type | description |
---|---|---|
processId | text | the process id |
script | text | the script for which process exists |
version | text | version of the script |
Errors:
None
Sample Request and Response:
No Format | ||
---|---|---|
| ||
Request GET /v1/content/update/processes Response { "id": "api.content.update.processes", "result": { processes : [{ "processId" : "01262366359399628812", "script" : "course_rename", "version" : "1.2" }] } } |
...