A lightweight DevOps Utility API built with Python and FastAPI. The project is designed to expose useful system and cloud-related utilities through REST APIs.
It uses:
- FastAPI for building high-performance APIs
- Uvicorn as the ASGI server
- psutil for system and process monitoring
- boto3 for interacting with AWS services
- Docker for containerization
- ⚡ FastAPI-based REST API
- 🖥️ System monitoring utilities
- 📊 Access to system and process information using
psutil - ☁️ AWS integration using
boto3 - 🐳 Docker support for containerized deployment
- 📁 Clean project structure with separate API, router, and service layers
devops_utility_python_fastapi_app/
│
├── app/
│ └── ...
│
├── routers/
│ └── ...
│
├── services/
│ └── ...
│
├── Dockerfile
├── main.py
├── requirements.txt
└── README.md
The project follows a modular structure to keep API logic, routing, and service functionality organized.
| Technology | Purpose |
|---|---|
| Python | Core programming language |
| FastAPI | REST API framework |
| Uvicorn | ASGI server |
| psutil | System and process monitoring |
| boto3 | AWS SDK for Python |
| Docker | Containerization |
Make sure you have the following installed:
- Python 3.x
- pip
- Docker (optional, for containerized deployment)
- AWS credentials (if using AWS-related functionality)
git clone https://github.com/amarprakash1234/devops_utility_python_fastapi_app.gitcd devops_utility_python_fastapi_apppython3 -m venv venvActivate the virtual environment.
source venv/bin/activatevenv\Scripts\activatepip install -r requirements.txtRun the application using:
python main.pyThe FastAPI application will start on:
http://0.0.0.0:8000
For local development, open:
http://localhost:8000
FastAPI automatically generates interactive API documentation.
http://localhost:8000/docs
http://localhost:8000/redoc
docker build -t devops-utility-api .docker run -d \
-p 8000:8000 \
--name devops-utility-api \
devops-utility-apiThe application will then be available at:
http://localhost:8000
The project uses boto3 for AWS integration.
Configure your AWS credentials using the AWS CLI:
aws configureYou will be asked for:
AWS Access Key ID
AWS Secret Access Key
Default region
Output format
Alternatively, when deploying on an AWS EC2 instance, it is recommended to use an IAM Role instead of storing AWS credentials directly in the application.
The project currently uses the following Python packages:
fastapi
uvicorn
psutil
boto3
Install them with:
pip install -r requirements.txtThe application is configured to run with auto-reload enabled.
Any changes to the source code will automatically restart the development server.
You can also run the application directly with Uvicorn:
uvicorn app.api:app --host 0.0.0.0 --port 8000 --reloadThis project can be extended to build useful DevOps utilities such as:
- System resource monitoring
- CPU and memory usage monitoring
- Disk usage information
- Running process information
- AWS EC2 instance management
- AWS S3 operations
- Cloud infrastructure monitoring
- Server health checks
- DevOps automation APIs
Amar Prakash
GitHub: amarprakash1234
Project Repository: devops_utility_python_fastapi_app