Skip to content

Commit 6cdc521

Browse files
committed
add flag for --include-system-workers for ListWorker API
1 parent 569da5e commit 6cdc521

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

internal/temporalcli/commands.gen.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3616,10 +3616,11 @@ func NewTemporalWorkerDescribeCommand(cctx *CommandContext, parent *TemporalWork
36163616
}
36173617

36183618
type TemporalWorkerListCommand struct {
3619-
Parent *TemporalWorkerCommand
3620-
Command cobra.Command
3621-
Query string
3622-
Limit int
3619+
Parent *TemporalWorkerCommand
3620+
Command cobra.Command
3621+
Query string
3622+
Limit int
3623+
IncludeSystemWorkers bool
36233624
}
36243625

36253626
func NewTemporalWorkerListCommand(cctx *CommandContext, parent *TemporalWorkerCommand) *TemporalWorkerListCommand {
@@ -3636,6 +3637,7 @@ func NewTemporalWorkerListCommand(cctx *CommandContext, parent *TemporalWorkerCo
36363637
s.Command.Args = cobra.NoArgs
36373638
s.Command.Flags().StringVarP(&s.Query, "query", "q", "", "Content for an SQL-like `QUERY` List Filter.")
36383639
s.Command.Flags().IntVar(&s.Limit, "limit", 0, "Maximum number of workers to display.")
3640+
s.Command.Flags().BoolVar(&s.IncludeSystemWorkers, "include-system-workers", false, "Include system workers that are created implicitly by the server. By default, system workers are excluded.")
36393641
s.Command.Run = func(c *cobra.Command, args []string) {
36403642
if err := s.run(cctx, args); err != nil {
36413643
cctx.Options.Fail(err)

internal/temporalcli/commands.worker.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,10 @@ func (c *TemporalWorkerListCommand) run(cctx *CommandContext, args []string) err
138138

139139
for {
140140
req := &workflowservice.ListWorkersRequest{
141-
Namespace: c.Parent.Namespace,
142-
NextPageToken: token,
143-
Query: c.Query,
141+
Namespace: c.Parent.Namespace,
142+
NextPageToken: token,
143+
Query: c.Query,
144+
IncludeSystemWorkers: c.IncludeSystemWorkers,
144145
}
145146

146147
resp, err := svc.ListWorkers(cctx, req)

internal/temporalcli/commands.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,9 @@ commands:
14611461
- name: limit
14621462
type: int
14631463
description: Maximum number of workers to display.
1464+
- name: include-system-workers
1465+
type: bool
1466+
description: Include system workers that are created implicitly by the server. By default, system workers are excluded.
14641467

14651468
- name: temporal worker describe
14661469
summary: Returns information about a specific worker (EXPERIMENTAL)

0 commit comments

Comments
 (0)