Documentação Pixel Host
Servidores e energia
Consulte status e controle o ciclo de energia de uma instância.Exemplo
curl -sS -X POST \
-H "Authorization: Bearer $PIXEL_HOST_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"restart"}' \
https://pixel-host.com.br/api/v1/servers/SEU_SERVER_ID/powerEndpoints
/servers/{serverId}Retorna identificação, software, versão e estado.
- Permissão
server.read
Como enviar
curl -sS -X GET \
-H "Authorization: Bearer $PIXEL_HOST_TOKEN" \
"https://pixel-host.com.br/api/v1/servers/SEU_SERVER_ID"Resposta HTTP 200
{
"server": {
"id": "SERVER_ID",
"name": "Servidor Pixel",
"runtime": "paper",
"status": "running",
"minecraftVersion": "1.21.11",
"address": "servidor-pixel.pixel-host.com.br"
}
}/servers/{serverId}/statusRetorna ping, jogadores e métricas de execução.
- Permissão
server.read
Como enviar
curl -sS -X GET \
-H "Authorization: Bearer $PIXEL_HOST_TOKEN" \
"https://pixel-host.com.br/api/v1/servers/SEU_SERVER_ID/status"Resposta HTTP 200
{
"online": true,
"ping": 18,
"players": { "online": 3, "max": 20 },
"runtime": {
"cpuCurrentPercent": 14.2,
"memoryBytes": 1073741824,
"uptimeSeconds": 8640
}
}/servers/{serverId}/powerLiga, para ou reinicia o servidor. Escopos individuais também são aceitos.
- Permissão
server.power.*
Como enviar
curl -sS -X POST \
-H "Authorization: Bearer $PIXEL_HOST_TOKEN" \
-H "Content-Type: application/json" \
--data '{ "action": "start" }' \
"https://pixel-host.com.br/api/v1/servers/SEU_SERVER_ID/power"Corpo JSON formatado
{ "action": "start" }Resposta HTTP 200
{ "status": "running" }