cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DisableExample = common.PrepareExample(`
# Disable scheduling for the JobConfig.
{{.CommandName}} disable send-weekly-report`)
)
View Source
var (
	EnableExample = common.PrepareExample(`
# Enable scheduling for the JobConfig.
{{.CommandName}} enable send-weekly-report`)
)
View Source
var (
	GetJobConfigExample = common.PrepareExample(`
# Get a single JobConfig in the current namespace.
{{.CommandName}} get jobconfig daily-send-email

# Get multiple JobConfigs by name in the current namespace.
{{.CommandName}} get jobconfig daily-send-email weekly-report-email

# Get a single JobConfig in JSON format.
{{.CommandName}} get jobconfig daily-send-email -o json`)
)
View Source
var (
	GetJobExample = common.PrepareExample(`
# Get a single Job in the current namespace.
{{.CommandName}} get job job-sample-l6dc6

# Get multiple Jobs by name in the current namespace.
{{.CommandName}} get job job-sample-l6dc6 job-sample-cdwqb

# Get a single Job in JSON format.
{{.CommandName}} get job job-sample-l6dc6 -o json`)
)
View Source
var (
	KillExample = common.PrepareExample(`
# Request to kill an ongoing Job.
{{.CommandName}} kill job-sample-1653825000

# Request for an ongoing Job to be killed 60 seconds from now.
{{.CommandName}} kill job-sample-1653825000 -p 60s

# Request for an ongoing Job to be killed at a specific time in the future.
{{.CommandName}} kill job-sample-1653825000 -t 2023-01-01T00:00:00Z`)
)
View Source
var (
	ListJobConfigExample = common.PrepareExample(`
# List all JobConfigs in current namespace.
{{.CommandName}} list jobconfig

# List all JobConfigs across all namespaces.
{{.CommandName}} list jobconfig -A

# List only JobConfigs with a schedule.
{{.CommandName}} list jobconfig --scheduled

# List adhoc-only JobConfigs (i.e. does not have a schedule).
{{.CommandName}} list jobconfig --adhoc-only

# List JobConfigs in JSON format.
{{.CommandName}} list jobconfig -o json`)
)
View Source
var (
	ListJobExample = common.PrepareExample(`
# List all Jobs in current namespace.
{{.CommandName}} list job

# List all Jobs across all namespaces.
{{.CommandName}} list job -A

# List all Jobs in current namespace belonging to JobConfig "daily-send-email".
{{.CommandName}} list job --for daily-send-email

# List all Jobs in JSON format.
{{.CommandName}} list job -o json`)
)
View Source
var (
	LogsExample = common.PrepareExample(`
# Load the logs for the latest task attempt of the given Job.
{{.CommandName}} logs job-sample-1653825000`)
)
View Source
var (
	RunExample = common.PrepareExample(`
# Execute a new Job from an existing JobConfig.
{{.CommandName}} run daily-send-email

# Execute a new Job only after the specified time.
{{.CommandName}} run daily-send-email --at 2021-01-01T00:00:00+08:00

# Execute a new Job only after the specified duration.
{{.CommandName}} run daily-send-email --after 15m

# Execute a new Job, and use all default options.
{{.CommandName}} run daily-send-email --use-default-options

# Execute a new Job with the specified option values in JSON format.
{{.CommandName}} run daily-send-email -O '{"dest_email": "team-leads@listserv.acme.org"}'

# Queue a new Job to be executed after other Jobs are finished.
{{.CommandName}} run process-payments --enqueue`)
)

Functions

func NewDisableCommand added in v0.2.0

func NewDisableCommand(streams *streams.Streams) *cobra.Command

func NewEnableCommand added in v0.2.0

func NewEnableCommand(streams *streams.Streams) *cobra.Command

func NewGetCommand

func NewGetCommand(streams *streams.Streams) *cobra.Command

func NewGetJobCommand

func NewGetJobCommand(streams *streams.Streams) *cobra.Command

func NewGetJobConfigCommand

func NewGetJobConfigCommand(streams *streams.Streams) *cobra.Command

func NewKillCommand added in v0.2.0

func NewKillCommand(streams *streams.Streams) *cobra.Command

func NewListCommand

func NewListCommand(streams *streams.Streams) *cobra.Command

func NewListJobCommand

func NewListJobCommand(streams *streams.Streams) *cobra.Command

func NewListJobConfigCommand

func NewListJobConfigCommand(streams *streams.Streams) *cobra.Command

func NewLogsCommand added in v0.3.0

func NewLogsCommand(streams *streams.Streams) *cobra.Command

func NewRootCommand

func NewRootCommand(streams *streams.Streams) *cobra.Command

NewRootCommand returns a new root command for the command-line utility.

func NewRunCommand

func NewRunCommand(streams *streams.Streams) *cobra.Command

func ParseParallelIndex added in v0.3.0

func ParseParallelIndex(s string) (*execution.ParallelIndex, error)

ParseParallelIndex is a best-effort attempt to parse a human-readable parallel index string.

func WatchAndPrint added in v0.3.0

func WatchAndPrint[T runtime.Object](ctx context.Context, watcher watch.Interface, filter func(obj T) bool, handler func(obj T) error) error

WatchAndPrint will block on the given watch.Interface, and print all results using the provided handler, and returns once the context is done. If the received object's type does not match the generic type T, it will fall through to other default handlers.

Types

type DisableCommand added in v0.2.0

type DisableCommand struct {
	// contains filtered or unexported fields
}

func (*DisableCommand) Run added in v0.2.0

func (c *DisableCommand) Run(cmd *cobra.Command, args []string) error

type EnableCommand added in v0.2.0

type EnableCommand struct {
	// contains filtered or unexported fields
}

func (*EnableCommand) Run added in v0.2.0

func (c *EnableCommand) Run(cmd *cobra.Command, args []string) error

type GetCommand added in v0.3.0

type GetCommand struct {
	// contains filtered or unexported fields
}

func (*GetCommand) AddSubcommand added in v0.3.0

func (c *GetCommand) AddSubcommand(cmd, subCommand *cobra.Command)

AddSubcommand will register subcommand flags and add it to the parent command.

func (*GetCommand) RegisterFlags added in v0.3.0

func (c *GetCommand) RegisterFlags(cmd *cobra.Command)

RegisterFlags will register flags for the given subcommand.

type GetJobCommand

type GetJobCommand struct {
	// contains filtered or unexported fields
}

func (*GetJobCommand) Complete added in v0.3.0

func (c *GetJobCommand) Complete(cmd *cobra.Command, args []string) error

func (*GetJobCommand) PrintJobs

func (c *GetJobCommand) PrintJobs(output printer.OutputFormat, jobs []*execution.Job) error

func (*GetJobCommand) Run

func (c *GetJobCommand) Run(cmd *cobra.Command, args []string) error

type GetJobConfigCommand

type GetJobConfigCommand struct {
	// contains filtered or unexported fields
}

func (*GetJobConfigCommand) Complete added in v0.3.0

func (c *GetJobConfigCommand) Complete(cmd *cobra.Command, args []string) error

func (*GetJobConfigCommand) PrintJobConfigs

func (c *GetJobConfigCommand) PrintJobConfigs(output printer.OutputFormat, jobConfigs []*execution.JobConfig) error

func (*GetJobConfigCommand) Run

func (c *GetJobConfigCommand) Run(cmd *cobra.Command, args []string) error

type KillCommand added in v0.2.0

type KillCommand struct {
	// contains filtered or unexported fields
}

func (*KillCommand) Complete added in v0.3.0

func (c *KillCommand) Complete(cmd *cobra.Command, args []string) error

func (*KillCommand) Run added in v0.2.0

func (c *KillCommand) Run(cmd *cobra.Command, args []string) error

func (*KillCommand) Validate added in v0.3.0

func (c *KillCommand) Validate(cmd *cobra.Command, args []string) error

type ListCommand added in v0.3.0

type ListCommand struct {
	// contains filtered or unexported fields
}

func (*ListCommand) AddSubcommand added in v0.3.0

func (c *ListCommand) AddSubcommand(cmd, subCommand *cobra.Command)

AddSubcommand will register subcommand flags and add it to the parent command.

func (*ListCommand) RegisterFlags added in v0.3.0

func (c *ListCommand) RegisterFlags(cmd *cobra.Command)

RegisterFlags will register flags for the given subcommand.

type ListJobCommand

type ListJobCommand struct {
	// contains filtered or unexported fields
}

func (*ListJobCommand) Complete added in v0.3.0

func (c *ListJobCommand) Complete(cmd *cobra.Command, args []string) error

func (*ListJobCommand) FilterJob added in v0.3.0

func (c *ListJobCommand) FilterJob(job *execution.Job) bool

FilterJob returns true if the job is retained in the filter.

func (*ListJobCommand) FilterJobs added in v0.3.0

func (c *ListJobCommand) FilterJobs(jobs []execution.Job) []*execution.Job

FilterJobs returns a filtered list of jobs.

func (*ListJobCommand) PrintJob added in v0.3.0

func (c *ListJobCommand) PrintJob(p *printer.TablePrinter, job *execution.Job) error

func (*ListJobCommand) PrintJobs

func (c *ListJobCommand) PrintJobs(p *printer.TablePrinter, jobs []*execution.Job) error

func (*ListJobCommand) Run

func (c *ListJobCommand) Run(cmd *cobra.Command, args []string) error

func (*ListJobCommand) Validate added in v0.3.0

func (c *ListJobCommand) Validate(cmd *cobra.Command, args []string) error

type ListJobConfigCommand

type ListJobConfigCommand struct {
	// contains filtered or unexported fields
}

func (*ListJobConfigCommand) Complete added in v0.3.0

func (c *ListJobConfigCommand) Complete(cmd *cobra.Command, args []string) error

func (*ListJobConfigCommand) FilterJobConfig added in v0.3.0

func (c *ListJobConfigCommand) FilterJobConfig(jobConfig *execution.JobConfig) bool

FilterJobConfig returns true if the job config is retained in the filter.

func (*ListJobConfigCommand) FilterJobConfigs added in v0.3.0

func (c *ListJobConfigCommand) FilterJobConfigs(jobConfigs []execution.JobConfig) []*execution.JobConfig

FilterJobConfigs returns a filtered list of job configs.

func (*ListJobConfigCommand) PrintJobConfig added in v0.3.0

func (c *ListJobConfigCommand) PrintJobConfig(p *printer.TablePrinter, jobConfig *execution.JobConfig) error

func (*ListJobConfigCommand) PrintJobConfigs

func (c *ListJobConfigCommand) PrintJobConfigs(p *printer.TablePrinter, jobConfigs []*execution.JobConfig) error

func (*ListJobConfigCommand) Run

func (c *ListJobConfigCommand) Run(cmd *cobra.Command, args []string) error

func (*ListJobConfigCommand) Validate added in v0.3.0

func (c *ListJobConfigCommand) Validate(cmd *cobra.Command, args []string) error

type LogsCommand added in v0.3.0

type LogsCommand struct {
	// contains filtered or unexported fields
}

func (*LogsCommand) Complete added in v0.3.0

func (c *LogsCommand) Complete(cmd *cobra.Command, args []string) error

func (*LogsCommand) Run added in v0.3.0

func (c *LogsCommand) Run(cmd *cobra.Command, args []string) error

func (*LogsCommand) Validate added in v0.3.0

func (c *LogsCommand) Validate(cmd *cobra.Command, args []string) error

type RootCommand

type RootCommand struct {
	// contains filtered or unexported fields
}

func (*RootCommand) PersistentPreRunE

func (c *RootCommand) PersistentPreRunE(cmd *cobra.Command, args []string) error

type RunCommand

type RunCommand struct {
	// contains filtered or unexported fields
}

func (*RunCommand) Complete added in v0.3.0

func (c *RunCommand) Complete(cmd *cobra.Command, args []string) error

func (*RunCommand) Run

func (c *RunCommand) Run(cmd *cobra.Command, args []string) error

func (*RunCommand) Validate added in v0.3.0

func (c *RunCommand) Validate(cmd *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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