add raw string to database
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-02 13:37:59 +10:00
parent f94339446d
commit f9b8e25c2f
6 changed files with 24 additions and 9 deletions

View File

@@ -197,6 +197,7 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
// populate other parameters for the Update database record
params.Name = sql.NullString{String: event.CloudEvent.Data.VM.Name, Valid: event.CloudEvent.Data.VM.Name != ""}
params.RawChangeString = []byte(event.CloudEvent.Data.ConfigChanges.Modified)
params.EventId = sql.NullString{String: event.CloudEvent.ID, Valid: event.CloudEvent.ID != ""}
params.EventKey = sql.NullString{String: strconv.Itoa(event.CloudEvent.Data.Key), Valid: event.CloudEvent.Data.Key > 0}
params.UpdateTime = sql.NullInt64{Int64: unixTimestamp, Valid: unixTimestamp > 0}

View File

@@ -41,7 +41,7 @@ func New(logger *slog.Logger, database db.Database, buildTime string, sha1ver st
//mux.HandleFunc("/api/inventory/vm/update", h.VmUpdateDetails)
// temporary endpoint
mux.HandleFunc("/api/cleanup/updates", h.UpdateCleanup)
//mux.HandleFunc("/api/cleanup/updates", h.UpdateCleanup)
//mux.HandleFunc("/api/cleanup/vcenter", h.VcCleanup)
mux.HandleFunc("/api/report/inventory", h.InventoryReportDownload)