From dcfd772d066d0063bf8d849ac83eb347816d170d Mon Sep 17 00:00:00 2001 From: Stefan Nilsson Date: Tue, 11 Feb 2025 11:33:21 +0100 Subject: [PATCH] Added information to readme --- README.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc3c476..ac3e870 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,77 @@ -# pve-state +# 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 + +```sh +git clone https://github.com/your-repo/proxmox-api.git +cd proxmox-api +``` + +### Build and Run the API + +Using Docker Compose: + +```sh +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: + +```sh +docker-compose down +``` + +## License + +MIT License