Remove API key From Console
parent
9389fff386
commit
d32cafbb90
4
main.py
4
main.py
|
|
@ -94,6 +94,10 @@ async def gethost(get: CL.CL_GET_HOST,api_key: APIKey = Depends(auth.get_api_key
|
||||||
else:
|
else:
|
||||||
return result[0][0]
|
return result[0][0]
|
||||||
|
|
||||||
|
@app.post("/host/get/database")
|
||||||
|
async def getdatabase(get: CL.CL_GET_DATABASE,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
|
return database(f"SELECT Datenbank FROM `Kunden` where `IP-Adresse` = '{get.ip}'","Stines-GmbH","")[0][0]
|
||||||
|
|
||||||
@app.post("/host/set")
|
@app.post("/host/set")
|
||||||
async def sethost(get: CL.CL_SET_HOST,api_key: APIKey = Depends(auth.get_api_key)):
|
async def sethost(get: CL.CL_SET_HOST,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
database(f"INSERT INTO `{get.dbname}`.hardware (hostname,ipadresse,ram,hddused,hddfree,hddtotal) VALUES ('{get.hostname}','{get.ipadresse}','{get.ram}','{get.hddused}','{get.hddfree}','{get.hddtotal}')","","")
|
database(f"INSERT INTO `{get.dbname}`.hardware (hostname,ipadresse,ram,hddused,hddfree,hddtotal) VALUES ('{get.hostname}','{get.ipadresse}','{get.ram}','{get.hddused}','{get.hddfree}','{get.hddtotal}')","","")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue