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 servicesservice start <name>- Start a specific serviceservice stop <name>- Stop a specific serviceservice restart <name>- Restart a specific service
Group Management
group list- List all groupsgroup create <name>- Create a new groupgroup delete <name>- Delete a group
Player Management
player list- List all playersplayer count- Get total player count
System Commands
help- Show available commandsstatus- Show system statusversion- 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.commandpermission is required - Command Validation - Commands are validated before execution
- Runtime Access - Commands are executed directly on the PoloCloud runtime