feat(cli): allow showing schedules for multiple workspaces (#10596)

* coder list: adds information about next start / stop to available columns (not default)
* coder schedule: show now essentially coder list with a different set of columns
* Updates cli schedule unit tests to use new dbfake

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
This commit is contained in:
Cian Johnston
2023-11-10 13:51:49 +00:00
committed by GitHub
co-authored by Mathias Fredriksson
parent 177affbe4b
commit a4f1319108
13 changed files with 544 additions and 466 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ OPTIONS:
-c, --column string-array (default: workspace,template,status,healthy,last built,outdated,starts at,stops after)
Columns to display in table output. Available columns: workspace,
template, status, healthy, last built, outdated, starts at, stops
after, daily cost.
template, status, healthy, last built, outdated, starts at, starts
next, stops after, stops next, daily cost.
-o, --output string (default: table)
Output format. Available formats: table, json.
+1 -1
View File
@@ -8,7 +8,7 @@ USAGE:
SUBCOMMANDS:
override-stop Override the stop time of a currently running workspace
instance.
show Show workspace schedule
show Show workspace schedules
start Edit workspace start schedule
stop Edit workspace stop schedule
+17 -3
View File
@@ -1,15 +1,29 @@
coder v0.0.0-devel
USAGE:
coder schedule show <workspace-name>
coder schedule show [flags] <workspace | --search <query> | --all>
Show workspace schedule
Show workspace schedules
Shows the following information for the given workspace:
Shows the following information for the given workspace(s):
* The automatic start schedule
* The next scheduled start time
* The duration after which it will stop
* The next scheduled stop time
OPTIONS:
-a, --all bool
Specifies whether all workspaces will be listed or not.
-c, --column string-array (default: workspace,starts at,starts next,stops after,stops next)
Columns to display in table output. Available columns: workspace,
starts at, starts next, stops after, stops next.
-o, --output string (default: table)
Output format. Available formats: table, json.
--search string (default: owner:me)
Search for a workspace with a query.
———
Run `coder --help` for a list of global options.