Home - 4poc/rccvm GitHub Wiki

POST /task

Adds a execution task to the queue, it returns immediatly with a task ID that then can be polled to receive the result. Alternativly POST /execute (config option bypass_task_queue must be set true) accepts the same request data but executes and returns the result directly.

JSON Request Fields

Name Type Description
backend string The backend to execute this with.
options hash Backend-specific options.
files hash Input files are created in a temporary location.
compile hash Settings for the compilation stage.
run hash Settings for the execution stage.

files

Name Type Description
<filename> string Filename (including directories) this is referring to.
         | `data`  | string | Contents in plaintext.

compile

Name Type Description
env hash Environment variables to set.
argv array Command and arguments.

run

Name Type Description
env hash Environment variables to set.
argv array Command and arguments.

Example Request

{
  "backend": "gcc",
  "options": {},
  "files": {
    "main.c": {
      "data": "#include<stdio.h>\nint main() {\n  printf("test\\n");\n  return 0;\n}\n"
    }
  },
  "compile": {
    "argv": ["gcc", "-O3", "main.c"]
  },
  "run": {
    "argv": ["./a.out"]
  }
}

Response

For the response object see GET /task/{Id}

GET /task/{Id}

Queries task information should be polled to receive the execution response.

JSON Response Fields

Name Type Description
id string Identifies this task.
createdAt date When the task was created.
startedAt date When the task started executing.
finishedAt date When the task finished.
terminated bool If the task is terminated.
response object Execution result object.

Response Object

Name Type Description
compile code int Return code.
      | `stderr` | string | STDERR pipe output.
      | `stdout` | string | STDOUT pipe output.

run | code | int | Return code. | stderr | string | STDERR pipe output. | stdout | string | STDOUT pipe output.

GET /backends

Returns a list of all available backends with name and description.

JSON Response Fields

Name Type Description
backends name string
       | `description` | string |
⚠️ **GitHub.com Fallback** ⚠️