Remove API key From Console
parent
696461b545
commit
1d10510bf7
14
main.py
14
main.py
|
|
@ -69,7 +69,7 @@ async def database_get(get: CL.CL_Database_get,api_key: APIKey = Depends(auth.ge
|
||||||
@app.post("/host/get/netvolume")
|
@app.post("/host/get/netvolume")
|
||||||
async def getvolume(get: CL.CL_GET_VOLUMES,api_key: APIKey = Depends(auth.get_api_key)):
|
async def getvolume(get: CL.CL_GET_VOLUMES,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
## Anpassung zum neune Schema erstellen
|
## Anpassung zum neune Schema erstellen
|
||||||
result = database(f"SELECT `Netzlaufwerk_1`,`Netzlaufwerk_2`,`Netzlaufwerk_3`,`Netzlaufwerk_4`,`Netzlaufwerk_5`,`Netzlaufwerk_6`,`Netzlaufwerk_7`,`Netzlaufwerk_8`,`Netzlaufwerk_9`,`Netzlaufwerk_10` FROM `Clients` where `Name` = '{get.name}'",f"{get.database}","")
|
result = database(f"SELECT * FROM `NetVolumeToClients` where `Name` = '{get.user}'",f"{get.database}","")
|
||||||
volume = []
|
volume = []
|
||||||
if not result:
|
if not result:
|
||||||
return False
|
return False
|
||||||
|
|
@ -123,8 +123,9 @@ async def sethost(get: CL.CL_SET_HOST,api_key: APIKey = Depends(auth.get_api_key
|
||||||
else:
|
else:
|
||||||
return result[0][0]
|
return result[0][0]
|
||||||
|
|
||||||
@app.post("/host/set/cpu")
|
@app.post("/host/cpu")
|
||||||
async def setcpu(get: CL.CL_SET_CPU,api_key: APIKey = Depends(auth.get_api_key)):
|
async def setcpu(get: CL.CL_SET_CPU,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
|
check = database(f"SELECT id FROM `{get.dbname}`.cpulist WHERE cpuname = '{get.cpuname}' AND ghz")
|
||||||
database(f"INSERT INTO `{get.dbname}`.cpulist (cpuname,ghz,cputyp) VALUES ('{get.cpuname}','{get.ghz}','{get.cputyp}')","","")
|
database(f"INSERT INTO `{get.dbname}`.cpulist (cpuname,ghz,cputyp) VALUES ('{get.cpuname}','{get.ghz}','{get.cputyp}')","","")
|
||||||
result = database(
|
result = database(
|
||||||
f"SELECT id FROM `{get.dbname}`.cpulist WHERE cpuname = '{get.cpuname} AND cputyp = {get.cputyp}')",
|
f"SELECT id FROM `{get.dbname}`.cpulist WHERE cpuname = '{get.cpuname} AND cputyp = {get.cputyp}')",
|
||||||
|
|
@ -291,7 +292,14 @@ async def add_ad_user(get: CL.CL_ADD_EX_USER,api_key: APIKey = Depends(auth.get_
|
||||||
print(database(get.query,get.dbname,get.entry))
|
print(database(get.query,get.dbname,get.entry))
|
||||||
return f"Create {get.query} - {get.dbname}"
|
return f"Create {get.query} - {get.dbname}"
|
||||||
|
|
||||||
|
@app.post("/add/group/volume")
|
||||||
|
async def send_group_volume(get: CL.CL_ADD_EX_USER,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
|
volume_name = database(f"SELECT ID FROM `{get.dbname}`.Netvolume WHERE Volume_Name = '{get.Label}'", "", "")
|
||||||
|
if not volume_name:
|
||||||
|
database(f"INSERT INTO `{get.dbname}`.Netvolume (Volume_Key,Volume_Path,Volume_Name) VALUES ({get.Letter},{get.Path},{get.Label})", "",
|
||||||
|
"")
|
||||||
|
# database(get.query,get.dbname,get.entry)
|
||||||
|
return f"Create {get.Label} - {get.Path}"
|
||||||
|
|
||||||
|
|
||||||
@app.post("/volume_mount")
|
@app.post("/volume_mount")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue