booking debug

This commit is contained in:
mr 2024-11-18 16:27:30 +01:00
parent fe42651686
commit 38fc47f5ee
3 changed files with 7 additions and 2 deletions

View File

@ -137,9 +137,10 @@ func (o *BookingController) Post() {
json.Unmarshal(o.Ctx.Input.CopyBody(10000), &resp) json.Unmarshal(o.Ctx.Input.CopyBody(10000), &resp)
dc_id := resp.ResourceID dc_id := resp.ResourceID
// delete all previous bookings // delete all previous bookings
fmt.Println("Deleting previous bookings", resp)
res := oclib.Search(&dbs.Filters{And: map[string][]dbs.Filter{ res := oclib.Search(&dbs.Filters{And: map[string][]dbs.Filter{
"workflowexecution.workflow_id": {{Operator: dbs.EQUAL.String(), Value: resp.WorkflowID}}, "workflowexecution.workflow_id": {{Operator: dbs.EQUAL.String(), Value: resp.WorkflowID}},
"datacenter_resource_id": {{Operator: dbs.EQUAL.String(), Value: dc_id}}, "compute_resource_id": {{Operator: dbs.EQUAL.String(), Value: dc_id}},
}}, "", oclib.LibDataEnum(oclib.BOOKING)) }}, "", oclib.LibDataEnum(oclib.BOOKING))
if res.Code != 200 { if res.Code != 200 {
o.Data["json"] = map[string]interface{}{ o.Data["json"] = map[string]interface{}{

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.22.0
toolchain go1.22.4 toolchain go1.22.4
require ( require (
cloud.o-forge.io/core/oc-lib v0.0.0-20241112141026-06c3af5d4d61 cloud.o-forge.io/core/oc-lib v0.0.0-20241118144940-902ad0ea7144
github.com/beego/beego/v2 v2.3.1 github.com/beego/beego/v2 v2.3.1
) )

4
go.sum
View File

@ -24,6 +24,10 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20241112134441-8a21a7c803de h1:faiwXaNsohYkP
cloud.o-forge.io/core/oc-lib v0.0.0-20241112134441-8a21a7c803de/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= cloud.o-forge.io/core/oc-lib v0.0.0-20241112134441-8a21a7c803de/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
cloud.o-forge.io/core/oc-lib v0.0.0-20241112141026-06c3af5d4d61 h1:wAuOQAbv2uAie1QulHvbBzlZWMUE6hQ0kjhnP4OXFqQ= cloud.o-forge.io/core/oc-lib v0.0.0-20241112141026-06c3af5d4d61 h1:wAuOQAbv2uAie1QulHvbBzlZWMUE6hQ0kjhnP4OXFqQ=
cloud.o-forge.io/core/oc-lib v0.0.0-20241112141026-06c3af5d4d61/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo= cloud.o-forge.io/core/oc-lib v0.0.0-20241112141026-06c3af5d4d61/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
cloud.o-forge.io/core/oc-lib v0.0.0-20241114090218-14fe694fd370 h1:3o0naAyt9oXs/dG4eygreVePBmjd516PEZrW9aviJ0Q=
cloud.o-forge.io/core/oc-lib v0.0.0-20241114090218-14fe694fd370/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
cloud.o-forge.io/core/oc-lib v0.0.0-20241118144940-902ad0ea7144 h1:KC4lz5LzwXVz1M4eN9//sG45XqEwvMBY4NvrZw3vaE4=
cloud.o-forge.io/core/oc-lib v0.0.0-20241118144940-902ad0ea7144/go.mod h1:ya7Q+zHhaKM+XF6sAJ+avqHEVzaMnFJQih2X3TlTlGo=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I= github.com/beego/beego/v2 v2.3.0 h1:iECVwzm6egw6iw6tkWrEDqXG4NQtKLQ6QBSYqlM6T/I=
github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo= github.com/beego/beego/v2 v2.3.0/go.mod h1:Ob/5BJ9fIKZLd4s9ZV3o9J6odkkIyL83et+p98gyYXo=