Documentation
¶
Overview ¶
Package jobs provides changesets for managing Job Distributor jobs.
Usage ¶
import "github.com/smartcontractkit/cld-changesets/jd/changesets/jobs"
// Propose jobs to nodes matched by domain and label:
_, err := runtime.ExecChangeset(rt, jobs.ProposeJobsChangeset{}, jobs.ProposeJobsInput{
Domain: "keystone",
Jobs: []jobs.JobSpec{{
NodeLabels: map[string]string{"target": "oracle-1"},
JobspecTOML: "...",
}},
})
// Revoke jobs by ID (idempotent — already-absent IDs are not an error):
_, err = runtime.ExecChangeset(rt, jobs.RevokeJobsChangeset{}, jobs.RevokeJobsInput{
JobIDs: []string{"job-id-1"},
})
// Delete jobs by ID (preconditions verify existence and eligibility):
_, err = runtime.ExecChangeset(rt, jobs.DeleteJobsChangeset{}, jobs.DeleteJobsInput{
JobIDs: []string{"job-id-1"},
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteJobsChangeset ¶
type DeleteJobsChangeset struct{}
DeleteJobsChangeset deletes jobs. Only jobs with proposals in PROPOSED, APPROVED, or PENDING state are eligible.
func (DeleteJobsChangeset) Apply ¶
func (DeleteJobsChangeset) Apply(e cldf.Environment, input DeleteJobsInput) (cldf.ChangesetOutput, error)
func (DeleteJobsChangeset) VerifyPreconditions ¶
func (DeleteJobsChangeset) VerifyPreconditions(env cldf.Environment, cfg DeleteJobsInput) error
type DeleteJobsInput ¶
type DeleteJobsInput = jdops.DeleteJobsInput
DeleteJobsInput is the serializable input of DeleteJobsChangeset.
type ProposeJobsChangeset ¶
type ProposeJobsChangeset struct{}
ProposeJobsChangeset proposes a batch of job specs to nodes matched by label.
func (ProposeJobsChangeset) Apply ¶
func (ProposeJobsChangeset) Apply(e cldf.Environment, input ProposeJobsInput) (cldf.ChangesetOutput, error)
func (ProposeJobsChangeset) VerifyPreconditions ¶
func (ProposeJobsChangeset) VerifyPreconditions(_ cldf.Environment, cfg ProposeJobsInput) error
type ProposeJobsInput ¶
type ProposeJobsInput = jdops.ProposeJobsInput
ProposeJobsInput is the serializable input of ProposeJobsChangeset.
type RevokeJobsChangeset ¶
type RevokeJobsChangeset struct{}
RevokeJobsChangeset revokes jobs.
func (RevokeJobsChangeset) Apply ¶
func (RevokeJobsChangeset) Apply(e cldf.Environment, input RevokeJobsInput) (cldf.ChangesetOutput, error)
func (RevokeJobsChangeset) VerifyPreconditions ¶
func (RevokeJobsChangeset) VerifyPreconditions(_ cldf.Environment, cfg RevokeJobsInput) error
type RevokeJobsInput ¶
type RevokeJobsInput = jdops.RevokeJobsInput
RevokeJobsInput is the serializable input of RevokeJobsChangeset.
Click to show internal directories.
Click to hide internal directories.