job

package
v0.0.0-...-f8970bf Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewLoaderContext

func NewLoaderContext(ctx context.Context, jobWatcher *watcher.Watcher[*nais_io_v1.Naisjob], runWatcher *watcher.Watcher[*batchv1.Job]) context.Context

func NewRunWatcher

func NewRunWatcher(ctx context.Context, mgr *watcher.Manager) *watcher.Watcher[*batchv1.Job]
func Search(ctx context.Context, q string) ([]*search.Result, error)

Types

type DeleteJobInput

type DeleteJobInput struct {
	Name            string    `json:"name"`
	TeamSlug        slug.Slug `json:"teamSlug"`
	EnvironmentName string    `json:"environmentName"`
}

type DeleteJobPayload

type DeleteJobPayload struct {
	TeamSlug *slug.Slug `json:"-"`
	Success  bool       `json:"success"`
}

func Delete

func Delete(ctx context.Context, teamSlug slug.Slug, environmentName, name string) (*DeleteJobPayload, error)

type Job

type Job struct {
	workload.Base
	Spec *nais_io_v1.NaisjobSpec `json:"-"`
}

func Get

func Get(ctx context.Context, teamSlug slug.Slug, environment, name string) (*Job, error)

func GetByIdent

func GetByIdent(ctx context.Context, id ident.Ident) (*Job, error)

func ListAllForTeam

func ListAllForTeam(ctx context.Context, teamSlug slug.Slug) []*Job

func ListAllForTeamInEnvironment

func ListAllForTeamInEnvironment(ctx context.Context, teamSlug slug.Slug, environmentName string) []*Job

func (*Job) GetSecrets

func (j *Job) GetSecrets() []string

GetSecrets returns a list of secret names used by the job

func (Job) ID

func (j Job) ID() ident.Ident

func (Job) IsNode

func (Job) IsNode()

func (Job) IsSearchNode

func (Job) IsSearchNode()

func (Job) IsWorkload

func (Job) IsWorkload()

func (*Job) Resources

func (j *Job) Resources() *JobResources

func (*Job) Schedule

func (j *Job) Schedule() *JobSchedule

type JobConnection

type JobConnection = pagination.Connection[*Job]

type JobDeletedActivityLogEntry

type JobDeletedActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type JobEdge

type JobEdge = pagination.Edge[*Job]

type JobManifest

type JobManifest struct {
	Content string `json:"content"`
}

func Manifest

func Manifest(ctx context.Context, teamSlug slug.Slug, environmentName, name string) (*JobManifest, error)

func (JobManifest) IsWorkloadManifest

func (JobManifest) IsWorkloadManifest()

type JobOrder

type JobOrder struct {
	Field     JobOrderField        `json:"field"`
	Direction model.OrderDirection `json:"direction"`
}

type JobOrderField

type JobOrderField string
const (
	// JobOrderFieldStatus         JobOrderField = "STATUS"
	JobOrderFieldName        JobOrderField = "NAME"
	JobOrderFieldEnvironment JobOrderField = "ENVIRONMENT"
)

func (JobOrderField) IsValid

func (e JobOrderField) IsValid() bool

func (JobOrderField) MarshalGQL

func (e JobOrderField) MarshalGQL(w io.Writer)

func (JobOrderField) String

func (e JobOrderField) String() string

func (*JobOrderField) UnmarshalGQL

func (e *JobOrderField) UnmarshalGQL(v interface{}) error

type JobResources

type JobResources struct {
	Limits   *workload.WorkloadResourceQuantity `json:"limits"`
	Requests *workload.WorkloadResourceQuantity `json:"requests"`
}

func (JobResources) IsWorkloadResources

func (JobResources) IsWorkloadResources()

type JobRun

type JobRun struct {
	Name            string     `json:"name"`
	StartTime       *time.Time `json:"startTime"`
	CreationTime    time.Time  `json:"-"`
	EnvironmentName string     `json:"-"`
	TeamSlug        slug.Slug  `json:"-"`
	Failed          bool       `json:"-"`
	Message         string     `json:"-"`
	// contains filtered or unexported fields
}

func GetByJobRunIdent

func GetByJobRunIdent(ctx context.Context, id ident.Ident) (*JobRun, error)

func GetJobRun

func GetJobRun(ctx context.Context, teamSlug slug.Slug, environment, name string) (*JobRun, error)

func Trigger

func Trigger(ctx context.Context, teamSlug slug.Slug, environmentName, name, runName string) (*JobRun, error)

func (*JobRun) CompletionTime

func (j *JobRun) CompletionTime() *time.Time

func (*JobRun) Duration

func (j *JobRun) Duration() time.Duration

Duration returns the duration of the job run.

func (JobRun) ID

func (j JobRun) ID() ident.Ident

func (*JobRun) Image

func (j *JobRun) Image() *workload.ContainerImage

func (JobRun) IsNode

func (JobRun) IsNode()

func (*JobRun) Status

func (j *JobRun) Status() *JobRunStatus

type JobRunConnection

type JobRunConnection = pagination.Connection[*JobRun]

func Runs

func Runs(ctx context.Context, teamSlug slug.Slug, jobName string, page *pagination.Pagination) (*JobRunConnection, error)

type JobRunEdge

type JobRunEdge = pagination.Edge[*JobRun]

type JobRunInstance

type JobRunInstance struct {
	Name            string    `json:"name"`
	EnvironmentName string    `json:"-"`
	TeamSlug        slug.Slug `json:"-"`
}

func (JobRunInstance) ID

func (j JobRunInstance) ID() ident.Ident

func (JobRunInstance) IsNode

func (JobRunInstance) IsNode()

type JobRunInstanceConnection

type JobRunInstanceConnection = pagination.Connection[*JobRunInstance]

func ListJobRunInstances

func ListJobRunInstances(ctx context.Context, teamSlug slug.Slug, environmentName, jobRunName string, page *pagination.Pagination) (*JobRunInstanceConnection, error)

type JobRunInstanceEdge

type JobRunInstanceEdge = pagination.Edge[*JobRunInstance]

type JobRunState

type JobRunState int
const (
	JobRunStateUnknown JobRunState = iota
	JobRunStatePending
	JobRunStateRunning
	JobRunStateSucceeded
	JobRunStateFailed
)

func (JobRunState) IsValid

func (e JobRunState) IsValid() bool

func (JobRunState) MarshalGQL

func (e JobRunState) MarshalGQL(w io.Writer)

func (JobRunState) String

func (e JobRunState) String() string

func (*JobRunState) UnmarshalGQL

func (e *JobRunState) UnmarshalGQL(v interface{}) error

type JobRunStatus

type JobRunStatus struct {
	State   JobRunState `json:"state"`
	Message string      `json:"message"`
}

type JobSchedule

type JobSchedule struct {
	Expression string `json:"expression"`
	TimeZone   string `json:"timeZone"`
}

type JobTriggeredActivityLogEntry

type JobTriggeredActivityLogEntry struct {
	activitylog.GenericActivityLogEntry
}

type TeamInventoryCountJobs

type TeamInventoryCountJobs struct {
	Total   int `json:"total"`
	NotNais int `json:"notNais"`
}

type TeamJobsFilter

type TeamJobsFilter struct {
	Name string `json:"name"`
}

type TriggerJobInput

type TriggerJobInput struct {
	Name            string    `json:"name"`
	TeamSlug        slug.Slug `json:"teamSlug"`
	EnvironmentName string    `json:"environmentName"`
	RunName         string    `json:"runName"`
}

type TriggerJobPayload

type TriggerJobPayload struct {
	JobName         string    `json:"jobName"`
	TeamSlug        slug.Slug `json:"teamSlug"`
	EnvironmentName string    `json:"environmentName"`
	JobRun          *JobRun   `json:"jobRun"`
}

Jump to

Keyboard shortcuts

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