fix minor

main
Cizz22 7 months ago
parent a391ed4de0
commit 87daf1527c

@ -21,6 +21,7 @@ async def get_all_simulation(db_session: DbSession, common: CommonParameters):
results = await get_all(common = common) results = await get_all(common = common)
return {"data": results, "status": "success", "message": "Success"} return {"data": results, "status": "success", "message": "Success"}

@ -23,27 +23,26 @@ async def get_all(*, common):
selectinload(AerosEquipment.aeros_equipment_details) selectinload(AerosEquipment.aeros_equipment_details)
) )
results = await search_filter_sort_paginate(model=query, **common) results = await search_filter_sort_paginate(model=query, **common)
reg_nodes = [node.node_name for node in results["items"]]
requestedNode = { updateNodeReq = {"projectName": "trialapi", "equipmentNames": reg_nodes}
"projectName": "ParallelNode",
"equipmentName": [node.node_name for node in results["items"]],
}
try: try:
response = await client.post( response = await client.post(
f"{AEROS_BASE_URL}/api/UpdateDisParams/GetUpdatedNodeDistributions", f"{AEROS_BASE_URL}/api/UpdateDisParams/GetUpdatedNodeDistributions",
json=requestedNode, json=updateNodeReq,
headers={"Content-Type": "application/json"}, headers={"Content-Type": "application/json"},
) )
response.raise_for_status() response.raise_for_status()
aerosEquipmentResult = response.json()
res = response.json()
except Exception as e: except Exception as e:
raise HTTPException( raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e) status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e)
) )
results["items"] = aerosEquipmentResult results["items"] = res
return results return results
@ -131,6 +130,8 @@ async def save_default_equipment(*, db_session: DbSession, project_name: str):
results = response.json() results = response.json()
raise Exception(updateNodeReq)
nodes = [] nodes = []
# save to db # save to db

@ -53,17 +53,17 @@ async def import_aro_project(*, db_session: DbSession):
# Update path to AEROS APP # Update path to AEROS APP
# Example BODy "C/dsad/dsad.aro" # Example BODy "C/dsad/dsad.aro"
try: # try:
response = await client.post( # response = await client.post(
f"{AEROS_BASE_URL}/api/Project/ImportAROFile", # f"{AEROS_BASE_URL}/api/Project/ImportAROFile",
json=f"/", # json=f"/",
headers={"Content-Type": "application/json"}, # headers={"Content-Type": "application/json"},
) # )
response.raise_for_status() # response.raise_for_status()
except Exception as e: # except Exception as e:
raise HTTPException( # raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e) # status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e)
) # )
await _initialize_default_project_data( await _initialize_default_project_data(
db_session=db_session, db_session=db_session,

Loading…
Cancel
Save