rebrand oc-datacenter in oc-compute
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
// Workspace is a struct that represents a workspace
|
||||
type Workspace struct {
|
||||
utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name)
|
||||
resources.ResourceSet // ResourceSet contains the resources of the workspace (data, datacenter, processing, storage, workflow)
|
||||
resources.ResourceSet // ResourceSet contains the resources of the workspace (data, compute, processing, storage, workflow)
|
||||
IsContextual bool `json:"is_contextual" bson:"is_contextual" default:"false"` // IsContextual is a flag that indicates if the workspace is contextual
|
||||
Active bool `json:"active" bson:"active" default:"false"` // Active is a flag that indicates if the workspace is active
|
||||
Shared string `json:"shared,omitempty" bson:"shared,omitempty"` // Shared is the ID of the shared workspace
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area/shallow_collaborative_area"
|
||||
"cloud.o-forge.io/core/oc-lib/models/peer"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/data"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/datacenter"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/compute"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/processing"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/storage"
|
||||
w "cloud.o-forge.io/core/oc-lib/models/resources/workflow"
|
||||
@@ -40,7 +40,7 @@ func (wfa *workspaceMongoAccessor) DeleteOne(id string) (utils.DBObject, int, er
|
||||
func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
||||
d := set.(*Workspace) // Get the workspace from the set
|
||||
d.DataResources = nil // Reset the resources
|
||||
d.DatacenterResources = nil
|
||||
d.ComputeResources = nil
|
||||
d.StorageResources = nil
|
||||
d.ProcessingResources = nil
|
||||
d.WorkflowResources = nil
|
||||
@@ -76,7 +76,7 @@ func (wfa *workspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject
|
||||
// reset the resources
|
||||
d := data.(*Workspace)
|
||||
d.DataResources = nil
|
||||
d.DatacenterResources = nil
|
||||
d.ComputeResources = nil
|
||||
d.StorageResources = nil
|
||||
d.ProcessingResources = nil
|
||||
d.WorkflowResources = nil
|
||||
@@ -102,13 +102,13 @@ func (wfa *workspaceMongoAccessor) fill(workflow *Workspace) *Workspace {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fill the workspace with the datacenters
|
||||
if workflow.Datacenters != nil && len(workflow.Datacenters) > 0 {
|
||||
dataAccessor := (&datacenter.DatacenterResource{}).GetAccessor(nil)
|
||||
for _, id := range workflow.Datacenters {
|
||||
// Fill the workspace with the computes
|
||||
if workflow.Computes != nil && len(workflow.Computes) > 0 {
|
||||
dataAccessor := (&compute.ComputeResource{}).GetAccessor(nil)
|
||||
for _, id := range workflow.Computes {
|
||||
d, _, e := dataAccessor.LoadOne(id)
|
||||
if e == nil {
|
||||
workflow.DatacenterResources = append(workflow.DatacenterResources, d.(*datacenter.DatacenterResource))
|
||||
workflow.ComputeResources = append(workflow.ComputeResources, d.(*compute.ComputeResource))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user