Deprecate legacy VM inventory endpoints and add gating logic
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user