jobs

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 6 Imported by: 0

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) VerifyPreconditions

func (DeleteJobsChangeset) VerifyPreconditions(env cldf.Environment, cfg DeleteJobsInput) error

type DeleteJobsInput

type DeleteJobsInput = jdops.DeleteJobsInput

DeleteJobsInput is the serializable input of DeleteJobsChangeset.

type JobSpec

type JobSpec = jdops.JobSpec

JobSpec is the per-job input for ProposeJobsInput.

type ProposeJobsChangeset

type ProposeJobsChangeset struct{}

ProposeJobsChangeset proposes a batch of job specs to nodes matched by label.

func (ProposeJobsChangeset) Apply

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) VerifyPreconditions

func (RevokeJobsChangeset) VerifyPreconditions(_ cldf.Environment, cfg RevokeJobsInput) error

type RevokeJobsInput

type RevokeJobsInput = jdops.RevokeJobsInput

RevokeJobsInput is the serializable input of RevokeJobsChangeset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL