The Command Service is responsible for receiving Python code submissions from the frontend, storing job information, and enqueuing job IDs for processing by the Worker Service. This service provides RESTful APIs for code submission and result retrieval.
- Accepts Python code submissions via a RESTful API.
- Stores submitted code and job metadata.
- Enqueues job IDs for asynchronous processing.
- Provides API to check the execution status and results.
-
Submit Code
- Endpoint:
POST /submit-code
- Description: Accepts Python code and returns a job ID.
- Request Body:
{ "code": "print('Hello, World!')" }
- Response:
{ "jobId": "1234567890abcdef" }
- Endpoint:
-
Get Execution Result
- Endpoint:
GET /exec-result?jobId={jobId}
- Description: Retrieves the execution status and result of the submitted job.
- Response:
{ "status": "completed", "result": "Hello, World!" }
- Endpoint: