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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user