add more srm checks
This commit is contained in:
@@ -25,7 +25,7 @@ func (h *Handler) VmDeleteEvent(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
h.Logger.Debug("received input data", "length", len(reqBody))
|
//h.Logger.Debug("received input data", "length", len(reqBody))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode the JSON body into CloudEventReceived struct
|
// Decode the JSON body into CloudEventReceived struct
|
||||||
@@ -36,7 +36,7 @@ func (h *Handler) VmDeleteEvent(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, "Invalid JSON body", http.StatusBadRequest)
|
http.Error(w, "Invalid JSON body", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
h.Logger.Debug("successfully decoded JSON")
|
h.Logger.Debug("successfully decoded deletion type cloud event", "vm_id", event.CloudEvent.Data.VM.VM.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the event CreatedTime to update the DeletionTime column in the VM inventory table
|
// Use the event CreatedTime to update the DeletionTime column in the VM inventory table
|
||||||
|
@@ -131,6 +131,9 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
|
|||||||
if change["newValue"] == "testVm" {
|
if change["newValue"] == "testVm" {
|
||||||
h.Logger.Debug("testVm")
|
h.Logger.Debug("testVm")
|
||||||
params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true}
|
params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true}
|
||||||
|
} else if change["newValue"] == "placeholderVm" {
|
||||||
|
h.Logger.Debug("placeholderVm")
|
||||||
|
params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user