From b990fe42d3754ab5f43a9822b40400a31bed198b Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 17 Jan 2025 10:07:37 +0100 Subject: [PATCH] inspect search bug --- models/resources/compute.go | 2 +- models/resources/processing.go | 6 +++--- models/resources/storage.go | 4 ++-- models/resources/workflow.go | 7 +------ 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/models/resources/compute.go b/models/resources/compute.go index 575c9e1..9d0e20c 100644 --- a/models/resources/compute.go +++ b/models/resources/compute.go @@ -19,7 +19,7 @@ import ( type ComputeResource struct { AbstractIntanciatedResource[*ComputeResourceInstance] Architecture string `json:"architecture,omitempty" bson:"architecture,omitempty"` // Architecture is the architecture - Infrastructure enum.InfrastructureType `json:"infrastructure,omitempty" bson:"infrastructure,omitempty"` + Infrastructure enum.InfrastructureType `json:"infrastructure" bson:"infrastructure" default:"-1"` // Infrastructure is the infrastructure } func (d *ComputeResource) GetAccessor(request *tools.APIRequest) utils.Accessor { diff --git a/models/resources/processing.go b/models/resources/processing.go index 374deaa..829cc5f 100644 --- a/models/resources/processing.go +++ b/models/resources/processing.go @@ -26,9 +26,9 @@ type ProcessingUsage struct { */ type ProcessingResource struct { AbstractIntanciatedResource[*ResourceInstance[*ResourcePartnerShip[*ProcessingResourcePricingProfile]]] - Infrastructure enum.InfrastructureType `json:"infrastructure,omitempty" bson:"infrastructure,omitempty"` - IsService bool `json:"is_service,omitempty" bson:"is_service,omitempty"` // IsService is a flag that indicates if the processing is a service - Usage *ProcessingUsage `bson:"usage,omitempty" json:"usage,omitempty"` // Usage is the usage of the processing + Infrastructure enum.InfrastructureType `json:"infrastructure" bson:"infrastructure" default:"-1"` // Infrastructure is the infrastructure + IsService bool `json:"is_service,omitempty" bson:"is_service,omitempty"` // IsService is a flag that indicates if the processing is a service + Usage *ProcessingUsage `bson:"usage,omitempty" json:"usage,omitempty"` // Usage is the usage of the processing OpenSource bool `json:"open_source" bson:"open_source" default:"false"` License string `json:"license,omitempty" bson:"license,omitempty"` Maturity string `json:"maturity,omitempty" bson:"maturity,omitempty"` diff --git a/models/resources/storage.go b/models/resources/storage.go index d5f0036..3ce2e7a 100644 --- a/models/resources/storage.go +++ b/models/resources/storage.go @@ -16,8 +16,8 @@ import ( */ type StorageResource struct { AbstractIntanciatedResource[*StorageResourceInstance] // AbstractResource contains the basic fields of an object (id, name) - StorageType enum.StorageType `bson:"storage_type,omitempty" json:"storage_type,omitempty"` // Type is the type of the storage - Acronym string `bson:"acronym,omitempty" json:"acronym,omitempty"` // Acronym is the acronym of the storage + StorageType enum.StorageType `bson:"storage_type" json:"storage_type" default:"-1"` // Type is the type of the storage + Acronym string `bson:"acronym,omitempty" json:"acronym,omitempty"` // Acronym is the acronym of the storage } func (d *StorageResource) GetAccessor(request *tools.APIRequest) utils.Accessor { diff --git a/models/resources/workflow.go b/models/resources/workflow.go index 42e6807..7c97223 100644 --- a/models/resources/workflow.go +++ b/models/resources/workflow.go @@ -6,18 +6,13 @@ import ( "cloud.o-forge.io/core/oc-lib/tools" ) -// we don't have any information about the accessor -type abstractWorkflowResource struct { - WorkflowID string `bson:"workflow_id,omitempty" json:"workflow_id,omitempty"` // WorkflowID is the ID of the native workflow -} - type WorkflowResourcePricingProfile struct{} // WorkflowResource is a struct that represents a workflow resource // it defines the resource workflow type WorkflowResource struct { AbstractResource - abstractWorkflowResource + WorkflowID string `bson:"workflow_id,omitempty" json:"workflow_id,omitempty"` // WorkflowID is the ID of the native workflow } func (d *WorkflowResource) GetAccessor(request *tools.APIRequest) utils.Accessor {