2022-12-23 14:17:16 +00:00
|
|
|
package run
|
|
|
|
|
2023-03-29 12:58:09 +00:00
|
|
|
import (
|
2024-02-06 14:51:02 +00:00
|
|
|
"github.com/databricks/cli/libs/cmdgroup"
|
|
|
|
"github.com/spf13/cobra"
|
2023-03-29 12:58:09 +00:00
|
|
|
)
|
2022-12-23 14:17:16 +00:00
|
|
|
|
|
|
|
type Options struct {
|
|
|
|
Job JobOptions
|
|
|
|
Pipeline PipelineOptions
|
2023-07-12 06:51:54 +00:00
|
|
|
NoWait bool
|
2022-12-23 14:17:16 +00:00
|
|
|
}
|
|
|
|
|
2024-02-06 14:51:02 +00:00
|
|
|
func (o *Options) Define(cmd *cobra.Command) {
|
|
|
|
wrappedCmd := cmdgroup.NewCommandWithGroupFlag(cmd)
|
|
|
|
jobGroup := wrappedCmd.AddFlagGroup("Job")
|
|
|
|
o.Job.DefineJobOptions(jobGroup.FlagSet())
|
|
|
|
|
|
|
|
jobTaskGroup := wrappedCmd.AddFlagGroup("Job Task")
|
|
|
|
jobTaskGroup.SetDescription(`Note: please prefer use of job-level parameters (--param) over task-level parameters.
|
|
|
|
For more information, see https://docs.databricks.com/en/workflows/jobs/create-run-jobs.html#pass-parameters-to-a-databricks-job-task`)
|
|
|
|
o.Job.DefineTaskOptions(jobTaskGroup.FlagSet())
|
|
|
|
|
|
|
|
pipelineGroup := wrappedCmd.AddFlagGroup("Pipeline")
|
|
|
|
o.Pipeline.Define(pipelineGroup.FlagSet())
|
2022-12-23 14:17:16 +00:00
|
|
|
}
|