-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.sh
More file actions
48 lines (48 loc) · 1.43 KB
/
commands.sh
File metadata and controls
48 lines (48 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
sudo apt update
sudo apt install -y python3 python3-pip python3-venv
mkdir -p ~/cli-api-lab
cd ~/cli-api-lab
python3 -m venv venv
source venv/bin/activate
pip install requests click tabulate
pip install flask flask-httpauth
touch api_server.py
nano api_server.py
cd ~/cli-api-lab
source venv/bin/activate
python3 api_server.py
cd ~/cli-api-lab
source venv/bin/activate
touch user_cli.py
chmod +x user_cli.py
nano user_cli.py
python3 user_cli.py health
python3 user_cli.py list-users --token dev-token-12345
python3 user_cli.py get-user 1 --token dev-token-12345
python3 user_cli.py list-users --token invalid-token
python3 user_cli.py get-user 999 --token dev-token-12345
python3 user_cli.py login dev-token-12345
python3 user_cli.py whoami
python3 user_cli.py list-users
python3 user_cli.py logout
python3 user_cli.py whoami
python3 user_cli.py health
python3 user_cli.py login dev-token-12345
python3 user_cli.py list-users
python3 user_cli.py login invalid-token
python3 user_cli.py login dev-token-12345
python3 user_cli.py get-user 999
python3 user_cli.py health
python3 user_cli.py login dev-token-12345
python3 user_cli.py list-users
python3 user_cli.py get-user 2
python3 user_cli.py whoami
python3 user_cli.py logout
ps aux | grep api_server.py
ss -tuln | grep 5000
pkill -f api_server.py
python3 api_server.py
source venv/bin/activate
pip install requests click tabulate flask flask-httpauth
curl http://127.0.0.1:5000/api/health
ls -l ~/.user_cli_token