From 79b77acaeff3d243338541f207b1bdb816405e15 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 7 Aug 2020 03:10:37 +0200 Subject: [PATCH] chore: document briefly --- app/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/main.py b/app/main.py index d8acaa3..8049f8d 100644 --- a/app/main.py +++ b/app/main.py @@ -41,14 +41,17 @@ def get_srv(service_id: int, db: Session): @app.get("/api/v1/ping") async def pong(): + """Basic sanity check""" return {"ping": "pong!"} @app.get("/api/v1/service") async def read_services(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)): + """List all services""" return crud.get_services(db, skip=skip, limit=limit) @app.post("/api/v1/service", response_model=schemas.Service) async def create_service(service: schemas.ServiceCreate, db: Session = Depends(get_db)): + """Service types: icmp = 0, http = 1, ssh=2""" return crud.create_service(db=db, service=service) @app.get("/api/v1/service/{service_id}", response_model=schemas.Service) @@ -87,6 +90,7 @@ async def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)): @app.get("/api/v1/users", response_model=List[schemas.User]) async def read_users(skip: int = 0, limit: int = 100, db: Session = Depends(get_db)): + """List all users""" return crud.get_users(db=db, skip=skip, limit=limit) @app.get("/api/v1/users/{user_id}", response_model=schemas.User)