Documentation ¶
Index ¶
- Variables
- func AddSearchAttributes(c *cli.Context) error
- func BackfillSchedule(c *cli.Context) error
- func BatchCancel(c *cli.Context) error
- func BatchSignal(c *cli.Context) error
- func BatchTerminate(c *cli.Context) error
- func CancelWorkflow(c *cli.Context) error
- func ColorEvent(e *historypb.HistoryEvent) string
- func CompleteActivity(c *cli.Context) error
- func CountWorkflow(c *cli.Context) error
- func CreateSchedule(c *cli.Context) error
- func CurrentEnv(c *cli.Context) error
- func DataConverter(c *cli.Context) error
- func DeleteNamespace(c *cli.Context) error
- func DeleteSchedule(c *cli.Context) error
- func DeleteWorkflow(c *cli.Context) error
- func DescribeBatchJob(c *cli.Context) error
- func DescribeCluster(c *cli.Context) error
- func DescribeNamespace(c *cli.Context) error
- func DescribeSchedule(c *cli.Context) error
- func DescribeSystem(c *cli.Context) error
- func DescribeTaskQueue(c *cli.Context) error
- func DescribeWorkflow(c *cli.Context) error
- func EnvProperty(c *cli.Context) error
- func FailActivity(c *cli.Context) error
- func HealthCheck(c *cli.Context) error
- func HistoryEventToString(e *historypb.HistoryEvent, printFully bool, maxFieldLength int) string
- func ListBatchJobs(c *cli.Context) error
- func ListClusters(c *cli.Context) error
- func ListNamespaces(c *cli.Context) error
- func ListSchedules(c *cli.Context) error
- func ListSearchAttributes(c *cli.Context) error
- func ListTaskQueuePartitions(c *cli.Context) error
- func ListWorkflow(c *cli.Context) error
- func NewCliApp() *cli.App
- func NewContextWithCLIHeaders() (context.Context, context.CancelFunc)
- func NewContextWithTimeoutAndCLIHeaders(timeout time.Duration) (context.Context, context.CancelFunc)
- func QueryWorkflow(c *cli.Context) error
- func QueryWorkflowUsingStackTrace(c *cli.Context) error
- func RegisterNamespace(c *cli.Context) error
- func RemoveCluster(c *cli.Context) error
- func RemoveEnv(c *cli.Context) error
- func RemoveSearchAttributes(c *cli.Context) error
- func ResetInBatch(c *cli.Context) error
- func ResetWorkflow(c *cli.Context) error
- func SetAlias(c *cli.Context) error
- func SetEnvProperty(c *cli.Context) error
- func SetFactory(factory ClientFactory)
- func SetRequiredNamespaceDataKeys(keys []string)
- func ShowEnv(c *cli.Context) error
- func ShowHistory(c *cli.Context) error
- func SignalWorkflow(c *cli.Context) error
- func SplitKeyValuePairs(kvs []string) (map[string]string, error)
- func StartWorkflow(c *cli.Context, printProgress bool) error
- func StopBatchJob(c *cli.Context) error
- func TerminateWorkflow(c *cli.Context) error
- func ToggleSchedule(c *cli.Context) error
- func TraceWorkflow(c *cli.Context) error
- func TriggerSchedule(c *cli.Context) error
- func UpdateNamespace(c *cli.Context) error
- func UpdateSchedule(c *cli.Context) error
- func UpsertCluster(c *cli.Context) error
- func UseEnv(c *cli.Context) error
- type ClientFactory
- type HttpGetter
- type PayloadRequest
- type PayloadResponse
- type SdkLogger
- func (l *SdkLogger) Debug(msg string, keyvals ...interface{})
- func (l *SdkLogger) Error(msg string, keyvals ...interface{})
- func (l *SdkLogger) Info(msg string, keyvals ...interface{})
- func (l *SdkLogger) Warn(msg string, keyvals ...interface{})
- func (l *SdkLogger) With(keyvals ...interface{}) sdklog.Logger
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( FlagAddress = "address" FlagAuth = "auth" FlagNamespaceID = "namespace-id" FlagNamespace = "namespace" FlagNamespaceAlias = []string{"n"} FlagWorkflowID = "workflow-id" FlagWorkflowIDAlias = []string{"w"} FlagRunID = "run-id" FlagRunIDAlias = []string{"r"} FlagTaskQueue = "task-queue" FlagTaskQueueAlias = []string{"t"} FlagTaskQueueType = "task-queue-type" FlagWorkflowIDReusePolicy = "id-reuse-policy" FlagCronSchedule = "cron" FlagWorkflowExecutionTimeout = "execution-timeout" FlagWorkflowRunTimeout = "run-timeout" FlagWorkflowTaskTimeout = "task-timeout" FlagContextTimeout = "context-timeout" FlagInput = "input" FlagInputAlias = []string{"i"} FlagInputFile = "input-file" FlagExcludeFile = "exclude-file" FlagInputSeparator = "input-separator" FlagParallelism = "input-parallelism" FlagSkipCurrentOpen = "skip-current-open" FlagSkipBaseIsNotCurrent = "skip-base-is-not-current" FlagDryRun = "dry-run" FlagNonDeterministic = "non-deterministic" FlagResult = "result" FlagIdentity = "identity" FlagDetail = "detail" FlagReason = "reason" FlagPrintRaw = "raw" FlagDescription = "description" FlagOwnerEmail = "email" FlagRetention = "retention" FlagHistoryArchivalState = "history-archival-state" FlagHistoryArchivalURI = "history-uri" FlagVisibilityArchivalState = "visibility-archival-state" FlagVisibilityArchivalURI = "visibility-uri" FlagName = "name" FlagOutputFilename = "output-filename" FlagQueryRejectCondition = "reject-condition" FlagActiveCluster = "active-cluster" FlagCluster = "cluster" FlagNamespaceData = "data" FlagIsGlobalNamespace = "global" FlagPromoteNamespace = "promote-global" FlagEventID = "event-id" FlagActivityID = "activity-id" FlagMaxFieldLength = "max-field-length" FlagMemo = "memo" FlagMemoFile = "memo-file" FlagSearchAttribute = "search-attribute" FlagResetReapplyType = "reapply-type" FlagResetPointsOnly = "reset-points" FlagQuery = "query" FlagQueryAlias = []string{"q"} FlagQueryUsage = "Filter results using SQL like query. See https://docs.temporal.io/docs/tctl/workflow/list#--query for details" FlagArchive = "archived" FlagRPS = "rps" FlagJobID = "job-id" FlagYes = "yes" FlagYesAlias = []string{"y"} FlagTLSCertPath = "tls-cert-path" FlagTLSKeyPath = "tls-key-path" FlagTLSCaPath = "tls-ca-path" FlagTLSDisableHostVerification = "tls-disable-host-verification" FlagTLSServerName = "tls-server-name" FlagConcurrency = "concurrency" FlagDataConverterPlugin = "data-converter-plugin" FlagCodecAuth = "codec-auth" FlagCodecEndpoint = "codec-endpoint" FlagWebURL = "url" FlagHeadersProviderPlugin = "headers-provider-plugin" FlagPort = "port" FlagFollowAlias = []string{"f"} FlagType = "type" FlagWorkflowType = "workflow-type" FlagScheduleID = "schedule-id" FlagScheduleIDAlias = []string{"s"} FlagOverlapPolicy = "overlap-policy" FlagCalendar = "calendar" FlagInterval = "interval" FlagStartTime = "start-time" FlagEndTime = "end-time" FlagJitter = "jitter" FlagTimeZone = "time-zone" FlagNotes = "notes" FlagRemainingActions = "remaining-actions" FlagCatchupWindow = "catchup-window" FlagPauseOnFailure = "pause-on-failure" FlagPause = "pause" FlagUnpause = "unpause" FlagFold = "fold" FlagNoFold = "no-fold" FlagDepth = "depth" FlagOutputAlias = []string{"o"} FlagClusterAddress = "frontend-address" FlagClusterEnableConnection = "enable-connection" )
Flags used to specify cli command line arguments
Functions ¶
func AddSearchAttributes ¶
func AddSearchAttributes(c *cli.Context) error
AddSearchAttributes to add search attributes
func BackfillSchedule ¶
func BackfillSchedule(c *cli.Context) error
func BatchSignal ¶
func BatchSignal(c *cli.Context) error
BatchSignal send a signal to a list of workflows
func BatchTerminate ¶
func BatchTerminate(c *cli.Context) error
BatchTerminate terminate a list of workflows
func CancelWorkflow ¶
func CancelWorkflow(c *cli.Context) error
func ColorEvent ¶
func ColorEvent(e *historypb.HistoryEvent) string
ColorEvent takes an event and return string with color Event with color mapping rules:
Failed - red Timeout - yellow Canceled - magenta Completed - green Started - blue Others - default (white/black)
func CompleteActivity ¶
func CompleteActivity(c *cli.Context) error
CompleteActivity completes an Activity
func CountWorkflow ¶
func CountWorkflow(c *cli.Context) error
CountWorkflow count number of workflows
func CreateSchedule ¶
func CreateSchedule(c *cli.Context) error
func CurrentEnv ¶
func CurrentEnv(c *cli.Context) error
Example ¶
tctl := NewCliApp() tctl.Run([]string{"", "config", "use-env", testEnvName}) tctl.Run([]string{"", "config", "current-env"})
Output: current-env: tctl-test-env tctl-test-env
func DataConverter ¶
func DataConverter(c *cli.Context) error
DataConverter provides a data converter over a websocket for Temporal web
func DeleteNamespace ¶
func DeleteNamespace(c *cli.Context) error
DeleteNamespace deletes namespace.
func DeleteSchedule ¶
func DeleteSchedule(c *cli.Context) error
func DeleteWorkflow ¶
func DeleteWorkflow(c *cli.Context) error
DeleteWorkflow deletes a workflow execution.
func DescribeBatchJob ¶
func DescribeBatchJob(c *cli.Context) error
DescribeBatchJob describe the status of the batch job
func DescribeCluster ¶
func DescribeCluster(c *cli.Context) error
func DescribeNamespace ¶
func DescribeNamespace(c *cli.Context) error
DescribeNamespace updates a namespace
func DescribeSchedule ¶
func DescribeSchedule(c *cli.Context) error
func DescribeSystem ¶
func DescribeSystem(c *cli.Context) error
func DescribeTaskQueue ¶
func DescribeTaskQueue(c *cli.Context) error
DescribeTaskQueue show pollers info of a given taskqueue
func DescribeWorkflow ¶
func DescribeWorkflow(c *cli.Context) error
DescribeWorkflow show information about the specified workflow execution
func EnvProperty ¶
func EnvProperty(c *cli.Context) error
Example ¶
// The MIT License // // Copyright (c) 2022 Temporal Technologies Inc. All rights reserved. // // Copyright (c) 2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package main import ( "log" "os" "path/filepath" "github.com/urfave/cli/v2" ) func main() { tctl := NewCliApp() defer setupConfig(tctl)() tctl.Run([]string{"", "config", "set", "namespace", "tctl-test-namespace"}) tctl.Run([]string{"", "config", "get", "namespace"}) } func (s *cliAppSuite) TestSetConfigValue() { defer setupConfig(s.app)() err := s.app.Run([]string{"", "config", "set", "namespace", "tctl-test-namespace"}) s.NoError(err) err = s.app.Run([]string{"", "config", "set", "address", "0.0.0.0:00000"}) s.NoError(err) config := readConfig() s.Contains(config, " tctl-test-env:") s.Contains(config, " address: 0.0.0.0:00000") s.Contains(config, " namespace: tctl-test-namespace") } func setupConfig(app *cli.App) func() { err := app.Run([]string{"", "config", "use-env", testEnvName}) if err != nil { log.Fatal(err) } return func() { err = app.Run([]string{"", "config", "use-env", "local"}) if err != nil { log.Fatal(err) } err = app.Run([]string{"", "config", "remove-env", testEnvName}) if err != nil { log.Fatal(err) } } } func readConfig() string { path := getConfigPath() content, err := os.ReadFile(path) if err != nil { log.Fatal(err) } return string(content) } func getConfigPath() string { dpath, err := os.UserHomeDir() if err != nil { log.Fatal(err) } path := filepath.Join(dpath, ".config", "temporalio", "tctl.yaml") return path }
Output: current-env: tctl-test-env Set 'namespace' to: tctl-test-namespace tctl-test-namespace current-env: local Removed env tctl-test-env
func HistoryEventToString ¶
func HistoryEventToString(e *historypb.HistoryEvent, printFully bool, maxFieldLength int) string
HistoryEventToString convert HistoryEvent to string
func ListBatchJobs ¶
func ListBatchJobs(c *cli.Context) error
ListBatchJobs list the started batch jobs
func ListClusters ¶
func ListClusters(c *cli.Context) error
func ListSchedules ¶
func ListSchedules(c *cli.Context) error
func ListSearchAttributes ¶
func ListSearchAttributes(c *cli.Context) error
ListSearchAttributes lists search attributes
func ListTaskQueuePartitions ¶
func ListTaskQueuePartitions(c *cli.Context) error
ListTaskQueuePartitions gets all the taskqueue partition and host information.
func ListWorkflow ¶
func ListWorkflow(c *cli.Context) error
ListWorkflow list workflow executions based on filters
func NewCliApp ¶
func NewCliApp() *cli.App
NewCliApp instantiates a new instance of the CLI application.
func NewContextWithCLIHeaders ¶
func NewContextWithCLIHeaders() (context.Context, context.CancelFunc)
NewContextWithCLIHeaders creates context with version headers for CLI.
func NewContextWithTimeoutAndCLIHeaders ¶
func NewContextWithTimeoutAndCLIHeaders(timeout time.Duration) (context.Context, context.CancelFunc)
NewContextWithTimeoutAndCLIHeaders creates context with timeout and version headers for CLI.
func QueryWorkflow ¶
func QueryWorkflow(c *cli.Context) error
QueryWorkflow query workflow execution
func QueryWorkflowUsingStackTrace ¶
func QueryWorkflowUsingStackTrace(c *cli.Context) error
QueryWorkflowUsingStackTrace query workflow execution using __stack_trace as query type
func RegisterNamespace ¶
func RegisterNamespace(c *cli.Context) error
RegisterNamespace register a namespace
func RemoveCluster ¶
func RemoveCluster(c *cli.Context) error
func RemoveSearchAttributes ¶
func RemoveSearchAttributes(c *cli.Context) error
RemoveSearchAttributes to add search attributes
func SetEnvProperty ¶
func SetEnvProperty(c *cli.Context) error
func SetFactory ¶
func SetFactory(factory ClientFactory)
SetFactory is used to set the ClientFactory global
func SetRequiredNamespaceDataKeys ¶
func SetRequiredNamespaceDataKeys(keys []string)
SetRequiredNamespaceDataKeys will set requiredNamespaceDataKeys
func ShowEnv ¶
func ShowEnv(c *cli.Context) error
Example ¶
tctl := NewCliApp() tctl.Run([]string{"", "config", "use-env", testEnvName}) tctl.Run([]string{"", "config", "set", "namespace", "tctl-test-namespace"}) tctl.Run([]string{"", "config", "show-env", testEnvName})
Output: current-env: tctl-test-env Set 'namespace' to: tctl-test-namespace namespace tctl-test-namespace
func ShowHistory ¶
func ShowHistory(c *cli.Context) error
ShowHistory shows the history of given workflow execution based on workflowID and runID.
func SignalWorkflow ¶
func SignalWorkflow(c *cli.Context) error
func SplitKeyValuePairs ¶
SplitKeyValuePairs parses key=value pairs
func StartWorkflow ¶
StartWorkflow starts a new workflow execution and optionally prints progress
func TerminateWorkflow ¶
func TerminateWorkflow(c *cli.Context) error
func ToggleSchedule ¶
func ToggleSchedule(c *cli.Context) error
func TraceWorkflow ¶
func TraceWorkflow(c *cli.Context) error
func TriggerSchedule ¶
func TriggerSchedule(c *cli.Context) error
func UpdateNamespace ¶
func UpdateNamespace(c *cli.Context) error
UpdateNamespace updates a namespace
func UpdateSchedule ¶
func UpdateSchedule(c *cli.Context) error
func UpsertCluster ¶
func UpsertCluster(c *cli.Context) error
Types ¶
type ClientFactory ¶
type ClientFactory interface { FrontendClient(c *cli.Context) workflowservice.WorkflowServiceClient OperatorClient(c *cli.Context) operatorservice.OperatorServiceClient SDKClient(c *cli.Context, namespace string) sdkclient.Client HealthClient(c *cli.Context) healthpb.HealthClient }
ClientFactory is used to construct rpc clients
func NewClientFactory ¶
func NewClientFactory() ClientFactory
NewClientFactory creates a new ClientFactory
type HttpGetter ¶
HttpGetter defines http.Client.Get(...) as an interface so we can mock it
type PayloadRequest ¶
type PayloadResponse ¶
type SdkLogger ¶
type SdkLogger struct {
// contains filtered or unexported fields
}
func NewSdkLogger ¶
Source Files ¶
- activity.go
- activity_commands.go
- alias.go
- app.go
- batch.go
- batch_commands.go
- cluster.go
- cluster_commands.go
- commands.go
- config.go
- data_converter.go
- data_converter_commands.go
- defs.go
- env.go
- factory.go
- flags.go
- namespace.go
- namespace_commands.go
- namespace_utils.go
- plugin.go
- schedule.go
- schedule_commands.go
- sdk_logger.go
- search_attribute.go
- search_attribute_commands.go
- task_queue.go
- task_queue_commands.go
- use_dynamic_commands.go
- util.go
- workflow.go
- workflow_commands.go