-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathcommands.gen.go
More file actions
5083 lines (4732 loc) · 341 KB
/
Copy pathcommands.gen.go
File metadata and controls
5083 lines (4732 loc) · 341 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated. DO NOT EDIT.
package temporalcli
import (
"github.com/mattn/go-isatty"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/temporalio/cli/cliext"
"os"
)
var hasHighlighting = isatty.IsTerminal(os.Stdout.Fd())
type OverlapPolicyOptions struct {
OverlapPolicy cliext.FlagStringEnum
FlagSet *pflag.FlagSet
}
func (v *OverlapPolicyOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
v.OverlapPolicy = cliext.NewFlagStringEnum([]string{"Skip", "BufferOne", "BufferAll", "CancelOther", "TerminateOther", "AllowAll"}, "Skip")
f.Var(&v.OverlapPolicy, "overlap-policy", "Policy for handling overlapping Workflow Executions. Accepted values: Skip, BufferOne, BufferAll, CancelOther, TerminateOther, AllowAll.")
}
type ScheduleIdOptions struct {
ScheduleId string
FlagSet *pflag.FlagSet
}
func (v *ScheduleIdOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.ScheduleId, "schedule-id", "s", "", "Schedule ID. Required.")
_ = cobra.MarkFlagRequired(f, "schedule-id")
}
type ScheduleConfigurationOptions struct {
Calendar []string
CatchupWindow cliext.FlagDuration
Cron []string
EndTime cliext.FlagTimestamp
Interval []string
Jitter cliext.FlagDuration
Notes string
Paused bool
PauseOnFailure bool
RemainingActions int
StartTime cliext.FlagTimestamp
TimeZone string
FlagSet *pflag.FlagSet
}
func (v *ScheduleConfigurationOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringArrayVar(&v.Calendar, "calendar", nil, "Calendar specification in JSON. For example: `{\"dayOfWeek\":\"Fri\",\"hour\":\"17\",\"minute\":\"5\"}`.")
v.CatchupWindow = 0
f.Var(&v.CatchupWindow, "catchup-window", "Maximum catch-up time for when the Service is unavailable.")
f.StringArrayVar(&v.Cron, "cron", nil, "Calendar specification in cron string format. For example: `\"30 12 * * Fri\"`.")
f.Var(&v.EndTime, "end-time", "Schedule end time.")
f.StringArrayVar(&v.Interval, "interval", nil, "Interval duration. For example, 90m, or 60m/15m to include phase offset.")
v.Jitter = 0
f.Var(&v.Jitter, "jitter", "Max difference in time from the specification. Vary the start time randomly within this amount.")
f.StringVar(&v.Notes, "notes", "", "Initial notes field value.")
f.BoolVar(&v.Paused, "paused", false, "Pause the Schedule immediately on creation.")
f.BoolVar(&v.PauseOnFailure, "pause-on-failure", false, "Pause schedule after Workflow failures.")
f.IntVar(&v.RemainingActions, "remaining-actions", 0, "Total allowed actions. Default is zero (unlimited).")
f.Var(&v.StartTime, "start-time", "Schedule start time.")
f.StringVar(&v.TimeZone, "time-zone", "", "Interpret calendar specs with the `TZ` time zone. For a list of time zones, see: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.")
}
type ScheduleCreateOnlyOptions struct {
ScheduleSearchAttribute []string
ScheduleMemo []string
FlagSet *pflag.FlagSet
}
func (v *ScheduleCreateOnlyOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringArrayVar(&v.ScheduleSearchAttribute, "schedule-search-attribute", nil, "Set schedule Search Attributes using `KEY=\"VALUE` pairs. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={\"your\": \"value\"}'. Can be passed multiple times.")
f.StringArrayVar(&v.ScheduleMemo, "schedule-memo", nil, "Set schedule memo using `KEY=\"VALUE` pairs. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={\"your\": \"value\"}'. Can be passed multiple times.")
}
type WorkflowReferenceOptions struct {
WorkflowId string
RunId string
FlagSet *pflag.FlagSet
}
func (v *WorkflowReferenceOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.WorkflowId, "workflow-id", "w", "", "Workflow ID. Required.")
_ = cobra.MarkFlagRequired(f, "workflow-id")
f.StringVarP(&v.RunId, "run-id", "r", "", "Run ID.")
}
type DeploymentNameOptions struct {
Name string
FlagSet *pflag.FlagSet
}
func (v *DeploymentNameOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.Name, "name", "d", "", "Name for a Worker Deployment. Required.")
_ = cobra.MarkFlagRequired(f, "name")
}
type DeploymentVersionOptions struct {
DeploymentName string
BuildId string
FlagSet *pflag.FlagSet
}
func (v *DeploymentVersionOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.DeploymentName, "deployment-name", "", "Name of the Worker Deployment. Required.")
_ = cobra.MarkFlagRequired(f, "deployment-name")
f.StringVar(&v.BuildId, "build-id", "", "Build ID of the Worker Deployment Version. Required.")
_ = cobra.MarkFlagRequired(f, "build-id")
}
type DeploymentVersionOrUnversionedOptions struct {
DeploymentName string
BuildId string
Unversioned bool
FlagSet *pflag.FlagSet
}
func (v *DeploymentVersionOrUnversionedOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.DeploymentName, "deployment-name", "", "Name of the Worker Deployment. Required.")
_ = cobra.MarkFlagRequired(f, "deployment-name")
f.StringVar(&v.BuildId, "build-id", "", "Build ID of the Worker Deployment Version. Required unless --unversioned is specified.")
f.BoolVar(&v.Unversioned, "unversioned", false, "Set unversioned workers as the target version. Cannot be used with --build-id.")
}
type DeploymentReferenceOptions struct {
SeriesName string
BuildId string
FlagSet *pflag.FlagSet
}
func (v *DeploymentReferenceOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.SeriesName, "series-name", "", "Series Name for a Worker Deployment. Required.")
_ = cobra.MarkFlagRequired(f, "series-name")
f.StringVar(&v.BuildId, "build-id", "", "Build ID for a Worker Deployment. Required.")
_ = cobra.MarkFlagRequired(f, "build-id")
}
type SingleActivityOrBatchOptions struct {
WorkflowId string
Query string
RunId string
Reason string
Yes bool
Rps float32
Headers []string
FlagSet *pflag.FlagSet
}
func (v *SingleActivityOrBatchOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.WorkflowId, "workflow-id", "w", "", "Workflow ID. You must set either --workflow-id or --query.")
f.StringVarP(&v.Query, "query", "q", "", "Content for an SQL-like `QUERY` List Filter. You must set either --workflow-id or --query. Note: Using --query for batch activity operations is an experimental feature and may change in the future.")
f.StringVarP(&v.RunId, "run-id", "r", "", "Run ID. Only use with --workflow-id. Cannot use with --query.")
f.StringVar(&v.Reason, "reason", "", "Reason for batch operation. Only use with --query. Defaults to user name.")
f.BoolVarP(&v.Yes, "yes", "y", false, "Don't prompt to confirm signaling. Only allowed when --query is present.")
f.Float32Var(&v.Rps, "rps", 0, "Limit batch's requests per second. Only allowed if query is present.")
f.StringArrayVar(&v.Headers, "headers", nil, "Temporal workflow headers in 'KEY=VALUE' format. Keys must be identifiers, and values must be JSON values. May be passed multiple times to set multiple Temporal headers. Note: These are workflow headers, not gRPC headers.")
}
type SingleWorkflowOrBatchOptions struct {
WorkflowId string
Query string
RunId string
Reason string
Yes bool
Rps float32
Headers []string
FlagSet *pflag.FlagSet
}
func (v *SingleWorkflowOrBatchOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.WorkflowId, "workflow-id", "w", "", "Workflow ID. You must set either --workflow-id or --query.")
f.StringVarP(&v.Query, "query", "q", "", "Content for an SQL-like `QUERY` List Filter. You must set either --workflow-id or --query.")
f.StringVarP(&v.RunId, "run-id", "r", "", "Run ID. Only use with --workflow-id. Cannot use with --query.")
f.StringVar(&v.Reason, "reason", "", "Reason for batch operation. Only use with --query. Defaults to user name.")
f.BoolVarP(&v.Yes, "yes", "y", false, "Don't prompt to confirm signaling. Only allowed when --query is present.")
f.Float32Var(&v.Rps, "rps", 0, "Limit batch's requests per second. Only allowed if query is present.")
f.StringArrayVar(&v.Headers, "headers", nil, "Temporal workflow headers in 'KEY=VALUE' format. Keys must be identifiers, and values must be JSON values. May be passed multiple times to set multiple Temporal headers. Note: These are workflow headers, not gRPC headers.")
}
type SharedWorkflowStartOptions struct {
WorkflowId string
Type string
TaskQueue string
RunTimeout cliext.FlagDuration
ExecutionTimeout cliext.FlagDuration
TaskTimeout cliext.FlagDuration
SearchAttribute []string
Headers []string
Memo []string
StaticSummary string
StaticDetails string
PriorityKey int
FairnessKey string
FairnessWeight float32
FlagSet *pflag.FlagSet
}
func (v *SharedWorkflowStartOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.WorkflowId, "workflow-id", "w", "", "Workflow ID. If not supplied, the Service generates a unique ID.")
f.StringVar(&v.Type, "type", "", "Workflow Type name. Required. Aliased as \"--name\".")
_ = cobra.MarkFlagRequired(f, "type")
f.StringVarP(&v.TaskQueue, "task-queue", "t", "", "Workflow Task queue. Required.")
_ = cobra.MarkFlagRequired(f, "task-queue")
v.RunTimeout = 0
f.Var(&v.RunTimeout, "run-timeout", "Fail a Workflow Run if it lasts longer than `DURATION`.")
v.ExecutionTimeout = 0
f.Var(&v.ExecutionTimeout, "execution-timeout", "Fail a WorkflowExecution if it lasts longer than `DURATION`. This time-out includes retries and ContinueAsNew tasks.")
v.TaskTimeout = cliext.MustParseFlagDuration("10s")
f.Var(&v.TaskTimeout, "task-timeout", "Fail a Workflow Task if it lasts longer than `DURATION`. This is the Start-to-close timeout for a Workflow Task.")
f.StringArrayVar(&v.SearchAttribute, "search-attribute", nil, "Search Attribute in `KEY=VALUE` format. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={\"your\": \"value\"}'. Can be passed multiple times.")
f.StringArrayVar(&v.Headers, "headers", nil, "Temporal workflow headers in 'KEY=VALUE' format. Keys must be identifiers, and values must be JSON values. May be passed multiple times to set multiple Temporal headers. Note: These are workflow headers, not gRPC headers.")
f.StringArrayVar(&v.Memo, "memo", nil, "Memo using 'KEY=\"VALUE\"' pairs. Use JSON values.")
f.StringVar(&v.StaticSummary, "static-summary", "", "Static Workflow summary for human consumption in UIs. Uses Temporal Markdown formatting, should be a single line. EXPERIMENTAL.")
f.StringVar(&v.StaticDetails, "static-details", "", "Static Workflow details for human consumption in UIs. Uses Temporal Markdown formatting, may be multiple lines. EXPERIMENTAL.")
f.IntVar(&v.PriorityKey, "priority-key", 0, "Priority key (1-5, lower numbers = higher priority). Tasks in a queue should be processed in close-to-priority-order. Default is 3 when not specified.")
f.StringVar(&v.FairnessKey, "fairness-key", "", "Fairness key (max 64 bytes) for proportional task dispatch. Tasks with same key share capacity based on their weight.")
f.Float32Var(&v.FairnessWeight, "fairness-weight", 0, "Weight [0.001-1000] for this fairness key. Keys are dispatched proportionally to their weights.")
}
type WorkflowStartOptions struct {
Cron string
FailExisting bool
StartDelay cliext.FlagDuration
IdReusePolicy cliext.FlagStringEnum
IdConflictPolicy cliext.FlagStringEnum
FlagSet *pflag.FlagSet
}
func (v *WorkflowStartOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.Cron, "cron", "", "Cron schedule for the Workflow.")
_ = f.MarkDeprecated("cron", "Use Schedules instead.")
f.BoolVar(&v.FailExisting, "fail-existing", false, "Fail if the Workflow already exists.")
v.StartDelay = 0
f.Var(&v.StartDelay, "start-delay", "Delay before starting the Workflow Execution. Can't be used with cron schedules. If the Workflow receives a signal or update prior to this time, the Workflow Execution starts immediately.")
v.IdReusePolicy = cliext.NewFlagStringEnum([]string{"AllowDuplicate", "AllowDuplicateFailedOnly", "RejectDuplicate", "TerminateIfRunning"}, "")
f.Var(&v.IdReusePolicy, "id-reuse-policy", "Re-use policy for the Workflow ID in new Workflow Executions. Accepted values: AllowDuplicate, AllowDuplicateFailedOnly, RejectDuplicate, TerminateIfRunning.")
v.IdConflictPolicy = cliext.NewFlagStringEnum([]string{"Fail", "UseExisting", "TerminateExisting"}, "")
f.Var(&v.IdConflictPolicy, "id-conflict-policy", "Determines how to resolve a conflict when spawning a new Workflow Execution with a particular Workflow Id used by an existing Open Workflow Execution. Accepted values: Fail, UseExisting, TerminateExisting.")
}
type PayloadInputOptions struct {
Input []string
InputFile []string
InputMeta []string
InputBase64 bool
FlagSet *pflag.FlagSet
}
func (v *PayloadInputOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringArrayVarP(&v.Input, "input", "i", nil, "Input value. Use JSON content or set --input-meta to override. Can't be combined with --input-file. Can be passed multiple times to pass multiple arguments.")
f.StringArrayVar(&v.InputFile, "input-file", nil, "A path or paths for input file(s). Use JSON content or set --input-meta to override. Can't be combined with --input. Can be passed multiple times to pass multiple arguments.")
f.StringArrayVar(&v.InputMeta, "input-meta", nil, "Input payload metadata as a `KEY=VALUE` pair. When the KEY is \"encoding\", this overrides the default (\"json/plain\"). Can be passed multiple times. Repeated metadata keys are applied to the corresponding inputs in the provided order.")
f.BoolVar(&v.InputBase64, "input-base64", false, "Assume inputs are base64-encoded and attempt to decode them.")
}
type UpdateStartingOptions struct {
Name string
FirstExecutionRunId string
WorkflowId string
UpdateId string
RunId string
Headers []string
FlagSet *pflag.FlagSet
}
func (v *UpdateStartingOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.Name, "name", "", "Handler method name. Required. Aliased as \"--type\".")
_ = cobra.MarkFlagRequired(f, "name")
f.StringVar(&v.FirstExecutionRunId, "first-execution-run-id", "", "Parent Run ID. The update is sent to the last Workflow Execution in the chain started with this Run ID.")
f.StringVarP(&v.WorkflowId, "workflow-id", "w", "", "Workflow ID. Required.")
_ = cobra.MarkFlagRequired(f, "workflow-id")
f.StringVar(&v.UpdateId, "update-id", "", "Update ID. If unset, defaults to a UUID.")
f.StringVarP(&v.RunId, "run-id", "r", "", "Run ID. If unset, looks for an Update against the currently-running Workflow Execution.")
f.StringArrayVar(&v.Headers, "headers", nil, "Temporal workflow headers in 'KEY=VALUE' format. Keys must be identifiers, and values must be JSON values. May be passed multiple times to set multiple Temporal headers. Note: These are workflow headers, not gRPC headers.")
}
type UpdateTargetingOptions struct {
WorkflowId string
UpdateId string
RunId string
FlagSet *pflag.FlagSet
}
func (v *UpdateTargetingOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.WorkflowId, "workflow-id", "w", "", "Workflow ID. Required.")
_ = cobra.MarkFlagRequired(f, "workflow-id")
f.StringVar(&v.UpdateId, "update-id", "", "Update ID. Must be unique per Workflow Execution. Required.")
_ = cobra.MarkFlagRequired(f, "update-id")
f.StringVarP(&v.RunId, "run-id", "r", "", "Run ID. If unset, updates the currently-running Workflow Execution.")
}
type NexusEndpointIdentityOptions struct {
Name string
FlagSet *pflag.FlagSet
}
func (v *NexusEndpointIdentityOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.Name, "name", "", "Endpoint name. Required.")
_ = cobra.MarkFlagRequired(f, "name")
}
type NexusEndpointConfigOptions struct {
Description string
DescriptionFile string
TargetNamespace string
TargetTaskQueue string
TargetUrl string
FlagSet *pflag.FlagSet
}
func (v *NexusEndpointConfigOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.Description, "description", "", "Nexus Endpoint description. You may use Markdown formatting in the Nexus Endpoint description.")
f.StringVar(&v.DescriptionFile, "description-file", "", "Path to the Nexus Endpoint description file. The contents of the description file may use Markdown formatting.")
f.StringVar(&v.TargetNamespace, "target-namespace", "", "Namespace where a handler Worker polls for Nexus tasks.")
f.StringVar(&v.TargetTaskQueue, "target-task-queue", "", "Task Queue that a handler Worker polls for Nexus tasks.")
f.StringVar(&v.TargetUrl, "target-url", "", "An external Nexus Endpoint that receives forwarded Nexus requests. May be used as an alternative to `--target-namespace` and `--target-task-queue`. EXPERIMENTAL.")
}
type NexusOperationReferenceOptions struct {
OperationId string
RunId string
FlagSet *pflag.FlagSet
}
func (v *NexusOperationReferenceOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.OperationId, "operation-id", "", "Nexus Operation ID. Required.")
_ = cobra.MarkFlagRequired(f, "operation-id")
f.StringVarP(&v.RunId, "run-id", "r", "", "Run ID of the Nexus Operation.")
}
type NexusOperationStartOptions struct {
Endpoint string
Service string
Operation string
OperationId string
ScheduleToCloseTimeout cliext.FlagDuration
ScheduleToStartTimeout cliext.FlagDuration
StartToCloseTimeout cliext.FlagDuration
IdConflictPolicy cliext.FlagStringEnum
IdReusePolicy cliext.FlagStringEnum
SearchAttribute []string
StaticSummary string
FlagSet *pflag.FlagSet
}
func (v *NexusOperationStartOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVar(&v.Endpoint, "endpoint", "", "Nexus Endpoint name. Required.")
_ = cobra.MarkFlagRequired(f, "endpoint")
f.StringVar(&v.Service, "service", "", "Nexus Service name. Required.")
_ = cobra.MarkFlagRequired(f, "service")
f.StringVar(&v.Operation, "operation", "", "Nexus Operation name. Required.")
_ = cobra.MarkFlagRequired(f, "operation")
f.StringVar(&v.OperationId, "operation-id", "", "Nexus Operation ID. Required.")
_ = cobra.MarkFlagRequired(f, "operation-id")
v.ScheduleToCloseTimeout = 0
f.Var(&v.ScheduleToCloseTimeout, "schedule-to-close-timeout", "Total time the operation is allowed to run.")
v.ScheduleToStartTimeout = 0
f.Var(&v.ScheduleToStartTimeout, "schedule-to-start-timeout", "Maximum time to wait for an operation to be started (or completed synchronously) by a handler.")
v.StartToCloseTimeout = 0
f.Var(&v.StartToCloseTimeout, "start-to-close-timeout", "Maximum time to wait for an asynchronous operation to complete after it has been started.")
v.IdConflictPolicy = cliext.NewFlagStringEnum([]string{"Fail", "UseExisting", "TerminateExisting"}, "")
f.Var(&v.IdConflictPolicy, "id-conflict-policy", "Policy for handling an Operation ID conflict with a running operation. Accepted values: Fail, UseExisting, TerminateExisting.")
v.IdReusePolicy = cliext.NewFlagStringEnum([]string{"AllowDuplicate", "RejectDuplicate"}, "")
f.Var(&v.IdReusePolicy, "id-reuse-policy", "Policy for re-using an Operation ID from a previously closed operation. Accepted values: AllowDuplicate, RejectDuplicate.")
f.StringArrayVar(&v.SearchAttribute, "search-attribute", nil, "Search Attribute in `KEY=VALUE` format. Keys must be identifiers, and values must be JSON values. For example: 'YourKey={\"your\": \"value\"}'. Can be passed multiple times.")
f.StringVar(&v.StaticSummary, "static-summary", "", "Static summary for the Nexus Operation for human consumption in UIs. Uses Temporal Markdown formatting, should be a single line. EXPERIMENTAL.")
}
type QueryModifiersOptions struct {
RejectCondition cliext.FlagStringEnum
Headers []string
FlagSet *pflag.FlagSet
}
func (v *QueryModifiersOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
v.RejectCondition = cliext.NewFlagStringEnum([]string{"not_open", "not_completed_cleanly"}, "")
f.Var(&v.RejectCondition, "reject-condition", "Optional flag for rejecting Queries based on Workflow state. Accepted values: not_open, not_completed_cleanly.")
f.StringArrayVar(&v.Headers, "headers", nil, "Temporal workflow headers in 'KEY=VALUE' format. Keys must be identifiers, and values must be JSON values. May be passed multiple times to set multiple Temporal headers. Note: These are workflow headers, not gRPC headers.")
}
type WorkflowUpdateOptionsOptions struct {
VersioningOverrideBehavior cliext.FlagStringEnum
VersioningOverrideDeploymentName string
VersioningOverrideBuildId string
FlagSet *pflag.FlagSet
}
func (v *WorkflowUpdateOptionsOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
v.VersioningOverrideBehavior = cliext.NewFlagStringEnum([]string{"pinned", "one_time", "auto_upgrade"}, "")
f.Var(&v.VersioningOverrideBehavior, "versioning-override-behavior", "Override the versioning behavior of a Workflow. Accepted values: pinned, one_time, auto_upgrade. Required.")
_ = cobra.MarkFlagRequired(f, "versioning-override-behavior")
f.StringVar(&v.VersioningOverrideDeploymentName, "versioning-override-deployment-name", "", "When overriding to a `pinned` or `one_time` behavior, specifies the Deployment Name of the version to target.")
f.StringVar(&v.VersioningOverrideBuildId, "versioning-override-build-id", "", "When overriding to a `pinned` or `one_time` behavior, specifies the Build ID of the version to target.")
}
type ActivityReferenceOptions struct {
ActivityId string
RunId string
FlagSet *pflag.FlagSet
}
func (v *ActivityReferenceOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.ActivityId, "activity-id", "a", "", "Activity ID. Required.")
_ = cobra.MarkFlagRequired(f, "activity-id")
f.StringVarP(&v.RunId, "run-id", "r", "", "Activity Run ID. If not set, targets the latest run.")
}
type ActivityStartOptions struct {
ActivityId string
Type string
TaskQueue string
ScheduleToCloseTimeout cliext.FlagDuration
ScheduleToStartTimeout cliext.FlagDuration
StartToCloseTimeout cliext.FlagDuration
HeartbeatTimeout cliext.FlagDuration
RetryInitialInterval cliext.FlagDuration
RetryMaximumInterval cliext.FlagDuration
RetryBackoffCoefficient float32
RetryMaximumAttempts int
IdReusePolicy cliext.FlagStringEnum
IdConflictPolicy cliext.FlagStringEnum
SearchAttribute []string
Headers []string
StaticSummary string
StaticDetails string
PriorityKey int
FairnessKey string
FairnessWeight float32
FlagSet *pflag.FlagSet
}
func (v *ActivityStartOptions) BuildFlags(f *pflag.FlagSet) {
v.FlagSet = f
f.StringVarP(&v.ActivityId, "activity-id", "a", "", "Activity ID. Required.")
_ = cobra.MarkFlagRequired(f, "activity-id")
f.StringVar(&v.Type, "type", "", "Activity Type name. Required.")
_ = cobra.MarkFlagRequired(f, "type")
f.StringVarP(&v.TaskQueue, "task-queue", "t", "", "Activity task queue. Required.")
_ = cobra.MarkFlagRequired(f, "task-queue")
v.ScheduleToCloseTimeout = 0
f.Var(&v.ScheduleToCloseTimeout, "schedule-to-close-timeout", "Maximum time for the Activity Execution, including all retries. Either this or \"start-to-close-timeout\" is required.")
v.ScheduleToStartTimeout = 0
f.Var(&v.ScheduleToStartTimeout, "schedule-to-start-timeout", "Maximum time an Activity task can stay in a task queue before a Worker picks it up. On expiry it results in a non-retryable failure and no further attempts are scheduled.")
v.StartToCloseTimeout = 0
f.Var(&v.StartToCloseTimeout, "start-to-close-timeout", "Maximum time for a single Activity attempt. On expiry a new attempt may be scheduled if permitted by the retry policy and schedule-to-close timeout. Either this or \"schedule-to-close-timeout\" is required.")
v.HeartbeatTimeout = 0
f.Var(&v.HeartbeatTimeout, "heartbeat-timeout", "Maximum time between successful Worker heartbeats. On expiry the current activity attempt fails.")
v.RetryInitialInterval = 0
f.Var(&v.RetryInitialInterval, "retry-initial-interval", "Interval of the first retry. If \"retry-backoff-coefficient\" is 1.0, it is used for all retries.")
v.RetryMaximumInterval = 0
f.Var(&v.RetryMaximumInterval, "retry-maximum-interval", "Maximum interval between retries.")
f.Float32Var(&v.RetryBackoffCoefficient, "retry-backoff-coefficient", 0, "Coefficient for calculating the next retry interval. Must be 1 or larger.")
f.IntVar(&v.RetryMaximumAttempts, "retry-maximum-attempts", 0, "Maximum number of attempts. Setting to 1 disables retries. Setting to 0 means unlimited attempts.")
v.IdReusePolicy = cliext.NewFlagStringEnum([]string{"AllowDuplicate", "AllowDuplicateFailedOnly", "RejectDuplicate"}, "")
f.Var(&v.IdReusePolicy, "id-reuse-policy", "Policy for handling activity start when an Activity with the same ID exists and has completed. Accepted values: AllowDuplicate, AllowDuplicateFailedOnly, RejectDuplicate.")
v.IdConflictPolicy = cliext.NewFlagStringEnum([]string{"Fail", "UseExisting"}, "")
f.Var(&v.IdConflictPolicy, "id-conflict-policy", "Policy for handling activity start when an Activity with the same ID is currently running. Accepted values: Fail, UseExisting.")
f.StringArrayVar(&v.SearchAttribute, "search-attribute", nil, "Search Attribute in `KEY=VALUE` format. Keys must be identifiers, and values must be JSON values. Can be passed multiple times. See https://docs.temporal.io/visibility.")
f.StringArrayVar(&v.Headers, "headers", nil, "Temporal activity headers in 'KEY=VALUE' format. Keys must be identifiers, and values must be JSON values. May be passed multiple times.")
f.StringVar(&v.StaticSummary, "static-summary", "", "Static Activity summary for human consumption in UIs. Uses standard Markdown formatting excluding images, HTML, and script tags. EXPERIMENTAL.")
f.StringVar(&v.StaticDetails, "static-details", "", "Static Activity details for human consumption in UIs. Uses standard Markdown formatting excluding images, HTML, and script tags. EXPERIMENTAL.")
f.IntVar(&v.PriorityKey, "priority-key", 0, "Priority key (1-5, lower = higher priority). Default is 3 when not specified.")
f.StringVar(&v.FairnessKey, "fairness-key", "", "Fairness key (max 64 bytes) for proportional task dispatch.")
f.Float32Var(&v.FairnessWeight, "fairness-weight", 0, "Weight [0.001-1000] for this fairness key.")
}
type TemporalCommand struct {
Command cobra.Command
cliext.CommonOptions
}
func NewTemporalCommand(cctx *CommandContext) *TemporalCommand {
var s TemporalCommand
s.Command.Use = "temporal"
s.Command.Short = "Temporal command-line interface and development server"
if hasHighlighting {
s.Command.Long = "The Temporal CLI manages, monitors, and debugs Temporal apps. It lets you run\na local Temporal Service, start Workflow Executions, pass messages to running\nWorkflows, inspect state, and more.\n\n* Start a local development service:\n \x1b[1mtemporal server start-dev\x1b[0m\n* View help: pass \x1b[1m--help\x1b[0m to any command:\n \x1b[1mtemporal activity complete --help\x1b[0m"
} else {
s.Command.Long = "The Temporal CLI manages, monitors, and debugs Temporal apps. It lets you run\na local Temporal Service, start Workflow Executions, pass messages to running\nWorkflows, inspect state, and more.\n\n* Start a local development service:\n `temporal server start-dev`\n* View help: pass `--help` to any command:\n `temporal activity complete --help`"
}
s.Command.Args = cobra.NoArgs
s.Command.AddCommand(&NewTemporalActivityCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalBatchCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalConfigCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalEnvCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalNexusCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalOperatorCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalScheduleCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalServerCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalTaskQueueCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalWorkerCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalWorkflowCommand(cctx, &s).Command)
s.CommonOptions.BuildFlags(s.Command.PersistentFlags())
s.initCommand(cctx)
return &s
}
type TemporalActivityCommand struct {
Parent *TemporalCommand
Command cobra.Command
cliext.ClientOptions
}
func NewTemporalActivityCommand(cctx *CommandContext, parent *TemporalCommand) *TemporalActivityCommand {
var s TemporalActivityCommand
s.Parent = parent
s.Command.Use = "activity"
s.Command.Short = "Operate on Activity Executions"
s.Command.Long = "Perform operations on Activity Executions."
s.Command.Args = cobra.NoArgs
s.Command.AddCommand(&NewTemporalActivityCancelCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityCompleteCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityCountCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityDescribeCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityExecuteCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityFailCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityListCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityPauseCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityResetCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityResultCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityStartCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityTerminateCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityUnpauseCommand(cctx, &s).Command)
s.Command.AddCommand(&NewTemporalActivityUpdateOptionsCommand(cctx, &s).Command)
s.ClientOptions.BuildFlags(s.Command.PersistentFlags())
return &s
}
type TemporalActivityCancelCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityReferenceOptions
Reason string
}
func NewTemporalActivityCancelCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityCancelCommand {
var s TemporalActivityCancelCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "cancel [flags]"
s.Command.Short = "Request cancellation of a Standalone Activity (Experimental)"
if hasHighlighting {
s.Command.Long = "Request cancellation of a Standalone Activity.\n\n\x1b[1mtemporal activity cancel \\\n --activity-id YourActivityId\x1b[0m\n\nRequesting cancellation transitions the Activity's run state\nto CancelRequested. If the Activity is heartbeating, a\ncancellation error will be raised when the next heartbeat\nresponse is received; if the Activity allows this error to\npropagate, the Activity transitions to canceled status."
} else {
s.Command.Long = "Request cancellation of a Standalone Activity.\n\n```\ntemporal activity cancel \\\n --activity-id YourActivityId\n```\n\nRequesting cancellation transitions the Activity's run state\nto CancelRequested. If the Activity is heartbeating, a\ncancellation error will be raised when the next heartbeat\nresponse is received; if the Activity allows this error to\npropagate, the Activity transitions to canceled status."
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVar(&s.Reason, "reason", "", "Reason for cancellation.")
s.ActivityReferenceOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityCompleteCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityId string
WorkflowId string
RunId string
Result string
}
func NewTemporalActivityCompleteCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityCompleteCommand {
var s TemporalActivityCompleteCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "complete [flags]"
s.Command.Short = "Mark an activity as completed successfully with a result"
if hasHighlighting {
s.Command.Long = "Complete an Activity, marking it as successfully finished. Specify the\nActivity ID and include a JSON result for the returned value:\n\n\x1b[1mtemporal activity complete \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId \\\n --result '{\"YourResultKey\": \"YourResultVal\"}'\x1b[0m"
} else {
s.Command.Long = "Complete an Activity, marking it as successfully finished. Specify the\nActivity ID and include a JSON result for the returned value:\n\n```\ntemporal activity complete \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId \\\n --result '{\"YourResultKey\": \"YourResultVal\"}'\n```"
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "Activity ID. This may be the ID of an Activity invoked by a Workflow, or of a Standalone Activity. Required.")
_ = cobra.MarkFlagRequired(s.Command.Flags(), "activity-id")
s.Command.Flags().StringVarP(&s.WorkflowId, "workflow-id", "w", "", "Workflow ID. Required for workflow Activities. Omit for Standalone Activities.")
s.Command.Flags().StringVarP(&s.RunId, "run-id", "r", "", "Run ID. For workflow Activities (when --workflow-id is provided), this is the Workflow Run ID. For Standalone Activities, this is the Activity Run ID.")
s.Command.Flags().StringVar(&s.Result, "result", "", "Result `JSON` to return. Required.")
_ = cobra.MarkFlagRequired(s.Command.Flags(), "result")
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityCountCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
Query string
}
func NewTemporalActivityCountCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityCountCommand {
var s TemporalActivityCountCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "count [flags]"
s.Command.Short = "Count Standalone Activities matching a query (Experimental)"
if hasHighlighting {
s.Command.Long = "Return a count of Standalone Activities. Use \x1b[1m--query\x1b[0m to filter\nthe activities to be counted.\n\n\x1b[1mtemporal activity count \\\n --query 'ActivityType=\"YourActivity\"'\x1b[0m\n\nVisit https://docs.temporal.io/visibility to read more about\nSearch Attributes and queries."
} else {
s.Command.Long = "Return a count of Standalone Activities. Use `--query` to filter\nthe activities to be counted.\n\n```\ntemporal activity count \\\n --query 'ActivityType=\"YourActivity\"'\n```\n\nVisit https://docs.temporal.io/visibility to read more about\nSearch Attributes and queries."
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.Query, "query", "q", "", "Query to filter Activity Executions to count.")
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityDescribeCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityReferenceOptions
Raw bool
}
func NewTemporalActivityDescribeCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityDescribeCommand {
var s TemporalActivityDescribeCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "describe [flags]"
s.Command.Short = "Show detailed info for a Standalone Activity (Experimental)"
if hasHighlighting {
s.Command.Long = "Display information about a Standalone Activity.\n\n\x1b[1mtemporal activity describe \\\n --activity-id YourActivityId\x1b[0m"
} else {
s.Command.Long = "Display information about a Standalone Activity.\n\n```\ntemporal activity describe \\\n --activity-id YourActivityId\n```"
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().BoolVar(&s.Raw, "raw", false, "Print properties without changing their format.")
s.ActivityReferenceOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityExecuteCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityStartOptions
PayloadInputOptions
}
func NewTemporalActivityExecuteCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityExecuteCommand {
var s TemporalActivityExecuteCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "execute [flags]"
s.Command.Short = "Start a new Standalone Activity and wait for its result (Experimental)"
if hasHighlighting {
s.Command.Long = "Start a new Standalone Activity and block until it completes.\nThe result is output to stdout.\n\n\x1b[1mtemporal activity execute \\\n --activity-id YourActivityId \\\n --type YourActivity \\\n --task-queue YourTaskQueue \\\n --start-to-close-timeout 30s \\\n --input '{\"some-key\": \"some-value\"}'\x1b[0m"
} else {
s.Command.Long = "Start a new Standalone Activity and block until it completes.\nThe result is output to stdout.\n\n```\ntemporal activity execute \\\n --activity-id YourActivityId \\\n --type YourActivity \\\n --task-queue YourTaskQueue \\\n --start-to-close-timeout 30s \\\n --input '{\"some-key\": \"some-value\"}'\n```"
}
s.Command.Args = cobra.NoArgs
s.ActivityStartOptions.BuildFlags(s.Command.Flags())
s.PayloadInputOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityFailCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityId string
WorkflowId string
RunId string
Detail string
Reason string
}
func NewTemporalActivityFailCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityFailCommand {
var s TemporalActivityFailCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "fail [flags]"
s.Command.Short = "Mark an Activity as completed unsuccessfully with an error"
if hasHighlighting {
s.Command.Long = "Fail an Activity, marking it as having encountered an error:\n\n\x1b[1mtemporal activity fail \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\x1b[0m"
} else {
s.Command.Long = "Fail an Activity, marking it as having encountered an error:\n\n```\ntemporal activity fail \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n```"
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "Activity ID. This may be the ID of an Activity invoked by a Workflow, or of a Standalone Activity. Required.")
_ = cobra.MarkFlagRequired(s.Command.Flags(), "activity-id")
s.Command.Flags().StringVarP(&s.WorkflowId, "workflow-id", "w", "", "Workflow ID. Required for workflow Activities. Omit for Standalone Activities.")
s.Command.Flags().StringVarP(&s.RunId, "run-id", "r", "", "Run ID. For workflow Activities (when --workflow-id is provided), this is the Workflow Run ID. For Standalone Activities, this is the Activity Run ID.")
s.Command.Flags().StringVar(&s.Detail, "detail", "", "Failure detail (JSON). Attached as the failure details payload.")
s.Command.Flags().StringVar(&s.Reason, "reason", "", "Failure reason. Attached as the failure message.")
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityListCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
Query string
Limit int
PageSize int
}
func NewTemporalActivityListCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityListCommand {
var s TemporalActivityListCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "list [flags]"
s.Command.Short = "List Standalone Activities matching a query (Experimental)"
if hasHighlighting {
s.Command.Long = "List Standalone Activities. Use \x1b[1m--query\x1b[0m to filter results.\n\n\x1b[1mtemporal activity list \\\n --query 'ActivityType=\"YourActivity\"'\x1b[0m\n\nVisit https://docs.temporal.io/visibility to read more about\nSearch Attributes and queries."
} else {
s.Command.Long = "List Standalone Activities. Use `--query` to filter results.\n\n```\ntemporal activity list \\\n --query 'ActivityType=\"YourActivity\"'\n```\n\nVisit https://docs.temporal.io/visibility to read more about\nSearch Attributes and queries."
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.Query, "query", "q", "", "Query to filter the Activity Executions to list.")
s.Command.Flags().IntVar(&s.Limit, "limit", 0, "Maximum number of Activity Executions to display.")
s.Command.Flags().IntVar(&s.PageSize, "page-size", 0, "Maximum number of Activity Executions to fetch at a time from the server.")
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityPauseCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
WorkflowReferenceOptions
ActivityId string
Identity string
Reason string
}
func NewTemporalActivityPauseCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityPauseCommand {
var s TemporalActivityPauseCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "pause [flags]"
s.Command.Short = "Pause an Activity"
if hasHighlighting {
s.Command.Long = "Pause an Activity. Not supported for Standalone Activities.\n\nIf the Activity is not currently running (e.g. because it previously\nfailed), it will not be run again until it is unpaused.\n\nHowever, if the Activity is currently running, it will run until the next\ntime it fails, completes, or times out, at which point the pause will kick in.\n\nIf the Activity is on its last retry attempt and fails, the failure will\nbe returned to the caller, just as if the Activity had not been paused.\n\nSpecify the Activity and Workflow IDs:\n\n\x1b[1mtemporal activity pause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\x1b[0m\n\nTo later unpause the activity, see unpause. You may also want to\nreset the activity to unpause it while also starting it from the beginning."
} else {
s.Command.Long = "Pause an Activity. Not supported for Standalone Activities.\n\nIf the Activity is not currently running (e.g. because it previously\nfailed), it will not be run again until it is unpaused.\n\nHowever, if the Activity is currently running, it will run until the next\ntime it fails, completes, or times out, at which point the pause will kick in.\n\nIf the Activity is on its last retry attempt and fails, the failure will\nbe returned to the caller, just as if the Activity had not been paused.\n\nSpecify the Activity and Workflow IDs:\n\n```\ntemporal activity pause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n```\n\nTo later unpause the activity, see unpause. You may also want to\nreset the activity to unpause it while also starting it from the beginning."
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to pause. Required.")
s.Command.Flags().StringVar(&s.Identity, "identity", "", "The identity of the user or client submitting this request.")
s.Command.Flags().StringVar(&s.Reason, "reason", "", "Reason for pausing the Activity.")
s.WorkflowReferenceOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityResetCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
SingleActivityOrBatchOptions
ActivityId string
KeepPaused bool
ResetAttempts bool
ResetHeartbeats bool
Jitter cliext.FlagDuration
RestoreOriginalOptions bool
}
func NewTemporalActivityResetCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityResetCommand {
var s TemporalActivityResetCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "reset [flags]"
s.Command.Short = "Reset an Activity"
if hasHighlighting {
s.Command.Long = "Reset an activity. Not supported for Standalone Activities.\nThis restarts the activity as if it were first being\nscheduled. That is, it will reset both the number of attempts and the\nactivity timeout, as well as, optionally, the\nheartbeat details.\n\nIf the activity may be executing (i.e. it has not yet timed out), the\nreset will take effect the next time it fails, heartbeats, or times out.\nIf is waiting for a retry (i.e. has failed or timed out), the reset\nwill apply immediately.\n\nIf the activity is already paused, it will be unpaused by default.\nYou can specify \x1b[1mkeep_paused\x1b[0m to prevent this.\n\nIf the activity is paused and the \x1b[1mkeep_paused\x1b[0m flag is not provided,\nit will be unpaused. If the activity is paused and \x1b[1mkeep_paused\x1b[0m flag\nis provided - it will stay paused.\n\nEither \x1b[1m--activity-id\x1b[0m (with \x1b[1m--workflow-id\x1b[0m) or \x1b[1m--query\x1b[0m must be specified.\n\n### Resetting activities that heartbeat {#reset-heartbeats}\n\nActivities that heartbeat will receive a Canceled failure\nthe next time they heartbeat after a reset.\n\nIf, in your Activity, you need to do any cleanup when an Activity is\nreset, handle this error and then re-throw it when you've cleaned up.\n\nIf the \x1b[1mreset_heartbeats\x1b[0m flag is set, the heartbeat details will also be cleared.\n\nSpecify the Activity and Workflow IDs:\n\n\x1b[1mtemporal activity reset \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --keep-paused\n --reset-heartbeats\x1b[0m\n\nActivities can be reset in bulk with a visibility query list filter:\n\n\x1b[1mtemporal activity reset \\\n --query 'WorkflowType=\"YourWorkflow\"'\x1b[0m"
} else {
s.Command.Long = "Reset an activity. Not supported for Standalone Activities.\nThis restarts the activity as if it were first being\nscheduled. That is, it will reset both the number of attempts and the\nactivity timeout, as well as, optionally, the\nheartbeat details.\n\nIf the activity may be executing (i.e. it has not yet timed out), the\nreset will take effect the next time it fails, heartbeats, or times out.\nIf is waiting for a retry (i.e. has failed or timed out), the reset\nwill apply immediately.\n\nIf the activity is already paused, it will be unpaused by default.\nYou can specify `keep_paused` to prevent this.\n\nIf the activity is paused and the `keep_paused` flag is not provided,\nit will be unpaused. If the activity is paused and `keep_paused` flag\nis provided - it will stay paused.\n\nEither `--activity-id` (with `--workflow-id`) or `--query` must be specified.\n\n### Resetting activities that heartbeat {#reset-heartbeats}\n\nActivities that heartbeat will receive a Canceled failure\nthe next time they heartbeat after a reset.\n\nIf, in your Activity, you need to do any cleanup when an Activity is\nreset, handle this error and then re-throw it when you've cleaned up.\n\nIf the `reset_heartbeats` flag is set, the heartbeat details will also be cleared.\n\nSpecify the Activity and Workflow IDs:\n\n```\ntemporal activity reset \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --keep-paused\n --reset-heartbeats\n```\n\nActivities can be reset in bulk with a visibility query list filter:\n\n```\ntemporal activity reset \\\n --query 'WorkflowType=\"YourWorkflow\"'\n```"
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to reset. Mutually exclusive with `--query`. Requires `--workflow-id` to be specified.")
s.Command.Flags().BoolVar(&s.KeepPaused, "keep-paused", false, "If the activity was paused, it will stay paused.")
s.Command.Flags().BoolVar(&s.ResetAttempts, "reset-attempts", false, "Reset the activity attempts.")
s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats.")
s.Jitter = 0
s.Command.Flags().Var(&s.Jitter, "jitter", "The activity will reset at random a time within the specified duration. Can only be used with --query.")
s.Command.Flags().BoolVar(&s.RestoreOriginalOptions, "restore-original-options", false, "Restore the original options of the activity.")
s.SingleActivityOrBatchOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityResultCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityReferenceOptions
}
func NewTemporalActivityResultCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityResultCommand {
var s TemporalActivityResultCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "result [flags]"
s.Command.Short = "Wait for and output the result of a Standalone Activity (Experimental)"
if hasHighlighting {
s.Command.Long = "Wait for a Standalone Activity to complete and output the\nresult.\n\n\x1b[1mtemporal activity result \\\n --activity-id YourActivityId\x1b[0m"
} else {
s.Command.Long = "Wait for a Standalone Activity to complete and output the\nresult.\n\n```\ntemporal activity result \\\n --activity-id YourActivityId\n```"
}
s.Command.Args = cobra.NoArgs
s.ActivityReferenceOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityStartCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityStartOptions
PayloadInputOptions
}
func NewTemporalActivityStartCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityStartCommand {
var s TemporalActivityStartCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "start [flags]"
s.Command.Short = "Start a new Standalone Activity (Experimental)"
if hasHighlighting {
s.Command.Long = "Start a new Standalone Activity. Outputs the Activity ID and\nRun ID.\n\n\x1b[1mtemporal activity start \\\n --activity-id YourActivityId \\\n --type YourActivity \\\n --task-queue YourTaskQueue \\\n --start-to-close-timeout 5m \\\n --input '{\"some-key\": \"some-value\"}'\x1b[0m"
} else {
s.Command.Long = "Start a new Standalone Activity. Outputs the Activity ID and\nRun ID.\n\n```\ntemporal activity start \\\n --activity-id YourActivityId \\\n --type YourActivity \\\n --task-queue YourTaskQueue \\\n --start-to-close-timeout 5m \\\n --input '{\"some-key\": \"some-value\"}'\n```"
}
s.Command.Args = cobra.NoArgs
s.ActivityStartOptions.BuildFlags(s.Command.Flags())
s.PayloadInputOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityTerminateCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
ActivityReferenceOptions
Reason string
}
func NewTemporalActivityTerminateCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityTerminateCommand {
var s TemporalActivityTerminateCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "terminate [flags]"
s.Command.Short = "Forcefully end a Standalone Activity (Experimental)"
if hasHighlighting {
s.Command.Long = "Terminate a Standalone Activity.\n\n\x1b[1mtemporal activity terminate \\\n --activity-id YourActivityId \\\n --reason YourReason\x1b[0m\n\nActivity code cannot see or respond to terminations."
} else {
s.Command.Long = "Terminate a Standalone Activity.\n\n```\ntemporal activity terminate \\\n --activity-id YourActivityId \\\n --reason YourReason\n```\n\nActivity code cannot see or respond to terminations."
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVar(&s.Reason, "reason", "", "Reason for termination. Defaults to a message with the current user's name.")
s.ActivityReferenceOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityUnpauseCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
SingleActivityOrBatchOptions
ActivityId string
ResetAttempts bool
ResetHeartbeats bool
Jitter cliext.FlagDuration
}
func NewTemporalActivityUnpauseCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityUnpauseCommand {
var s TemporalActivityUnpauseCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "unpause [flags]"
s.Command.Short = "Unpause an Activity"
if hasHighlighting {
s.Command.Long = "Re-schedule a previously-paused Activity for execution.\nNot supported for Standalone Activities.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nUse \x1b[1m--reset-attempts\x1b[0m to reset the number of previous run attempts to\nzero. For example, if an Activity is near the maximum number of attempts\nN specified in its retry policy, \x1b[1m--reset-attempts\x1b[0m will allow the\nActivity to be retried another N times after unpausing.\n\nUse \x1b[1m--reset-heartbeat\x1b[0m to reset the Activity's heartbeats.\n\nEither \x1b[1m--activity-id\x1b[0m (with \x1b[1m--workflow-id\x1b[0m) or \x1b[1m--query\x1b[0m must be specified.\n\nSpecify the Activity and Workflow IDs:\n\n\x1b[1mtemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --reset-attempts\n --reset-heartbeats\x1b[0m\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n\x1b[1mtemporal activity unpause \\\n --query 'TemporalPauseInfo IS NOT NULL'\x1b[0m"
} else {
s.Command.Long = "Re-schedule a previously-paused Activity for execution.\nNot supported for Standalone Activities.\n\nIf the Activity is not running and is past its retry timeout, it will be\nscheduled immediately. Otherwise, it will be scheduled after its retry\ntimeout expires.\n\nUse `--reset-attempts` to reset the number of previous run attempts to\nzero. For example, if an Activity is near the maximum number of attempts\nN specified in its retry policy, `--reset-attempts` will allow the\nActivity to be retried another N times after unpausing.\n\nUse `--reset-heartbeat` to reset the Activity's heartbeats.\n\nEither `--activity-id` (with `--workflow-id`) or `--query` must be specified.\n\nSpecify the Activity and Workflow IDs:\n\n```\ntemporal activity unpause \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId\n --reset-attempts\n --reset-heartbeats\n```\n\nActivities can be unpaused in bulk via a visibility Query list filter:\n\n```\ntemporal activity unpause \\\n --query 'TemporalPauseInfo IS NOT NULL'\n```"
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to unpause. Mutually exclusive with `--query`. Requires `--workflow-id` to be specified.")
s.Command.Flags().BoolVar(&s.ResetAttempts, "reset-attempts", false, "Reset the activity attempts.")
s.Command.Flags().BoolVar(&s.ResetHeartbeats, "reset-heartbeats", false, "Reset the Activity's heartbeats.")
s.Jitter = 0
s.Command.Flags().Var(&s.Jitter, "jitter", "The activity will start at random a time within the specified duration. Can only be used with --query.")
s.SingleActivityOrBatchOptions.BuildFlags(s.Command.Flags())
s.Command.Run = func(c *cobra.Command, args []string) {
if err := s.run(cctx, args); err != nil {
cctx.Options.Fail(err)
}
}
return &s
}
type TemporalActivityUpdateOptionsCommand struct {
Parent *TemporalActivityCommand
Command cobra.Command
SingleActivityOrBatchOptions
ActivityId string
TaskQueue string
ScheduleToCloseTimeout cliext.FlagDuration
ScheduleToStartTimeout cliext.FlagDuration
StartToCloseTimeout cliext.FlagDuration
HeartbeatTimeout cliext.FlagDuration
RetryInitialInterval cliext.FlagDuration
RetryMaximumInterval cliext.FlagDuration
RetryBackoffCoefficient float32
RetryMaximumAttempts int
RestoreOriginalOptions bool
}
func NewTemporalActivityUpdateOptionsCommand(cctx *CommandContext, parent *TemporalActivityCommand) *TemporalActivityUpdateOptionsCommand {
var s TemporalActivityUpdateOptionsCommand
s.Parent = parent
s.Command.DisableFlagsInUseLine = true
s.Command.Use = "update-options [flags]"
s.Command.Short = "Change the values of options affecting a running Activity"
if hasHighlighting {
s.Command.Long = "Update the options of a running Activity that were passed into it from\na Workflow. Updates are incremental, only changing the specified options.\nNot supported for Standalone Activities.\n\nFor example:\n\n\x1b[1mtemporal activity update-options \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId \\\n --task-queue NewTaskQueueName \\\n --schedule-to-close-timeout DURATION \\\n --schedule-to-start-timeout DURATION \\\n --start-to-close-timeout DURATION \\\n --heartbeat-timeout DURATION \\\n --retry-initial-interval DURATION \\\n --retry-maximum-interval DURATION \\\n --retry-backoff-coefficient NewBackoffCoefficient \\\n --retry-maximum-attempts NewMaximumAttempts\x1b[0m\n\nYou may follow this command with \x1b[1mtemporal activity reset\x1b[0m, and the new values will apply after the reset.\n\nEither \x1b[1m--activity-id\x1b[0m or \x1b[1m--query\x1b[0m must be specified.\n\nActivity options can be updated in bulk with a visibility query list filter:\n\n\x1b[1mtemporal activity update-options \\\n --query 'WorkflowType=\"YourWorkflow\"' \\\n --task-queue NewTaskQueueName\x1b[0m"
} else {
s.Command.Long = "Update the options of a running Activity that were passed into it from\na Workflow. Updates are incremental, only changing the specified options.\nNot supported for Standalone Activities.\n\nFor example:\n\n```\ntemporal activity update-options \\\n --activity-id YourActivityId \\\n --workflow-id YourWorkflowId \\\n --task-queue NewTaskQueueName \\\n --schedule-to-close-timeout DURATION \\\n --schedule-to-start-timeout DURATION \\\n --start-to-close-timeout DURATION \\\n --heartbeat-timeout DURATION \\\n --retry-initial-interval DURATION \\\n --retry-maximum-interval DURATION \\\n --retry-backoff-coefficient NewBackoffCoefficient \\\n --retry-maximum-attempts NewMaximumAttempts\n```\n\nYou may follow this command with `temporal activity reset`, and the new values will apply after the reset.\n\nEither `--activity-id` or `--query` must be specified.\n\nActivity options can be updated in bulk with a visibility query list filter:\n\n```\ntemporal activity update-options \\\n --query 'WorkflowType=\"YourWorkflow\"' \\\n --task-queue NewTaskQueueName\n```"
}
s.Command.Args = cobra.NoArgs
s.Command.Flags().StringVarP(&s.ActivityId, "activity-id", "a", "", "The Activity ID to update options. Mutually exclusive with `--query`. Requires `--workflow-id` to be specified.")
s.Command.Flags().StringVar(&s.TaskQueue, "task-queue", "", "Name of the task queue for the Activity.")
s.ScheduleToCloseTimeout = 0