78 lines
1.4 KiB
Markdown
78 lines
1.4 KiB
Markdown
# 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
|