mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): add provisioner list and provisioner jobs list (#16030)
This commit is contained in:
@@ -1,20 +1,15 @@
|
||||
package cli
|
||||
|
||||
import "github.com/coder/serpent"
|
||||
import (
|
||||
"github.com/coder/serpent"
|
||||
)
|
||||
|
||||
func (r *RootCmd) provisionerDaemons() *serpent.Command {
|
||||
cmd := &serpent.Command{
|
||||
Use: "provisioner",
|
||||
Short: "Manage provisioner daemons",
|
||||
Handler: func(inv *serpent.Invocation) error {
|
||||
return inv.Command.HelpHandler(inv)
|
||||
},
|
||||
Aliases: []string{"provisioners"},
|
||||
Children: []*serpent.Command{
|
||||
r.provisionerDaemonStart(),
|
||||
r.provisionerKeys(),
|
||||
},
|
||||
}
|
||||
cmd := r.RootCmd.Provisioners()
|
||||
cmd.AddSubcommands(
|
||||
r.provisionerDaemonStart(),
|
||||
r.provisionerKeys(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
|
||||
RawArgs: true,
|
||||
Hidden: true,
|
||||
Handler: func(inv *serpent.Invocation) error {
|
||||
agplcli.SlimUnsupported(inv.Stderr, "provisionerd start")
|
||||
agplcli.SlimUnsupported(inv.Stderr, "provisioner start")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ func (r *RootCmd) provisionerKeysList() *serpent.Command {
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Options = serpent.OptionSet{}
|
||||
orgContext.AttachOptions(cmd)
|
||||
formatter.AttachOptions(&cmd.Options)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ SUBCOMMANDS:
|
||||
features List Enterprise features
|
||||
groups Manage groups
|
||||
licenses Add, delete, and list licenses
|
||||
provisioner Manage provisioner daemons
|
||||
provisioner View and manage provisioner daemons and jobs
|
||||
server Start a Coder server
|
||||
|
||||
GLOBAL OPTIONS:
|
||||
|
||||
+3
-1
@@ -3,12 +3,14 @@ coder v0.0.0-devel
|
||||
USAGE:
|
||||
coder provisioner
|
||||
|
||||
Manage provisioner daemons
|
||||
View and manage provisioner daemons and jobs
|
||||
|
||||
Aliases: provisioners
|
||||
|
||||
SUBCOMMANDS:
|
||||
jobs View and manage provisioner jobs
|
||||
keys Manage provisioner keys
|
||||
list List provisioner daemons in an organization
|
||||
start Run a provisioner daemon
|
||||
|
||||
———
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
coder v0.0.0-devel
|
||||
|
||||
USAGE:
|
||||
coder provisioner jobs
|
||||
|
||||
View and manage provisioner jobs
|
||||
|
||||
Aliases: job
|
||||
|
||||
SUBCOMMANDS:
|
||||
list List provisioner jobs
|
||||
|
||||
———
|
||||
Run `coder --help` for a list of global options.
|
||||
@@ -0,0 +1,27 @@
|
||||
coder v0.0.0-devel
|
||||
|
||||
USAGE:
|
||||
coder provisioner jobs list [flags]
|
||||
|
||||
List provisioner jobs
|
||||
|
||||
Aliases: ls
|
||||
|
||||
OPTIONS:
|
||||
-O, --org string, $CODER_ORGANIZATION
|
||||
Select which organization (uuid or name) to use.
|
||||
|
||||
-c, --column [id|created at|started at|completed at|canceled at|error|error code|status|worker id|file id|tags|queue position|queue size|organization id|template version id|workspace build id|type|available workers|organization|queue] (default: created at,id,organization,status,type,queue,tags)
|
||||
Columns to display in table output.
|
||||
|
||||
-l, --limit int, $CODER_PROVISIONER_JOB_LIST_LIMIT (default: 50)
|
||||
Limit the number of jobs returned.
|
||||
|
||||
-o, --output table|json (default: table)
|
||||
Output format.
|
||||
|
||||
-s, --status [pending|running|succeeded|canceling|canceled|failed|unknown], $CODER_PROVISIONER_JOB_LIST_STATUS
|
||||
Filter by job status.
|
||||
|
||||
———
|
||||
Run `coder --help` for a list of global options.
|
||||
@@ -11,5 +11,11 @@ OPTIONS:
|
||||
-O, --org string, $CODER_ORGANIZATION
|
||||
Select which organization (uuid or name) to use.
|
||||
|
||||
-c, --column [created at|name|tags] (default: created at,name,tags)
|
||||
Columns to display in table output.
|
||||
|
||||
-o, --output table|json (default: table)
|
||||
Output format.
|
||||
|
||||
———
|
||||
Run `coder --help` for a list of global options.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
coder v0.0.0-devel
|
||||
|
||||
USAGE:
|
||||
coder provisioner list [flags]
|
||||
|
||||
List provisioner daemons in an organization
|
||||
|
||||
Aliases: ls
|
||||
|
||||
OPTIONS:
|
||||
-O, --org string, $CODER_ORGANIZATION
|
||||
Select which organization (uuid or name) to use.
|
||||
|
||||
-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|key name|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,key name,created at,last seen at,version,tags)
|
||||
Columns to display in table output.
|
||||
|
||||
-o, --output table|json (default: table)
|
||||
Output format.
|
||||
|
||||
———
|
||||
Run `coder --help` for a list of global options.
|
||||
Reference in New Issue
Block a user