Terminal

Terminal API

The Terminal API provides endpoints to execute commands directly on the PoloCloud runtime.

Execute terminal commands on the PoloCloud runtime via REST API

Execute Command

Execute a command directly on the PoloCloud runtime terminal.

Endpoint: POST /polocloud/api/v3/terminal/command

Request Body:

{
  "command": "help"
}

Response:

{
  "status": 201,
  "message": "Trying to execute command"
}

Error Responses:

  • 400 - Command is required

Available Commands

The terminal supports various PoloCloud management commands:

Service Management

  • service list - List all services
  • service start <name> - Start a specific service
  • service stop <name> - Stop a specific service
  • service restart <name> - Restart a specific service

Group Management

  • group list - List all groups
  • group create <name> - Create a new group
  • group delete <name> - Delete a group

Player Management

  • player list - List all players
  • player count - Get total player count

System Commands

  • help - Show available commands
  • status - Show system status
  • version - Show PoloCloud version

Usage Examples

Execute Help Command

curl -X POST "http://localhost:8080/polocloud/api/v3/terminal/command" \
  -H "Content-Type: application/json" \
  -H "Cookie: token=YOUR_TOKEN_HERE" \
  -d '{
    "command": "help"
  }'

List All Services

curl -X POST "http://localhost:8080/polocloud/api/v3/terminal/command" \
  -H "Content-Type: application/json" \
  -H "Cookie: token=YOUR_TOKEN_HERE" \
  -d '{
    "command": "service list"
  }'

Start a Service

curl -X POST "http://localhost:8080/polocloud/api/v3/terminal/command" \
  -H "Content-Type: application/json" \
  -H "Cookie: token=YOUR_TOKEN_HERE" \
  -d '{
    "command": "service start lobby-1"
  }'

Check System Status

curl -X POST "http://localhost:8080/polocloud/api/v3/terminal/command" \
  -H "Content-Type: application/json" \
  -H "Cookie: token=YOUR_TOKEN_HERE" \
  -d '{
    "command": "status"
  }'

Security Notes

Terminal Access
Terminal commands have full access to the PoloCloud runtime. Use with caution and ensure proper authentication and authorization are in place.

  • Authentication Required - All terminal commands require valid authentication
  • Permission Required - polocloud.terminal.command permission is required
  • Command Validation - Commands are validated before execution
  • Runtime Access - Commands are executed directly on the PoloCloud runtime