Documentation
¶
Index ¶
- Variables
- func NewDisableCommand(streams *streams.Streams) *cobra.Command
- func NewEnableCommand(streams *streams.Streams) *cobra.Command
- func NewGetCommand(streams *streams.Streams) *cobra.Command
- func NewGetJobCommand(streams *streams.Streams) *cobra.Command
- func NewGetJobConfigCommand(streams *streams.Streams) *cobra.Command
- func NewKillCommand(streams *streams.Streams) *cobra.Command
- func NewListCommand(streams *streams.Streams) *cobra.Command
- func NewListJobCommand(streams *streams.Streams) *cobra.Command
- func NewListJobConfigCommand(streams *streams.Streams) *cobra.Command
- func NewLogsCommand(streams *streams.Streams) *cobra.Command
- func NewRootCommand(streams *streams.Streams) *cobra.Command
- func NewRunCommand(streams *streams.Streams) *cobra.Command
- func ParseParallelIndex(s string) (*execution.ParallelIndex, error)
- func WatchAndPrint[T runtime.Object](ctx context.Context, watcher watch.Interface, filter func(obj T) bool, ...) error
- type DisableCommand
- type EnableCommand
- type GetCommand
- type GetJobCommand
- type GetJobConfigCommand
- type KillCommand
- type ListCommand
- type ListJobCommand
- func (c *ListJobCommand) Complete(cmd *cobra.Command, args []string) error
- func (c *ListJobCommand) FilterJob(job *execution.Job) bool
- func (c *ListJobCommand) FilterJobs(jobs []execution.Job) []*execution.Job
- func (c *ListJobCommand) PrintJob(p *printer.TablePrinter, job *execution.Job) error
- func (c *ListJobCommand) PrintJobs(p *printer.TablePrinter, jobs []*execution.Job) error
- func (c *ListJobCommand) Run(cmd *cobra.Command, args []string) error
- func (c *ListJobCommand) Validate(cmd *cobra.Command, args []string) error
- type ListJobConfigCommand
- func (c *ListJobConfigCommand) Complete(cmd *cobra.Command, args []string) error
- func (c *ListJobConfigCommand) FilterJobConfig(jobConfig *execution.JobConfig) bool
- func (c *ListJobConfigCommand) FilterJobConfigs(jobConfigs []execution.JobConfig) []*execution.JobConfig
- func (c *ListJobConfigCommand) PrintJobConfig(p *printer.TablePrinter, jobConfig *execution.JobConfig) error
- func (c *ListJobConfigCommand) PrintJobConfigs(p *printer.TablePrinter, jobConfigs []*execution.JobConfig) error
- func (c *ListJobConfigCommand) Run(cmd *cobra.Command, args []string) error
- func (c *ListJobConfigCommand) Validate(cmd *cobra.Command, args []string) error
- type LogsCommand
- type RootCommand
- type RunCommand
Constants ¶
This section is empty.
Variables ¶
var (
DisableExample = common.PrepareExample(`
# Disable scheduling for the JobConfig.
{{.CommandName}} disable send-weekly-report`)
)
var (
EnableExample = common.PrepareExample(`
# Enable scheduling for the JobConfig.
{{.CommandName}} enable send-weekly-report`)
)
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`)
)
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`)
)
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`)
)
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`)
)
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`)
)
var (
LogsExample = common.PrepareExample(`
# Load the logs for the latest task attempt of the given Job.
{{.CommandName}} logs job-sample-1653825000`)
)
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 NewEnableCommand ¶ added in v0.2.0
func NewListJobConfigCommand ¶
func NewRootCommand ¶
NewRootCommand returns a new root command for the command-line utility.
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
}
type EnableCommand ¶ added in v0.2.0
type EnableCommand struct {
// contains filtered or unexported fields
}
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
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
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
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
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
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
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
}