Documentation ¶
Index ¶
Constants ¶
const ( JobStateInactive = JobState("inactive") JobStateLoaded = JobState("loaded") JobStateLaunched = JobState("launched") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Name string State *JobState Unit unit.Unit UnitHash unit.Hash UnitState *unit.UnitState }
func NewJob ¶
NewJob creates a new Job based on the given name and Unit. The returned Job has a populated UnitHash and empty JobState and UnitState. 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) IsBatch ¶ added in v0.4.0
IsBatch identifies whether the Job is intended to execute once, and, on completion, not be migrated around the cluster. This is determined by whether the unit file associated with the Job is a Service of type "oneshot".
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) 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
func (*Job) Requirements ¶
Requirements returns all relevant options from the [X-Fleet] section of a unit file. Relevant options are identified with a `X-` prefix in the unit. This prefix is stripped from relevant options before being returned. Furthermore, specifier substitution (using unitPrintf) is performed on all requirements.
func (*Job) Resources ¶ added in v0.4.0
func (j *Job) Resources() resource.ResourceTuple