Documentation ¶
Index ¶
Constants ¶
const ( JobStateInactive = JobState("inactive") JobStateLoaded = JobState("loaded") JobStateLaunched = JobState("launched") JobReschedule = "jobreschedule" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Name string State *JobState TargetState JobState TargetMachineID string Unit unit.UnitFile }
Job is a legacy construct encapsulating a scheduled unit in fleet
func NewJob ¶
NewJob creates a new Job based on the given name and Unit. The returned Job has a populated UnitHash and empty JobState. nil is returned on failure.
func (*Job) Conflicts ¶ added in v0.3.0
Conflicts returns a list of Job names that cannot be scheduled to the same machine as this Job.
func (*Job) Peers ¶ added in v0.3.0
Peers returns a list of Job names that must be scheduled to the same machine as this Job.
func (*Job) Replaces ¶ added in v0.13.0
Replaces returns a list of Job names that should be scheduled to the another machine as this Job.
func (*Job) RequiredTarget ¶ added in v0.3.0
RequiredTarget determines whether or not this Job must be scheduled to a specific machine. If such a requirement exists, the first value returned represents the ID of such a machine, while the second value will be a bool true. If no requirement exists, an empty string along with a bool false will be returned.
func (*Job) RequiredTargetMetadata ¶ added in v0.3.0
RequiredTargetMetadata return all machine-related metadata from a Job's requirements. Valid metadata fields are strings of the form `key=value`, where both key and value are not the empty string.
func (*Job) ValidateRequirements ¶ added in v0.8.2
ValidateRequirements ensures that all options in the [X-Fleet] section of the job's associated unit file are known keys. If not, an error is returned.
type ScheduledUnit ¶ added in v0.7.0
ScheduledUnit represents a Unit known by fleet and encapsulates its current scheduling state. This does not include Global units.
type Unit ¶ added in v0.7.0
Unit represents a Unit that has been submitted to fleet (list-unit-files)
func (*Unit) Conflicts ¶ added in v0.8.0
The following helper functions are to facilitate the transition from Job --> Unit