Documentation
¶
Index ¶
- type Booking
- func (b *Booking) CalcDeltaOfExecution() map[string]map[string]models.MetricResume
- func (r *Booking) CanDelete() bool
- func (r *Booking) CanUpdate(set utils.DBObject) (bool, utils.DBObject)
- func (wfa *Booking) Check(id string, start time.Time, end *time.Time, parrallelAllowed int) (bool, error)
- func (d *Booking) GetAccessor(request *tools.APIRequest) utils.Accessor
- func (d *Booking) GetDelayForFinishing() time.Duration
- func (d *Booking) GetDelayForLaunch() time.Duration
- func (d *Booking) GetDelayOnDuration() time.Duration
- func (d *Booking) GetRealDuration() time.Duration
- func (d *Booking) GetUsualDuration() time.Duration
- func (r *Booking) StoreDraftDefault()
- func (d *Booking) VerifyAuth(request *tools.APIRequest) bool
- type BookingMongoAccessor
- func (a *BookingMongoAccessor) CopyOne(data utils.DBObject) (utils.DBObject, int, error)
- func (a *BookingMongoAccessor) DeleteOne(id string) (utils.DBObject, int, error)
- func (a *BookingMongoAccessor) LoadAll(isDraft bool) ([]utils.ShallowDBObject, int, error)
- func (a *BookingMongoAccessor) LoadOne(id string) (utils.DBObject, int, error)
- func (a *BookingMongoAccessor) Search(filters *dbs.Filters, search string, isDraft bool) ([]utils.ShallowDBObject, int, error)
- func (a *BookingMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error)
- func (a *BookingMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Booking ¶
type Booking struct { utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name) PricedItem map[string]interface{} `json:"priced_item,omitempty" bson:"priced_item,omitempty"` // We need to add the validate:"required" tag once the pricing feature is implemented, removed to avoid handling the error ResumeMetrics map[string]map[string]models.MetricResume `json:"resume_metrics,omitempty" bson:"resume_metrics,omitempty"` ExecutionMetrics map[string][]models.MetricsSnapshot `json:"metrics,omitempty" bson:"metrics,omitempty"` ExecutionsID string `json:"executions_id,omitempty" bson:"executions_id,omitempty" validate:"required"` // ExecutionsID is the ID of the executions DestPeerID string `json:"dest_peer_id,omitempty" bson:"dest_peer_id,omitempty"` // DestPeerID is the ID of the destination peer WorkflowID string `json:"workflow_id,omitempty" bson:"workflow_id,omitempty"` // WorkflowID is the ID of the workflow ExecutionID string `json:"execution_id,omitempty" bson:"execution_id,omitempty" validate:"required"` State enum.BookingStatus `json:"state,omitempty" bson:"state,omitempty" validate:"required"` // State is the state of the booking ExpectedStartDate time.Time `json:"expected_start_date,omitempty" bson:"expected_start_date,omitempty" validate:"required"` // ExpectedStartDate is the expected start date of the booking ExpectedEndDate *time.Time `json:"expected_end_date,omitempty" bson:"expected_end_date,omitempty" validate:"required"` // ExpectedEndDate is the expected end date of the booking RealStartDate *time.Time `json:"real_start_date,omitempty" bson:"real_start_date,omitempty"` // RealStartDate is the real start date of the booking RealEndDate *time.Time `json:"real_end_date,omitempty" bson:"real_end_date,omitempty"` // RealEndDate is the real end date of the booking ResourceType tools.DataType `json:"resource_type,omitempty" bson:"resource_type,omitempty" validate:"required"` // ResourceType is the type of the resource ResourceID string `json:"resource_id,omitempty" bson:"resource_id,omitempty" validate:"required"` // could be a Compute or a Storage }
* Booking is a struct that represents a booking
func (*Booking) CalcDeltaOfExecution ¶
func (b *Booking) CalcDeltaOfExecution() map[string]map[string]models.MetricResume
func (*Booking) Check ¶
func (wfa *Booking) Check(id string, start time.Time, end *time.Time, parrallelAllowed int) (bool, error)
CheckBooking checks if a booking is possible on a specific compute resource
func (*Booking) GetAccessor ¶
func (d *Booking) GetAccessor(request *tools.APIRequest) utils.Accessor
func (*Booking) GetDelayForFinishing ¶
func (*Booking) GetDelayForLaunch ¶
func (*Booking) GetDelayOnDuration ¶
func (*Booking) GetRealDuration ¶
func (*Booking) GetUsualDuration ¶
func (*Booking) StoreDraftDefault ¶
func (r *Booking) StoreDraftDefault()
func (*Booking) VerifyAuth ¶
func (d *Booking) VerifyAuth(request *tools.APIRequest) bool
type BookingMongoAccessor ¶
type BookingMongoAccessor struct {
utils.AbstractAccessor // AbstractAccessor contains the basic fields of an accessor (model, caller)
}
func NewAccessor ¶
func NewAccessor(request *tools.APIRequest) *BookingMongoAccessor
New creates a new instance of the BookingMongoAccessor
func (*BookingMongoAccessor) LoadAll ¶
func (a *BookingMongoAccessor) LoadAll(isDraft bool) ([]utils.ShallowDBObject, int, error)
func (*BookingMongoAccessor) Search ¶
func (a *BookingMongoAccessor) Search(filters *dbs.Filters, search string, isDraft bool) ([]utils.ShallowDBObject, int, error)
Click to show internal directories.
Click to hide internal directories.