https://github.com/aravind-psiog/monitor_api
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)
https://github.com/aravind-psiog/monitor_api
bot cronjob fastapi python
Last synced: about 2 months ago
JSON representation
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)
- Host: GitHub
- URL: https://github.com/aravind-psiog/monitor_api
- Owner: Aravind-psiog
- Created: 2022-03-13T15:23:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T11:22:13.000Z (over 2 years ago)
- Last Synced: 2025-03-11T14:49:43.268Z (over 1 year ago)
- Topics: bot, cronjob, fastapi, python
- Language: Python
- Homepage: https://z3reusmmg9.execute-api.us-east-1.amazonaws.com/dev/docs
- Size: 1.68 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS lambda

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
### 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 >>
I have downloaded the custom build and placed it in `psycop2-fix` folder. The pipeline automatically adds this build to the S3 bucket.