Giter VIP home page Giter VIP logo

aravind-psiog / monitor_api Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.72 MB

Pure API based app for monitoring local/cloud servers. Users can create a group, add members to the group, Members can add servers to the corresponding groups. A cron job monitors those servers and intimate the members when status of the server changes(online/offline)

Home Page: https://z3reusmmg9.execute-api.us-east-1.amazonaws.com/dev/docs

Python 100.00%
python fastapi cronjob bot

monitor_api's Introduction

AWS lambda

Build Status

The purpose of this project is to build an API with a reallife usecase and a boilerplate with

  • FastAPI and PostgreSQL
  • Auto pep8
  • CI/CD pipeline
  • documenting

Installation

clone the repo and install requirements by

pip install -r requirements.txt

FastAPI

To run the FastAPI

cd app
uvicorn main:app --reload

Default hostname is http://localhost:8000 and as it has inbuild documentation, http://localhost:8000/docs can be used to view/test the API's. main.py is the main app which has API functionalities.

AWS deployment

For deploying it on AWS lambda, create a repo in Github and add the aws secret,access and region in the secrets environment. Create S3 bucket and lambda function and API endpoint and configure the endpoint to created lambda function. edit the main.yml file and input it with your bucket name. This is a one time setup.

After completing the setup. Deploy it to the git repo. It creates a action pipeline which does the rest of the work.

This app is live on https://z3reusmmg9.execute-api.us-east-1.amazonaws.com/dev/docs

Error codes

Error Code Description
200 OK
409 Conflict
401 Un Authorized
404 Not Found
405 Method Not Allowed
400 Bad Request

Troubleshooting

The psycopg2 library which was installed doesnot work on aws lambda engine. reference >> jkehler/awslambda-psycopg2#47

I have downloaded the custom build and placed it in psycop2-fix folder. The pipeline automatically adds this build to the S3 bucket.

monitor_api's People

Contributors

aravind-psiog avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.