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

@@ -15,9 +15,10 @@ import (
)
// VmImport ingests a bulk VM import payload.
// @Summary Import VMs
// @Description Imports existing VM inventory data in bulk.
// @Summary Import VMs (deprecated)
// @Description Deprecated: Imports existing VM inventory data in bulk.
// @Tags inventory
// @Deprecated
// @Accept json
// @Produce json
// @Param import body models.ImportReceived true "Bulk import payload"
@@ -25,6 +26,10 @@ import (
// @Failure 500 {object} models.ErrorResponse "Server error"
// @Router /api/import/vm [post]
func (h *Handler) VmImport(w http.ResponseWriter, r *http.Request) {
if h.denyLegacyAPI(w, "/api/import/vm") {
return
}
// Read request body
reqBody, err := io.ReadAll(r.Body)
if err != nil {