Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem Statement

...

approachesĀ proscons

1.without content service

loosely coupled
2.with content serviceĀ 

dependent on content service,

Contents Service has to maintain duplicate storage of statuses and processes

by Content Service and Sunbird platform

Problem Statement

What is the API for update content?

Solution approach

URL:

POST /v1/job/start

Headers:

Authorization

X-authenticated-user-token

...

status codeerror codeerror message
400MANDATORY_PARAMETER_MISSINGMandatory parameter {script,version} is missing.400UPDATE_FAILEDData updation failed due to invalid Request

Sample Request and Response:


No Format
nopaneltrue
Request

{
	request : {
		"scriptName" : "course_rename",
		"version" : "1.2",
		"attributes" : [{
			"field" : "name"
			"oldValue" : "AB",
			"newValue" : "ab"
		},{
			"field" : "orgDetails"
			"oldValue" : {
				"courseName" : "AB"
			},
			"newValue" : {
				"courseName" : "ab"
			}
		}]	
	}
}

Response

{
  "id": "api.job",
  "result": {
		"processId" : "01262366359399628812"
	}
}

...

status codeerror codeerror message
400INVALID_PROCESS_IDInvalid Process Id

Sample Request and Response:

No Format
nopaneltrue
Request

GET /v1/job/status/01262366359399628812

Response

{
  "id": "api.job.status",
  "result": {
		"status" : "FAILURE",
		"message" : "Operation to update failed"
	}
}

...

Solution approach

URL:

GET /v1/job/processeslist

Headers:

Authorization

X-authenticated-user-token

...

nametypedescription
processIdtextthe process id
scripttextthe script for which process exists
versiontextversion of the script

Errors:

None

Sample Request and Response:


No Format
nopaneltrue
Request

GET /v1/job/processes

Response

{
  "id": "api.job.processes",
  "result": {
		processes : [{
			"processId" : "01262366359399628812",
			"script" : "course_rename",
			"version" : "1.2"
		}]
	}
}

...