Remove API key From Console
parent
00e79cbee5
commit
307b06d59a
|
|
@ -101,6 +101,16 @@ class CL_GET_HOSTNAME(BaseModel):
|
|||
hostname: str
|
||||
dbname: str
|
||||
|
||||
class CL_SET_HOSTNAME(BaseModel):
|
||||
hostname: str
|
||||
dbname: str
|
||||
ram: int
|
||||
user: str
|
||||
hddfree: int
|
||||
hddused: int
|
||||
hddtotal: int
|
||||
ipadresse: str
|
||||
|
||||
class CL_ADD_CLIENT(BaseModel):
|
||||
query: str
|
||||
database: str
|
||||
|
|
|
|||
8
main.py
8
main.py
|
|
@ -94,6 +94,14 @@ async def gethostname(get: CL.CL_GET_HOSTNAME,api_key: APIKey = Depends(auth.get
|
|||
else:
|
||||
return result[0][0]
|
||||
|
||||
@app.post("/info/sethostname")
|
||||
async def sethostname(get: CL.CL_SET_HOSTNAME,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
result = database(f"INSERT INTO `{get.dbname}`.hardware (hostname,ipadresse,user,ram,hddused,hddfree,hddtotal) VALUES ({get.hostname},{get.ipadresse},{get.user},{get.ram}),{get.hddused},{get.hddfree},{get.hddtotal})","","")
|
||||
if not result:
|
||||
return False
|
||||
else:
|
||||
return result[0][0]
|
||||
|
||||
@app.post("/info/getclient")
|
||||
async def getclient(get: CL.CL_GET_CLIENT,api_key: APIKey = Depends(auth.get_api_key)):
|
||||
result = database(f"SELECT Firma FROM `Kunden-Clients` where `Client-Name` = '{get.name}'","Stines-GmbH","")
|
||||
|
|
|
|||
Loading…
Reference in New Issue