AppMage

Process Execution

This endpoint group provides methods for interacting with and managing the execution of long-running processes, including stopping, checking status, retrieving logs, and sending input.

Endpoints

POST /api/rpc (Method: ProcessExecutorRpc.stopProcess)

  • Description: Stops a running process

  • Request Body:

    {
      "method": "ProcessExecutorRpc.stopProcess",
      "params": {
        "instanceId": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    instanceId String Yes The unique identifier of the process instance to stop.
  • Response:

    {
      "success": true,
      "data": {
        "message": "Process stopped successfully"
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "ProcessExecutorRpc.stopProcess",
        "params": {
          "instanceId": "proc-12345"
        }
      }'

POST /api/rpc (Method: ProcessExecutorRpc.getProcessStatus)

  • Description: Gets the status of a running process

  • Request Body:

    {
      "method": "ProcessExecutorRpc.getProcessStatus",
      "params": {
        "instanceId": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    instanceId String Yes The unique identifier of the process instance.
  • Response:

    {
      "success": true,
      "data": {
        "status": "running"
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "ProcessExecutorRpc.getProcessStatus",
        "params": {
          "instanceId": "proc-12345"
        }
      }'

POST /api/rpc (Method: ProcessExecutorRpc.getProcessLogs)

  • Description: Gets the logs of a running process

  • Request Body:

    {
      "method": "ProcessExecutorRpc.getProcessLogs",
      "params": {
        "instanceId": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    instanceId String Yes The unique identifier of the process instance.
  • Response:

    {
      "success": true,
      "data": {
        "logs": [
          "Log entry 1...",
          "Log entry 2..."
        ]
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "ProcessExecutorRpc.getProcessLogs",
        "params": {
          "instanceId": "proc-12345"
        }
      }'

POST /api/rpc (Method: ProcessExecutorRpc.sendProcessInput)

  • Description: Sends input to a running process

  • Request Body:

    {
      "method": "ProcessExecutorRpc.sendProcessInput",
      "params": {
        "instanceId": "string",
        "input": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    instanceId String Yes The unique identifier of the process instance.
    input String Yes The input string to send to the process.
  • Response:

    {
      "success": true,
      "data": {
        "message": "Input sent successfully"
      }
    }
  • Example (cURL):

    curl -X POST https://api.example.com/api/rpc \
      -H "Content-Type: application/json" \
      -H "X-API-Key: YOUR_API_KEY" \
      -d '{
        "method": "ProcessExecutorRpc.sendProcessInput",
        "params": {
          "instanceId": "proc-12345",
          "input": "User command"
        }
      }'