Documentation ¶
Index ¶
- Constants
- func AddResource(userID, rID, rType string) (err error)
- func CheckSchedule(cronString string, duration uint, cronFirstDate, cronLastDate time.Time, ...) (err error)
- func CreateObjectInWorkflow(userID, workflowName, rID string) (rObjID2 *string, err error)
- func CreateWorkflow(userID, workflowName string) (err error)
- func FindInSlice(slice []string, val string) (int, bool)
- func FindSliceInSlice(slice1 []string, slice2 []string) (int, int, bool)
- func GetAllWorkspaces() <-chan *Workspace
- func GetFarSchedules(baseDate time.Time, isNext bool) *time.Time
- func GetHost(hosts []string) (host *string)
- func GetMultipleComputing(IDs []string) (object *[]ComputingModel, err error)
- func GetMultipleData(IDs []string) (object *[]DataModel, err error)
- func GetMultipleDatacenter(IDs []string) (object *[]DatacenterModel, err error)
- func GetMultipleStorage(IDs []string) (object *[]StorageModel, err error)
- func GetMxGraph(username, workflowName string) (xmlData *string, err error)
- func IsValidResource(rID, rType string) (*primitive.ObjectID, error)
- func LinkObjectsInWorkspace(userID, workflowName, rObjIDsource string, isInput bool, rObjIDtarger string) (err error)
- func Login(username, password string) bool
- func ParseMxGraph(username, workflowName, xmlData string) (err error, mxissues []error)
- func PostOneComputing(obj ComputingNEWModel) (ID string, err error)
- func PostOneData(obj DataNEWModel) (string, error)
- func PostOneDatacenter(obj DatacenterNEWModel) (string, error)
- func PostOneStorage(obj StorageNEWModel) (string, error)
- func RemoveResource(userID, rID, rType string) error
- type ComputingModel
- type ComputingNEWModel
- type ComputingObject
- type DCstatus
- type DataIO
- type DataModel
- type DataNEWModel
- type DataObject
- type DatacenterCpuModel
- type DatacenterGpuModel
- type DatacenterMemoryModel
- type DatacenterModel
- type DatacenterNEWModel
- type DatacenterObject
- type ExecutionRequirementsModel
- type LinkingState
- type MxCell
- type MxGraphModel
- type RepositoryModel
- type ResourceModel
- type ResourceObject
- type ScheduleDB
- type ScheduleInfo
- type SearchResult
- type StorageModel
- type StorageNEWModel
- type StorageObject
- type UserModel
- type Workflow
- func (w *Workflow) AddObj(robj ResourceObject) *primitive.ObjectID
- func (w *Workflow) CreateResourceObject(rt rtype.Rtype) ResourceObject
- func (w Workflow) GetExecutionRequirements(dcIDobj string) (ret ExecutionRequirementsModel, err error)
- func (w *Workflow) GetResource(rObjID *string) (retObj ResourceObject)
- func (w *Workflow) GetResourceMapByRtype(rt rtype.Rtype) interface{}
- func (w *Workflow) UpdateDB(userID, workflowName string) error
- func (w *Workflow) UpdateObj(robj ResourceObject, objID string)
- type WorkflowSchedule
- type Workspace
- func (w Workspace) ConsumeMxGraphModel(xmlmodel MxGraphModel) (ret *Workflow, err error, issues []error)
- func (w *Workspace) GetAllWorkspacesProjects() <-chan *Workflow
- func (w *Workspace) GetResources() map[rtype.Rtype][]string
- func (w *Workspace) GetWorkflow(workflowName string) *Workflow
- func (w *Workspace) GetWorkflows() []string
- func (w *Workspace) NewResource(rID string, rType string) (err error)
- type WorkspaceModel
Constants ¶
View Source
const MAX_DATES uint = 1000 // Max number of dates to retrieve
View Source
const MAX_SCHEDULES int = 200
View Source
const SchedulesDB = "schedules"
View Source
const WorkflowDB = "workflows"
Assure consistency by using a const which refers to the MongoDB entry name Workspace.Projects
Variables ¶
This section is empty.
Functions ¶
func AddResource ¶
func CheckSchedule ¶
func CreateObjectInWorkflow ¶
func CreateWorkflow ¶
func FindInSlice ¶
FindInSlice takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false.
func FindSliceInSlice ¶
At least one element exist in both slices Return index1, index2 and if exist
func GetAllWorkspaces ¶
func GetAllWorkspaces() <-chan *Workspace
func GetMultipleComputing ¶
func GetMultipleComputing(IDs []string) (object *[]ComputingModel, err error)
func GetMultipleData ¶
func GetMultipleDatacenter ¶
func GetMultipleDatacenter(IDs []string) (object *[]DatacenterModel, err error)
func GetMultipleStorage ¶
func GetMultipleStorage(IDs []string) (object *[]StorageModel, err error)
func GetMxGraph ¶
func LinkObjectsInWorkspace ¶
func ParseMxGraph ¶
func PostOneComputing ¶
func PostOneComputing(obj ComputingNEWModel) (ID string, err error)
func PostOneData ¶
func PostOneData(obj DataNEWModel) (string, error)
func PostOneDatacenter ¶
func PostOneDatacenter(obj DatacenterNEWModel) (string, error)
func PostOneStorage ¶
func PostOneStorage(obj StorageNEWModel) (string, error)
func RemoveResource ¶
Types ¶
type ComputingModel ¶
type ComputingModel struct { ID string `json:"ID" bson:"_id" required:"true" example:"5099803df3f4948bd2f98391"` ComputingNEWModel `bson:",inline"` }
func GetOneComputing ¶
func GetOneComputing(ID string) (object *ComputingModel, err error)
type ComputingNEWModel ¶
type ComputingNEWModel struct { Description string `json:"description" required:"true"` Name string `json:"name,omitempty" required:"true" validate:"required" description:"Name of the computing"` ShortDescription string `json:"short_description" required:"true" validate:"required"` Logo string `json:"logo" required:"true" validate:"required"` Type string `json:"type,omitempty" required:"true"` Owner string `json:"owner"` License string `json:"license"` Price uint `json:"price"` ExecutionRequirements ExecutionRequirementsModel `json:"execution_requirements"` Dinputs []string Doutputs []string Repository RepositoryModel `json:"repository"` }
type ComputingObject ¶
type DCstatus ¶
type DCstatus struct { DCname string DCobjID string //FIXME: Probably should be model ID IsReachable bool IsAvailable bool Booked *ScheduleInfo ErrorMessage string }
When we check the schedule of a workflow, we report with this
type DataIO ¶
type DataIO struct {
Counter uint `description:"Incremental number starting from 0"`
}
type DataModel ¶
type DataModel struct { ID string `json:"ID" bson:"_id" required:"true" validate:"required"` DataNEWModel `bson:",inline"` }
func GetOneData ¶
type DataNEWModel ¶
type DataNEWModel struct { Name string `json:"name,omitempty" required:"true" validate:"required" description:"Name of the data"` ShortDescription string `json:"short_description" required:"true" validate:"required"` Logo string `json:"logo" required:"true" validate:"required"` Description string `json:"description" required:"true" validate:"required"` Type string `json:"type,omitempty" required:"true" validate:"required" description:"Define type of data" example:"file"` Example string `json:"example" required:"true" validate:"required" description:"base64 encoded data"` Location string `json:"location" required:"true" validate:"required"` Dtype string `json:"dtype"` Protocol []string `json:"protocol"` //TODO Enum type }
TODO: Define better the different types of Data model with model herarchy TODO: review why swagger are not using the metadata when we do herarchy
type DataObject ¶
type DatacenterCpuModel ¶
type DatacenterGpuModel ¶
type DatacenterMemoryModel ¶
type DatacenterModel ¶
type DatacenterModel struct { ID string `json:"ID" bson:"_id" required:"true"` DatacenterNEWModel `bson:",inline"` }
func GetDatacenterFromAcronym ¶
func GetDatacenterFromAcronym(DC_name string) (retObj *DatacenterModel)
func GetOneDatacenter ¶
func GetOneDatacenter(ID string) (object *DatacenterModel, err error)
func (DatacenterModel) GetTotalCPUs ¶
func (obj DatacenterModel) GetTotalCPUs() uint
func (DatacenterModel) GetTotalGPUs ¶
func (obj DatacenterModel) GetTotalGPUs() uint
func (DatacenterModel) GetTotalRAM ¶
func (obj DatacenterModel) GetTotalRAM() uint
type DatacenterNEWModel ¶
type DatacenterNEWModel struct { Name string `json:"name" required:"true"` Type string `json:"type,omitempty" required:"true"` Acronym string `json:"acronym" required:"true" description:"id of the DC"` Hosts []string `json:"hosts" required:"true" description:"list of host:port"` Description string `json:"description" required:"true"` ShortDescription string `json:"short_description" required:"true" validate:"required"` Logo string `json:"logo" required:"true" validate:"required"` CPU DatacenterCpuModel `json:"cpu" required:"true"` RAM DatacenterMemoryModel `json:"ram" required:"true"` GPU []DatacenterGpuModel `json:"gpu" required:"true"` Owner string `json:"owner" ` BookingPrice int `json:"bookingPrice" ` }
type DatacenterObject ¶
type ExecutionRequirementsModel ¶
type ExecutionRequirementsModel struct { CPUs uint `json:"cpus" required:"true"` GPUs uint `json:"gpus" description:"Amount of GPUs needed"` RAM uint `json:"ram" required:"true" description:"Units in MB"` Parallel bool `json:"parallel"` ScalingModel uint `json:"scaling_model"` DiskIO string `json:"disk_io"` }
type MxGraphModel ¶
type RepositoryModel ¶
type ResourceModel ¶
type ResourceModel interface {
// contains filtered or unexported methods
}
type ResourceObject ¶
type ResourceObject interface {
// contains filtered or unexported methods
}
type ScheduleDB ¶
type ScheduleDB struct { StartDate time.Time StopDate time.Time Workflow string ResourceQty ExecutionRequirementsModel }
func GetSchedules ¶
func GetSchedules(startDate, stopDate time.Time) (data []ScheduleDB, maxLimit bool, err error)
type ScheduleInfo ¶
func CreateScheduleWorkflow ¶
func CreateScheduleWorkflow(dcName, userID, workflowName, cronString string, duration uint, startDate, stopDate time.Time, requirements ExecutionRequirementsModel) (ret ScheduleInfo, err error)
func SetWorkflowSchedule ¶
type SearchResult ¶
type SearchResult struct { Computing []ComputingModel `json:"computing" required:"true"` Datacenter []DatacenterModel `json:"datacenter"` Storage []StorageModel `json:"storage"` Data []DataModel `json:"data"` }
func FindByWord ¶
func FindByWord(word string) (object *SearchResult, err error)
type StorageModel ¶
type StorageModel struct { ID string `json:"ID" bson:"_id" required:"true"` StorageNEWModel `bson:",inline"` }
func GetOneStorage ¶
func GetOneStorage(ID string) (object *StorageModel, err error)
type StorageNEWModel ¶
type StorageNEWModel struct { Name string `json:"name" required:"true"` Description string `json:"description" required:"true"` ShortDescription string `json:"short_description" required:"true" validate:"required"` Logo string `json:"logo" required:"true" validate:"required"` Type string `json:"type,omitempty" required:"true"` DCacronym string `json:"DCacronym" required:"true" description:"Unique ID of the DC where it is the storage"` Size uint `json:"size" required:"true"` Encryption bool `json:"encryption" ` Redundancy string `json:"redundancy" ` Throughput string `json:"throughput" ` BookingPrice uint `json:"bookingPrice" ` }
type StorageObject ¶
type Workflow ¶
type Workflow struct { // The key of the map is the ID of the object itself Data map[string]DataObject `json:"data"` Computing map[string]ComputingObject `json:"computing"` Storage map[string]StorageObject `json:"storage"` Datacenter map[string]DatacenterObject `json:"datacenter"` //TODO: Decide if there should be multiple objects of a datacenter Schedules WorkflowSchedule `json:"schedules"` MxgraphXML string `description:"State of the mxgraph"` }
func GetWorkflow ¶
func (*Workflow) CreateResourceObject ¶
func (w *Workflow) CreateResourceObject(rt rtype.Rtype) ResourceObject
func (Workflow) GetExecutionRequirements ¶
func (w Workflow) GetExecutionRequirements(dcIDobj string) (ret ExecutionRequirementsModel, err error)
Get a sum of all execution requirements attached to a DC obj
func (*Workflow) GetResource ¶
func (w *Workflow) GetResource(rObjID *string) (retObj ResourceObject)
func (*Workflow) GetResourceMapByRtype ¶
func (*Workflow) UpdateObj ¶
func (w *Workflow) UpdateObj(robj ResourceObject, objID string)
type WorkflowSchedule ¶
type WorkflowSchedule struct { IsService bool `description:"Service: true, Task: false"` StartDate time.Time StopDate time.Time Cron string `json:"cron"` Duration uint `json:"duration" description:"Durantion in seconds" example:"7200"` Events string `json:"events"` IsBooked bool `json:"isBooked"` }
func GetWorkflowSchedule ¶
func GetWorkflowSchedule(username, workflowName string) (Currentschedule *WorkflowSchedule, err error)
type Workspace ¶
type Workspace struct { UserID string `bson:"_id" json:"user_id"` Workflows map[string]Workflow //WorkflowDB // ID: rtype Data []string `json:"data"` Computing []string `json:"computing"` Datacenter []string `json:"datacenter"` Storage []string `json:"storage"` }
func GetWorkspace ¶
func NewWorkspace ¶
func (Workspace) ConsumeMxGraphModel ¶
func (w Workspace) ConsumeMxGraphModel(xmlmodel MxGraphModel) (ret *Workflow, err error, issues []error)
func (*Workspace) GetAllWorkspacesProjects ¶
func (*Workspace) GetWorkflow ¶
func (*Workspace) GetWorkflows ¶
type WorkspaceModel ¶
type WorkspaceModel struct { UserID string `bson:"_id" json:"user_id"` Data []DataModel `json:"data"` Computing []ComputingModel `json:"computing"` Datacenter []DatacenterModel `json:"datacenter"` Storage []StorageModel `json:"storage"` }
func ListFullWorkspace ¶
func ListFullWorkspace(userID string) (*WorkspaceModel, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.