Go to file
2025-02-12 16:49:46 +01:00
.gitignore Initial commit 2025-02-11 10:56:25 +01:00
api.yaml Initial version 2025-02-11 11:20:52 +01:00
compose.yaml Changed notworking to make wol work 2025-02-11 15:12:56 +01:00
Dockerfile Added delete to servers and clusters 2025-02-11 14:27:28 +01:00
LICENSE Initial commit 2025-02-11 10:56:25 +01:00
main.py Improved error handling 2025-02-12 16:49:46 +01:00
README.md Added information to readme 2025-02-11 11:33:21 +01:00
requirements.txt Replaced OS ping with python ping3 2025-02-11 14:53:50 +01:00
servers.db Added suport for API keys on cluster level 2025-02-11 14:07:24 +01:00

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 servers
  • POST /servers - Add or update a server

Server Statuses

  • GET /statuses - List all server statuses
  • GET /statuses/{server_name} - Get a specific server's status

Server Power States

  • GET /states - List all server power states
  • GET /states/{server_name} - Get a specific server's power state
  • PUT /states/{server_name} - Control the power state of a server

API Documentation

  • GET /apidoc - View API documentation in RapiDoc
  • GET /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