Documentation
¶
Index ¶
- type Schedule
- type WorkflowExecution
- func (wfa *WorkflowExecution) ArgoStatusToState(status string) *WorkflowExecution
- func (d *WorkflowExecution) Book(executionsID string, wfID string, ...) []*booking.Booking
- func (d *WorkflowExecution) Buy(bs pricing.BillingStrategy, executionsID string, wfID string, ...) []*purchase_resource.PurchaseResource
- func (r *WorkflowExecution) CanDelete() bool
- func (r *WorkflowExecution) CanUpdate(set utils.DBObject) (bool, utils.DBObject)
- func (wfa *WorkflowExecution) Equals(we *WorkflowExecution) bool
- func (r *WorkflowExecution) GenerateID()
- func (d *WorkflowExecution) GetAccessor(request *tools.APIRequest) utils.Accessor
- func (d *WorkflowExecution) GetName() string
- func (ws *WorkflowExecution) PurgeDraft(request *tools.APIRequest) error
- func (r *WorkflowExecution) StoreDraftDefault()
- func (d *WorkflowExecution) VerifyAuth(request *tools.APIRequest) bool
- type WorkflowExecutionMongoAccessor
- func (wfa *WorkflowExecutionMongoAccessor) CopyOne(data utils.DBObject) (utils.DBObject, int, error)
- func (wfa *WorkflowExecutionMongoAccessor) DeleteOne(id string) (utils.DBObject, int, error)
- func (a *WorkflowExecutionMongoAccessor) GetExecFilters(search string) *dbs.Filters
- func (a *WorkflowExecutionMongoAccessor) LoadAll(isDraft bool) ([]utils.ShallowDBObject, int, error)
- func (a *WorkflowExecutionMongoAccessor) LoadOne(id string) (utils.DBObject, int, error)
- func (a *WorkflowExecutionMongoAccessor) Search(filters *dbs.Filters, search string, isDraft bool) ([]utils.ShallowDBObject, int, error)
- func (wfa *WorkflowExecutionMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error)
- func (wfa *WorkflowExecutionMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error)
- type WorkflowSchedule
- func (ws *WorkflowSchedule) CallDatacenter(purchase utils.DBObject, destPeerID string, dt tools.DataType, ...)
- func (ws *WorkflowSchedule) GenerateOrder(purchases []*purchase_resource.PurchaseResource, bookings []*booking.Booking, ...) error
- func (ws *WorkflowSchedule) GetBuyAndBook(wfID string, request *tools.APIRequest) (bool, *workflow.Workflow, []*WorkflowExecution, ...)
- func (ws *WorkflowSchedule) GetDates() ([]Schedule, error)
- func (ws *WorkflowSchedule) GetExecutions(workflow *workflow.Workflow) ([]*WorkflowExecution, error)
- func (ws *WorkflowSchedule) Schedules(wfID string, request *tools.APIRequest) (*WorkflowSchedule, *workflow.Workflow, []*WorkflowExecution, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkflowExecution ¶
type WorkflowExecution struct { utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name) PeerBuyByGraph map[string]map[string][]string `json:"peer_buy_by_graph,omitempty" bson:"peer_buy_by_graph,omitempty"` // BookByResource is a map of the resource id and the list of the booking id PeerBookByGraph map[string]map[string][]string `json:"peer_book_by_graph,omitempty" bson:"peer_book_by_graph,omitempty"` // BookByResource is a map of the resource id and the list of the booking id ExecutionsID string `json:"executions_id,omitempty" bson:"executions_id,omitempty"` ExecDate time.Time `json:"execution_date,omitempty" bson:"execution_date,omitempty" validate:"required"` // ExecDate is the execution date of the workflow, is required EndDate *time.Time `json:"end_date,omitempty" bson:"end_date,omitempty"` // EndDate is the end date of the workflow State enum.BookingStatus `json:"state" bson:"state" default:"0"` // TEMPORARY TODO DEFAULT 1 -> 0 State is the state of the workflow WorkflowID string `json:"workflow_id" bson:"workflow_id,omitempty"` // WorkflowID is the ID of the workflow }
* WorkflowExecution is a struct that represents a list of workflow executions * Warning: No user can write (del, post, put) a workflow execution, it is only used by the system * workflows generate their own executions
func (*WorkflowExecution) ArgoStatusToState ¶
func (wfa *WorkflowExecution) ArgoStatusToState(status string) *WorkflowExecution
tool to transform the argo status to a state
func (*WorkflowExecution) Book ¶
func (d *WorkflowExecution) Book(executionsID string, wfID string, priceds map[tools.DataType]map[string]pricing.PricedItemITF) []*booking.Booking
func (*WorkflowExecution) Buy ¶
func (d *WorkflowExecution) Buy(bs pricing.BillingStrategy, executionsID string, wfID string, priceds map[tools.DataType]map[string]pricing.PricedItemITF) []*purchase_resource.PurchaseResource
booking is an activity reserved for not a long time investment. ... purchase is dependant of a one time buying. use of a datacenter or storage can't be buy for permanent access.
func (*WorkflowExecution) CanDelete ¶
func (r *WorkflowExecution) CanDelete() bool
func (*WorkflowExecution) Equals ¶
func (wfa *WorkflowExecution) Equals(we *WorkflowExecution) bool
func (*WorkflowExecution) GenerateID ¶
func (r *WorkflowExecution) GenerateID()
func (*WorkflowExecution) GetAccessor ¶
func (d *WorkflowExecution) GetAccessor(request *tools.APIRequest) utils.Accessor
func (*WorkflowExecution) GetName ¶
func (d *WorkflowExecution) GetName() string
func (*WorkflowExecution) PurgeDraft ¶
func (ws *WorkflowExecution) PurgeDraft(request *tools.APIRequest) error
func (*WorkflowExecution) StoreDraftDefault ¶
func (r *WorkflowExecution) StoreDraftDefault()
func (*WorkflowExecution) VerifyAuth ¶
func (d *WorkflowExecution) VerifyAuth(request *tools.APIRequest) bool
type WorkflowExecutionMongoAccessor ¶
type WorkflowExecutionMongoAccessor struct { utils.AbstractAccessor // contains filtered or unexported fields }
func NewAccessor ¶
func NewAccessor(request *tools.APIRequest) *WorkflowExecutionMongoAccessor
func (*WorkflowExecutionMongoAccessor) GetExecFilters ¶
func (a *WorkflowExecutionMongoAccessor) GetExecFilters(search string) *dbs.Filters
func (*WorkflowExecutionMongoAccessor) LoadAll ¶
func (a *WorkflowExecutionMongoAccessor) LoadAll(isDraft bool) ([]utils.ShallowDBObject, int, error)
func (*WorkflowExecutionMongoAccessor) Search ¶
func (a *WorkflowExecutionMongoAccessor) Search(filters *dbs.Filters, search string, isDraft bool) ([]utils.ShallowDBObject, int, error)
type WorkflowSchedule ¶
type WorkflowSchedule struct { UUID string `json:"id" validate:"required"` // ExecutionsID is the list of the executions id of the workflow Workflow *workflow.Workflow `json:"workflow,omitempty"` // Workflow is the workflow dependancy of the schedule WorkflowExecution []*WorkflowExecution `json:"workflow_executions,omitempty"` // WorkflowExecution is the list of executions of the workflow Message string `json:"message,omitempty"` // Message is the message of the schedule Warning string `json:"warning,omitempty"` // Warning is the warning message of the schedule Start time.Time `json:"start" validate:"required,ltfield=End"` // Start is the start time of the schedule, is required and must be less than the End time End *time.Time `json:"end,omitempty"` // End is the end time of the schedule, is required and must be greater than the Start time DurationS float64 `json:"duration_s" default:"-1"` // End is the end time of the schedule Cron string `json:"cron,omitempty"` // here the cron format : ss mm hh dd MM dw task SelectedBillingStrategy pricing.BillingStrategy `json:"selected_billing_strategy"` }
* WorkflowSchedule is a struct that contains the scheduling information of a workflow * It contains the mode of the schedule (Task or Service), the name of the schedule, the start and end time of the schedule and the cron expression
it's a flying object only use in a session time. It's not stored in the database
func NewScheduler ¶
func NewScheduler(start string, end string, durationInS float64, cron string) *WorkflowSchedule
func (*WorkflowSchedule) CallDatacenter ¶
func (*WorkflowSchedule) GenerateOrder ¶
func (ws *WorkflowSchedule) GenerateOrder(purchases []*purchase_resource.PurchaseResource, bookings []*booking.Booking, request *tools.APIRequest) error
func (*WorkflowSchedule) GetBuyAndBook ¶
func (ws *WorkflowSchedule) GetBuyAndBook(wfID string, request *tools.APIRequest) (bool, *workflow.Workflow, []*WorkflowExecution, []*purchase_resource.PurchaseResource, []*booking.Booking, error)
func (*WorkflowSchedule) GetDates ¶
func (ws *WorkflowSchedule) GetDates() ([]Schedule, error)
func (*WorkflowSchedule) GetExecutions ¶
func (ws *WorkflowSchedule) GetExecutions(workflow *workflow.Workflow) ([]*WorkflowExecution, error)
* getExecutions is a function that returns the executions of a workflow * it returns an array of workflow_execution.WorkflowExecution
func (*WorkflowSchedule) Schedules ¶
func (ws *WorkflowSchedule) Schedules(wfID string, request *tools.APIRequest) (*WorkflowSchedule, *workflow.Workflow, []*WorkflowExecution, error)