Feat: add VPS export functionality and import JSON feature in UI
All checks were successful
Build and Push Docker Images / docker (push) Successful in 28s
All checks were successful
Build and Push Docker Images / docker (push) Successful in 28s
This commit is contained in:
@@ -727,6 +727,23 @@ def edit_vps(vps_id: str, body: VpsUpdateRequest, _: Annotated[dict, Depends(get
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@app.get("/api/vps/{vps_id}/export")
|
||||
def export_vps(vps_id: str, _: Annotated[dict, Depends(get_current_user)]):
|
||||
"""Exporte la configuration complète d'un VPS (y compris la clé API) pour import ailleurs."""
|
||||
vps = next((v for v in load_vps() if v["id"] == vps_id), None)
|
||||
if not vps:
|
||||
raise HTTPException(status_code=404, detail="VPS introuvable")
|
||||
return {
|
||||
"id": vps["id"],
|
||||
"name": vps["name"],
|
||||
"host": vps["host"],
|
||||
"port": vps["port"],
|
||||
"api_key": vps["api_key"],
|
||||
"description": vps.get("description", ""),
|
||||
"tags": vps.get("tags", []),
|
||||
}
|
||||
|
||||
|
||||
@app.get("/api/vps/{vps_id}/stats")
|
||||
def get_vps_stats(
|
||||
vps_id: str,
|
||||
|
||||
Reference in New Issue
Block a user