Skip to content

About

DevOps Utility API built with Python & FastAPI | Automating DevOps tasks with RESTful endpoints

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevOps Utility Python FastAPI App

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

🚀 Features

  • ⚡ 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

🏗️ Project Structure

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.


🛠️ Tech Stack

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

📋 Prerequisites

Make sure you have the following installed:

  • Python 3.x
  • pip
  • Docker (optional, for containerized deployment)
  • AWS credentials (if using AWS-related functionality)

⚙️ Installation

1. Clone the Repository

git clone https://github.com/amarprakash1234/devops_utility_python_fastapi_app.git

2. Navigate to the Project Directory

cd devops_utility_python_fastapi_app

3. Create a Virtual Environment

python3 -m venv venv

Activate the virtual environment.

macOS/Linux

source venv/bin/activate

Windows

venv\Scripts\activate

4. Install Dependencies

pip install -r requirements.txt

▶️ Running the Application

Run the application using:

python main.py

The FastAPI application will start on:

http://0.0.0.0:8000

For local development, open:

http://localhost:8000

📚 API Documentation

FastAPI automatically generates interactive API documentation.

Swagger UI

http://localhost:8000/docs

ReDoc

http://localhost:8000/redoc

🐳 Running with Docker

Build the Docker Image

docker build -t devops-utility-api .

Run the Container

docker run -d \
  -p 8000:8000 \
  --name devops-utility-api \
  devops-utility-api

The application will then be available at:

http://localhost:8000

☁️ AWS Configuration

The project uses boto3 for AWS integration.

Configure your AWS credentials using the AWS CLI:

aws configure

You 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.


📦 Dependencies

The project currently uses the following Python packages:

fastapi
uvicorn
psutil
boto3

Install them with:

pip install -r requirements.txt

🔄 Development Mode

The 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 --reload

🎯 Use Cases

This 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

👨‍💻 Author

Amar Prakash

GitHub: amarprakash1234

Project Repository: devops_utility_python_fastapi_app

About

DevOps Utility API built with Python & FastAPI | Automating DevOps tasks with RESTful endpoints

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages