Code Execution
For code exectuion, Python Execution Service has the following endpoint:
/executeSourceCode/:sourceCodeId (POST)
sourceCodeIdis the id obtained when registering a source code- body needs to contain the following:
Example body of the executeSourceCode request
{
"parametersForMainEntry": {"marek": "hey"}
}
parametersForMainEntry must be object and this requirement is being proactively checked. parametersForMainEntry is the only object which will be passed to the entry function of the source code.
info
To read more about which entry function it is and how the source code needs to look, head over here.
There are multiple kinds of responses:
- source code successfully executed
200 OK Response
{
"message": 'Code execution result',
"result": // anything your entry function returns
}
- syntax error in the source code
400 Bad Request
{
"message": 'There is a syntax error. Code could not be loaded'
}
- source code does not exist
400 Bad Request
{
message: 'Given source code does not exist'
}