From f733869142e6a8b46b67f600bc5dad1201859e01 Mon Sep 17 00:00:00 2001 From: Josh Hull Date: Sun, 25 Feb 2018 18:44:05 -0600 Subject: [PATCH] Include cron examples for schedule creation Signed-off-by: Josh Hull --- docs/cli-reference/ark_create_schedule.md | 18 ++++++++++++++++-- docs/cli-reference/ark_schedule_create.md | 18 ++++++++++++++++-- pkg/cmd/cli/schedule/create.go | 14 +++++++++++++- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/docs/cli-reference/ark_create_schedule.md b/docs/cli-reference/ark_create_schedule.md index 446543d88..901af2d5e 100644 --- a/docs/cli-reference/ark_create_schedule.md +++ b/docs/cli-reference/ark_create_schedule.md @@ -5,10 +5,24 @@ Create a schedule ### Synopsis -Create a schedule +The --schedule flag is required, in cron notation: + +| Character Position | Character Period | Acceptable Values | +| -------------------|:----------------:| -----------------:| +| 1 | Minute | 0-59,* | +| 2 | Hour | 0-23,* | +| 3 | Day of Month | 1-31,* | +| 4 | Month | 1-12,* | +| 5 | Day of Week | 0-7,* | ``` -ark create schedule NAME [flags] +ark create schedule NAME --schedule [flags] +``` + +### Examples + +``` +ark create schedule NAME --schedule="0 */6 * * *" ``` ### Options diff --git a/docs/cli-reference/ark_schedule_create.md b/docs/cli-reference/ark_schedule_create.md index ccf1727e1..28be6bf6a 100644 --- a/docs/cli-reference/ark_schedule_create.md +++ b/docs/cli-reference/ark_schedule_create.md @@ -5,10 +5,24 @@ Create a schedule ### Synopsis -Create a schedule +The --schedule flag is required, in cron notation: + +| Character Position | Character Period | Acceptable Values | +| -------------------|:----------------:| -----------------:| +| 1 | Minute | 0-59,* | +| 2 | Hour | 0-23,* | +| 3 | Day of Month | 1-31,* | +| 4 | Month | 1-12,* | +| 5 | Day of Week | 0-7,* | ``` -ark schedule create NAME [flags] +ark schedule create NAME --schedule [flags] +``` + +### Examples + +``` +ark create schedule NAME --schedule="0 */6 * * *" ``` ### Options diff --git a/pkg/cmd/cli/schedule/create.go b/pkg/cmd/cli/schedule/create.go index 3de434307..9d915a391 100644 --- a/pkg/cmd/cli/schedule/create.go +++ b/pkg/cmd/cli/schedule/create.go @@ -36,8 +36,20 @@ func NewCreateCommand(f client.Factory, use string) *cobra.Command { o := NewCreateOptions() c := &cobra.Command{ - Use: use + " NAME", + Use: use + " NAME --schedule", Short: "Create a schedule", + Long: `The --schedule flag is required, in cron notation: + +| Character Position | Character Period | Acceptable Values | +| -------------------|:----------------:| -----------------:| +| 1 | Minute | 0-59,* | +| 2 | Hour | 0-23,* | +| 3 | Day of Month | 1-31,* | +| 4 | Month | 1-12,* | +| 5 | Day of Week | 0-7,* |`, + + Example: `ark create schedule NAME --schedule="0 */6 * * *"`, + Run: func(c *cobra.Command, args []string) { cmd.CheckError(o.Validate(c, args)) cmd.CheckError(o.Complete(args))