packaged every model
This commit is contained in:
34
workflow/workflow.go
Normal file
34
workflow/workflow.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package oclib
|
||||
|
||||
import (
|
||||
oclib "oc-lib"
|
||||
"oc-lib/data"
|
||||
"oc-lib/datacenter"
|
||||
"oc-lib/link"
|
||||
"oc-lib/processing"
|
||||
"oc-lib/storage"
|
||||
)
|
||||
|
||||
type Workflow struct {
|
||||
oclib.AbstractResource `json:"abstract_resource" required:"true"`
|
||||
Datas map[string]data.Data `json:"datas,omitempty"`
|
||||
Storages map[string]storage.Storage `json:"storages,omitempty"`
|
||||
Processing map[string]processing.Processing `json:"processing,omitempty"`
|
||||
Datacenters map[string]datacenter.Datacenter `json:"datacenters,omitempty"`
|
||||
Links map[string]link.Link `json:"links,omitempty"`
|
||||
|
||||
Schedule WorkflowSchedule `json:"schedule,omitempty"`
|
||||
}
|
||||
|
||||
func (w *Workflow) isDCLink(link link.Link) bool {
|
||||
if _, exists := w.Datacenters[link.Destination]; exists {
|
||||
return true
|
||||
} else if _, exists := w.Datacenters[link.Source]; exists {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user