46 lines
994 B
Markdown
46 lines
994 B
Markdown
# install packages
|
|
pip install Flask
|
|
pip install flask_jwt_extended
|
|
|
|
# run application
|
|
python app.py
|
|
|
|
# call api
|
|
http://127.0.0.1:5000/get_logs?issue_type=database_issue
|
|
|
|
# sample response
|
|
{
|
|
"/var/log/db.log": "Last 50 lines of db.log...",
|
|
"/var/log/db_error.log": "Last 30 lines of db_error.log...",
|
|
"top": "Output of the top command..."
|
|
}
|
|
|
|
# run installation script
|
|
chmod +x install_flask_app.sh
|
|
./install_flask_app.sh
|
|
cd ~/flask_app
|
|
python3 app.py
|
|
|
|
# install on centos
|
|
yum install python36-devel
|
|
yum install python36-setuptools
|
|
yum install python36-virtualenv
|
|
|
|
python3 -m pip install --upgrade pip
|
|
|
|
python3 -m virtualenv env
|
|
|
|
pip install Flask
|
|
pip install flask_jwt_extended
|
|
|
|
# usage
|
|
curl http://127.0.0.1:5000/get_logs?issue_type=Demo
|
|
|
|
# run docker image
|
|
docker run -d \
|
|
-p 5000:5000 \
|
|
-v $(pwd)/src/config.json:/app/config.json \
|
|
-v $(pwd)/logs:/app/logs \
|
|
--name ticket_ai \
|
|
docker.io/mavenarh/ticket_ai:latest
|