.gitignore | ||
api.yaml | ||
compose.yaml | ||
Dockerfile | ||
LICENSE | ||
main.py | ||
README.md | ||
requirements.txt | ||
servers.db |
Proxmox Server Management API
Overview
This project provides a FastAPI-based REST API to manage Proxmox servers' statuses and power states. It includes features such as:
- Retrieving server statuses and power states
- Controlling server power states (Wake-on-LAN, shutdown)
- Managing registered servers
- OpenAPI documentation via RapiDoc
Requirements
- Docker
- Docker Compose
Installation
Clone the Repository
git clone https://github.com/your-repo/proxmox-api.git
cd proxmox-api
Build and Run the API
Using Docker Compose:
docker-compose up -d --build
This will build and run the API service, exposing it on port 8000
.
API Endpoints
Servers Management
GET /servers
- List all registered serversPOST /servers
- Add or update a server
Server Statuses
GET /statuses
- List all server statusesGET /statuses/{server_name}
- Get a specific server's status
Server Power States
GET /states
- List all server power statesGET /states/{server_name}
- Get a specific server's power statePUT /states/{server_name}
- Control the power state of a server
API Documentation
GET /apidoc
- View API documentation in RapiDocGET /openapi.json
- Get OpenAPI specification
Usage
After starting the API, access the documentation at:
http://localhost:8000/apidoc
Stopping the API
To stop the service:
docker-compose down
License
MIT License