ADD VOLUME_MOUNT
parent
bb882b49bf
commit
aa52e0f873
11
main.py
11
main.py
|
|
@ -6,6 +6,7 @@ import uvicorn
|
||||||
import logging
|
import logging
|
||||||
import auth
|
import auth
|
||||||
from fastapi.security.api_key import APIKey
|
from fastapi.security.api_key import APIKey
|
||||||
|
import datetime
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG) # add this line
|
logging.basicConfig(level=logging.DEBUG) # add this line
|
||||||
logger = logging.getLogger("foo")
|
logger = logging.getLogger("foo")
|
||||||
|
|
@ -54,6 +55,10 @@ app = FastAPI()
|
||||||
async def notify():
|
async def notify():
|
||||||
return database(f"SELECT * FROM Notifications", "Stines-GmbH","")
|
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")
|
@app.post("/ping")
|
||||||
async def ping(ping: CL.CL_Ping_Set,api_key: APIKey = Depends(auth.get_api_key)):
|
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","")
|
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
|
return False
|
||||||
|
|
||||||
@app.post("/info/getdatabase")
|
@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]
|
return database(f"SELECT name FROM `Kunden-Server` where `IP-Adresse` = '{get.ip}'","Stines-GmbH","")[0][0]
|
||||||
|
|
||||||
@app.post("/dbset")
|
@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,"")
|
database(get.query,get.dbname,"")
|
||||||
return f"Creatd {get.dbname}"
|
return f"Created {get.dbname}"
|
||||||
|
|
||||||
@app.post("/cpu_info")
|
@app.post("/cpu_info")
|
||||||
async def cpu_info(get: CL.CL_CPUinfo,api_key: APIKey = Depends(auth.get_api_key)):
|
async def cpu_info(get: CL.CL_CPUinfo,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue