Deprecate legacy VM inventory endpoints and add gating logic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-13 14:59:19 +11:00
parent 18be1fbe06
commit 1f39b46613
5 changed files with 68 additions and 7 deletions

View File

@@ -10,9 +10,10 @@ import (
)
// VmCleanup removes a VM from inventory by ID and datacenter.
// @Summary Cleanup VM inventory entry
// @Description Removes a VM inventory entry by VM ID and datacenter name.
// @Summary Cleanup VM inventory entry (deprecated)
// @Description Deprecated: Removes a VM inventory entry by VM ID and datacenter name.
// @Tags inventory
// @Deprecated
// @Produce json
// @Param vm_id query string true "VM ID"
// @Param datacenter_name query string true "Datacenter name"
@@ -20,6 +21,10 @@ import (
// @Failure 400 {object} models.ErrorResponse "Invalid request"
// @Router /api/inventory/vm/delete [delete]
func (h *Handler) VmCleanup(w http.ResponseWriter, r *http.Request) {
if h.denyLegacyAPI(w, "/api/inventory/vm/delete") {
return
}
ctx := context.Background()
// Get the parameters