Skip to content

Commit

Permalink
Added delete_asic() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Konstantinov committed Dec 30, 2022
1 parent 501cafa commit c803d42
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ async def update_asic(request: Request):
return {'success': 'true', 'status': 'updated'}


@app.post("/delete_asic/{asic_id}")
async def delete_asic(asic_id: int):
with orm.db_session:
host = Hosts.get(id=asic_id)

if not host:
return {'detail': 'Not Found'}
else:
host.delete()

return {'success': 'true', 'status': 'updated'}


@app.get("/asic_status")
async def asic_status():
with orm.db_session:
Expand Down

0 comments on commit c803d42

Please sign in to comment.