Documentation ¶
Index ¶
- func NewAccessor(request *tools.APIRequest) *bookingMongoAccessor
- type Booking
- 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) GetName() string
- func (d *Booking) GetRealDuration() time.Duration
- func (d *Booking) GetUsualDuration() time.Duration
- func (r *Booking) StoreDraftDefault()
- func (d *Booking) VerifyAuth(request *tools.APIRequest) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccessor ¶
func NewAccessor(request *tools.APIRequest) *bookingMongoAccessor
New creates a new instance of the bookingMongoAccessor
Types ¶
type Booking ¶
type Booking struct { utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name) DestPeerID string `json:"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 common.ScheduledType `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) 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
Click to show internal directories.
Click to hide internal directories.