ADD VOLUME_MOUNT

master
Sebastian Serfling 2023-08-21 10:44:09 +02:00
parent bb882b49bf
commit aa52e0f873
1 changed files with 8 additions and 3 deletions

11
main.py
View File

@ -6,6 +6,7 @@ import uvicorn
import logging
import auth
from fastapi.security.api_key import APIKey
import datetime
logging.basicConfig(level=logging.DEBUG) # add this line
logger = logging.getLogger("foo")
@ -54,6 +55,10 @@ app = FastAPI()
async def notify():
return database(f"SELECT * FROM Notifications", "Stines-GmbH","")
@app.get("gettime")
async def gettime(api_key: APIKey = Depends(auth.get_api_key)):
return f"Current Time is {datetime.now()}"
@app.post("/ping")
async def ping(ping: CL.CL_Ping_Set,api_key: APIKey = Depends(auth.get_api_key)):
database(f"INSERT INTO `Ping-Server` VALUES ('{datetime.now()}','{ping.name}','{ping.ipaddress}')","Stines-GmbH","")
@ -69,13 +74,13 @@ async def database_get(get: CL.CL_Database_get,api_key: APIKey = Depends(auth.ge
return False
@app.post("/info/getdatabase")
async def getdatabase(get: CL.CL_GET_DATABASE):
async def getdatabase(get: CL.CL_GET_DATABASE,api_key: APIKey = Depends(auth.get_api_key)):
return database(f"SELECT name FROM `Kunden-Server` where `IP-Adresse` = '{get.ip}'","Stines-GmbH","")[0][0]
@app.post("/dbset")
async def dbset(get: CL.CL_Database_set):
async def dbset(get: CL.CL_Database_set,api_key: APIKey = Depends(auth.get_api_key)):
database(get.query,get.dbname,"")
return f"Creatd {get.dbname}"
return f"Created {get.dbname}"
@app.post("/cpu_info")
async def cpu_info(get: CL.CL_CPUinfo,api_key: APIKey = Depends(auth.get_api_key)):