cli_curr

package
v1.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: MIT Imports: 106 Imported by: 1

README

Documentation for the Temporal command line interface is located at our main site.

Quick Start

Run make from the project root. You should see an executable file called tctl. Try a few example commands to get started:
./tctl for help on top level commands and global options
./tctl namespace for help on namespace operations
./tctl workflow for help on workflow operations
./tctl taskqueue for help on taskqueue operations
(./tctl help, ./tctl help [namespace|workflow] will also print help messages)

Note: Make sure you have a Temporal server running before using the CLI.

Documentation

Index

Constants

View Source
const (
	// HistoryMissing is the CorruptionType indicating that history is missing
	HistoryMissing CorruptionType = "history_missing"
	// InvalidFirstEvent is the CorruptionType indicating that the first event is invalid
	InvalidFirstEvent = "invalid_first_event"
	// OpenExecutionInvalidCurrentExecution is the CorruptionType that indicates there is an orphan concrete execution
	OpenExecutionInvalidCurrentExecution = "open_execution_invalid_current_execution"
	CorruptActivityIdPresent             = "corrupt_activity_id_present"
)
View Source
const (
	FlagUsername                              = "username"
	FlagPassword                              = "password"
	FlagKeyspace                              = "keyspace"
	FlagAddress                               = "address"
	FlagAuth                                  = "auth"
	FlagAddressWithAlias                      = FlagAddress + ", ad"
	FlagDBEngine                              = "db_engine"
	FlagDBAddress                             = "db_address"
	FlagDBPort                                = "db_port"
	FlagHistoryAddress                        = "history_address"
	FlagHistoryAddressWithAlias               = FlagHistoryAddress + ", had"
	FlagFrontendAddress                       = "frontend_address"
	FlagFrontendAddressWithAlias              = FlagFrontendAddress + ", fad"
	FlagNamespaceID                           = "namespace_id"
	FlagNamespace                             = "namespace"
	FlagNamespaceWithAlias                    = FlagNamespace + ", ns"
	FlagShardID                               = "shard_id"
	FlagShardIDWithAlias                      = FlagShardID + ", sid"
	FlagWorkflowID                            = "workflow_id"
	FlagWorkflowIDWithAlias                   = FlagWorkflowID + ", wid, w"
	FlagRunID                                 = "run_id"
	FlagTreeID                                = "tree_id"
	FlagBranchID                              = "branch_id"
	FlagNumberOfShards                        = "number_of_shards"
	FlagRunIDWithAlias                        = FlagRunID + ", rid, r"
	FlagTargetCluster                         = "target_cluster"
	FlagMinEventID                            = "min_event_id"
	FlagMaxEventID                            = "max_event_id"
	FlagMinEventVersion                       = "min_event_version"
	FlagMaxEventVersion                       = "max_event_version"
	FlagTaskQueue                             = "taskqueue"
	FlagTaskQueueWithAlias                    = FlagTaskQueue + ", tq"
	FlagTaskQueueType                         = "taskqueuetype"
	FlagTaskQueueTypeWithAlias                = FlagTaskQueueType + ", tqt"
	FlagWorkflowIDReusePolicy                 = "workflowidreusepolicy"
	FlagWorkflowIDReusePolicyAlias            = FlagWorkflowIDReusePolicy + ", wrp"
	FlagCronSchedule                          = "cron"
	FlagWorkflowType                          = "workflow_type"
	FlagWorkflowTypeWithAlias                 = FlagWorkflowType + ", wt"
	FlagWorkflowStatus                        = "status"
	FlagWorkflowStatusWithAlias               = FlagWorkflowStatus + ", s"
	FlagWorkflowExecutionTimeout              = "execution_timeout"
	FlagWorkflowExecutionTimeoutWithAlias     = FlagWorkflowExecutionTimeout + ", et"
	FlagWorkflowRunTimeout                    = "run-timeout"
	FlagWorkflowRunTimeoutWithAlias           = FlagWorkflowRunTimeout + ", rt"
	FlagWorkflowTaskTimeout                   = "workflow_task_timeout"
	FlagWorkflowTaskTimeoutWithAlias          = FlagWorkflowTaskTimeout + ", wtt"
	FlagContextTimeout                        = "context_timeout"
	FlagContextTimeoutWithAlias               = FlagContextTimeout + ", ct"
	FlagInput                                 = "input"
	FlagInputWithAlias                        = FlagInput + ", i"
	FlagInputFile                             = "input_file"
	FlagInputFileWithAlias                    = FlagInputFile + ", if"
	FlagExcludeFile                           = "exclude_file"
	FlagInputSeparator                        = "input_separator"
	FlagParallism                             = "input_parallism"
	FlagSkipCurrentOpen                       = "skip_current_open"
	FlagSkipBaseIsNotCurrent                  = "skip_base_is_not_current"
	FlagDryRun                                = "dry_run"
	FlagNonDeterministicOnly                  = "only_non_deterministic"
	FlagCluster                               = "cluster"
	FlagResult                                = "result"
	FlagIdentity                              = "identity"
	FlagDetail                                = "detail"
	FlagReason                                = "reason"
	FlagReasonWithAlias                       = FlagReason + ", re"
	FlagOpen                                  = "open"
	FlagOpenWithAlias                         = FlagOpen + ", op"
	FlagMore                                  = "more"
	FlagMoreWithAlias                         = FlagMore + ", m"
	FlagAll                                   = "all"
	FlagAllWithAlias                          = FlagAll + ", a"
	FlagPageSize                              = "pagesize"
	FlagPageSizeWithAlias                     = FlagPageSize + ", ps"
	FlagEarliestTime                          = "earliest_time"
	FlagEarliestTimeWithAlias                 = FlagEarliestTime + ", et"
	FlagLatestTime                            = "latest_time"
	FlagLatestTimeWithAlias                   = FlagLatestTime + ", lt"
	FlagPrintEventVersion                     = "print_event_version"
	FlagPrintEventVersionWithAlias            = FlagPrintEventVersion + ", pev"
	FlagPrintFullyDetail                      = "print_full"
	FlagPrintFullyDetailWithAlias             = FlagPrintFullyDetail + ", pf"
	FlagPrintRawTime                          = "print_raw_time"
	FlagPrintRawTimeWithAlias                 = FlagPrintRawTime + ", prt"
	FlagPrintRaw                              = "print_raw"
	FlagPrintRawWithAlias                     = FlagPrintRaw + ", praw"
	FlagPrintDateTime                         = "print_datetime"
	FlagPrintDateTimeWithAlias                = FlagPrintDateTime + ", pdt"
	FlagPrintMemo                             = "print_memo"
	FlagPrintMemoWithAlias                    = FlagPrintMemo + ", pme"
	FlagPrintSearchAttr                       = "print_search_attr"
	FlagPrintSearchAttrWithAlias              = FlagPrintSearchAttr + ", psa"
	FlagPrintJSON                             = "print_json"
	FlagPrintJSONWithAlias                    = FlagPrintJSON + ", pjson"
	FlagDescription                           = "description"
	FlagDescriptionWithAlias                  = FlagDescription + ", desc"
	FlagOwnerEmail                            = "owner_email"
	FlagOwnerEmailWithAlias                   = FlagOwnerEmail + ", oe"
	FlagRetention                             = "retention"
	FlagRetentionWithAlias                    = FlagRetention + ", rd"
	FlagHistoryArchivalState                  = "history_archival_state"
	FlagHistoryArchivalStateWithAlias         = FlagHistoryArchivalState + ", has"
	FlagHistoryArchivalURI                    = "history_uri"
	FlagHistoryArchivalURIWithAlias           = FlagHistoryArchivalURI + ", huri"
	FlagHeartbeatedWithin                     = "heartbeated_within"
	FlagVisibilityArchivalState               = "visibility_archival_state"
	FlagVisibilityArchivalStateWithAlias      = FlagVisibilityArchivalState + ", vas"
	FlagVisibilityArchivalURI                 = "visibility_uri"
	FlagVisibilityArchivalURIWithAlias        = FlagVisibilityArchivalURI + ", vuri"
	FlagName                                  = "name"
	FlagNameWithAlias                         = FlagName + ", n"
	FlagOutputFilename                        = "output_filename"
	FlagOutputFilenameWithAlias               = FlagOutputFilename + ", of"
	FlagOutputFormat                          = "output"
	FlagQueryType                             = "query_type"
	FlagQueryTypeWithAlias                    = FlagQueryType + ", qt"
	FlagQueryRejectCondition                  = "query_reject_condition"
	FlagQueryRejectConditionWithAlias         = FlagQueryRejectCondition + ", qrc"
	FlagShowDetail                            = "show_detail"
	FlagShowDetailWithAlias                   = FlagShowDetail + ", sd"
	FlagActiveClusterName                     = "active_cluster"
	FlagActiveClusterNameWithAlias            = FlagActiveClusterName + ", ac"
	FlagClusters                              = "clusters"
	FlagClustersWithAlias                     = FlagClusters + ", cl"
	FlagClusterMembershipRole                 = "role"
	FlagIsGlobalNamespace                     = "global_namespace"
	FlagIsGlobalNamespaceWithAlias            = FlagIsGlobalNamespace + ", gd"
	FlagPromoteNamespace                      = "promote_namespace"
	FlagPromoteNamespaceWithAlias             = FlagPromoteNamespace + ", pn"
	FlagNamespaceData                         = "namespace_data"
	FlagNamespaceDataWithAlias                = FlagNamespaceData + ", dmd"
	FlagEventID                               = "event_id"
	FlagEventIDWithAlias                      = FlagEventID + ", eid"
	FlagActivityID                            = "activity_id"
	FlagActivityIDWithAlias                   = FlagActivityID + ", aid"
	FlagMaxFieldLength                        = "max_field_length"
	FlagMaxFieldLengthWithAlias               = FlagMaxFieldLength + ", maxl"
	FlagSkipErrorMode                         = "skip_errors"
	FlagSkipErrorModeWithAlias                = FlagSkipErrorMode + ", serr"
	FlagElasticsearchURL                      = "url"
	FlagElasticsearchUsername                 = "es-username"
	FlagElasticsearchPassword                 = "es-password"
	FlagElasticsearchIndex                    = "index"
	FlagMemoKey                               = "memo_key"
	FlagMemo                                  = "memo"
	FlagMemoFile                              = "memo_file"
	FlagSearchAttributeKey                    = "search_attr_key"
	FlagSearchAttributeValue                  = "search_attr_value"
	FlagAddBadBinary                          = "add_bad_binary"
	FlagRemoveBadBinary                       = "remove_bad_binary"
	FlagResetType                             = "reset_type"
	FlagResetReapplyType                      = "reset_reapply_type"
	FlagResetPointsOnly                       = "reset_points_only"
	FlagResetBadBinaryChecksum                = "reset_bad_binary_checksum"
	FlagListQuery                             = "query"
	FlagListQueryWithAlias                    = FlagListQuery + ", q"
	FlagBatchType                             = "batch_type"
	FlagBatchTypeWithAlias                    = FlagBatchType + ", bt"
	FlagSignalName                            = "signal_name"
	FlagSignalNameWithAlias                   = FlagSignalName + ", sig"
	FlagTaskID                                = "task_id"
	FlagTaskType                              = "task_type"
	FlagMinTaskID                             = "min_task_id"
	FlagMaxTaskID                             = "max_task_id"
	FlagTaskVisibilityTimestamp               = "task_timestamp"
	FlagMinVisibilityTimestamp                = "min_visibility_ts"
	FlagMaxVisibilityTimestamp                = "max_visibility_ts"
	FlagStartingRPS                           = "starting_rps"
	FlagRPS                                   = "rps"
	FlagJobID                                 = "job_id"
	FlagJobIDWithAlias                        = FlagJobID + ", jid"
	FlagYes                                   = "yes"
	FlagServiceConfigDir                      = "service_config_dir"
	FlagServiceConfigDirWithAlias             = FlagServiceConfigDir + ", scd"
	FlagServiceEnv                            = "service_env"
	FlagServiceEnvWithAlias                   = FlagServiceEnv + ", se"
	FlagServiceZone                           = "service_zone"
	FlagServiceZoneWithAlias                  = FlagServiceZone + ", sz"
	FlagEnableTLS                             = "tls"
	FlagTLSCertPath                           = "tls_cert_path"
	FlagTLSKeyPath                            = "tls_key_path"
	FlagTLSCaPath                             = "tls_ca_path"
	FlagTLSDisableHostVerification            = "tls_disable_host_verification"
	FlagTLSServerName                         = "tls_server_name"
	FlagTLSRootCaData                         = "tls_ca_data"
	FlagTLSForceEnable                        = "tls_force_enable"
	FlagDLQType                               = "dlq_type"
	FlagDLQTypeWithAlias                      = FlagDLQType + ", dt"
	FlagMaxMessageCount                       = "max_message_count"
	FlagMaxMessageCountWithAlias              = FlagMaxMessageCount + ", mmc"
	FlagLastMessageID                         = "last_message_id"
	FlagConcurrency                           = "concurrency"
	FlagReportRate                            = "report_rate"
	FlagLowerShardBound                       = "lower_shard_bound"
	FlagUpperShardBound                       = "upper_shard_bound"
	FlagInputDirectory                        = "input_directory"
	FlagAutoConfirm                           = "auto_confirm"
	FlagDataConverterPlugin                   = "data_converter_plugin"
	FlagDataConverterPluginWithAlias          = FlagDataConverterPlugin + ", dcp"
	FlagWebURL                                = "web_ui_url"
	FlagCodecEndpoint                         = "codec_endpoint"
	FlagCodecAuth                             = "codec_auth"
	FlagHeadersProviderPlugin                 = "headers_provider_plugin"
	FlagHeadersProviderPluginWithAlias        = FlagHeadersProviderPlugin + ", hpp"
	FlagHeadersProviderPluginOptions          = "headers_provider_plugin_options"
	FlagHeadersProviderPluginOptionsWithAlias = FlagHeadersProviderPluginOptions + ", hppo"
	FlagType                                  = "type"
	FlagTypeWithAlias                         = FlagType + ", t"
	FlagVersion                               = "version"
	FlagPort                                  = "port"
	FlagConnectionEnable                      = "enable_connection"
	FlagConnectionEnableWithAlias             = FlagConnectionEnable + ", ec"
	FlagScheduleID                            = "schedule_id"
	FlagScheduleIDWithAlias                   = FlagScheduleID + ", sid, s"
	FlagOverlapPolicy                         = "overlap_policy"
	FlagCalendar                              = "calendar"
	FlagInterval                              = "interval"
	FlagStartTime                             = "start_time"
	FlagEndTime                               = "end_time"
	FlagJitter                                = "jitter"
	FlagTimeZone                              = "time_zone"
	FlagNotes                                 = "notes"
	FlagPauseOnFailure                        = "pause_on_failure"
	FlagPause                                 = "pause"
	FlagUnpause                               = "unpause"
	FlagRemainingActions                      = "remaining_actions"
	FlagCatchupWindow                         = "catchup_window"
	FlagSearchAttribute                       = "search_attribute"

	FlagProtoType  = "type"
	FlagHexData    = "hex_data"
	FlagHexFile    = "hex_file"
	FlagBinaryFile = "binary_file"
	FlagBase64Data = "base64_data"
	FlagBase64File = "base64_file"

	FlagSkipSchemaUpdate = "skip-schema-update"
)

Flags used to specify cli command line arguments

Variables

This section is empty.

Functions

func AdminAddOrUpdateRemoteCluster

func AdminAddOrUpdateRemoteCluster(c *cli.Context)

AdminAddOrUpdateRemoteCluster is used to add or update remote cluster information

func AdminAddSearchAttributes

func AdminAddSearchAttributes(c *cli.Context)

AdminAddSearchAttributes to add search attributes

func AdminDBClean

func AdminDBClean(c *cli.Context)

AdminDBClean is the command to clean up executions

func AdminDBScan

func AdminDBScan(c *cli.Context)

AdminDBScan is used to scan over all executions in database and detect corruptions

func AdminDecodeBase64

func AdminDecodeBase64(c *cli.Context)

func AdminDecodeProto

func AdminDecodeProto(c *cli.Context)

func AdminDeleteWorkflow

func AdminDeleteWorkflow(c *cli.Context)

AdminDeleteWorkflow calls admin workflow delete API to force delete a workflow's mutable state, history, and visibility records as long as it's possible. It should only be used as a troubleshooting tool since no additional check will be done before the deletion. (e.g. if a child workflow has recorded its result in the parent workflow) Please use normal workflow delete command to gracefully delete a workflow execution.

func AdminDescribeCluster

func AdminDescribeCluster(c *cli.Context)

AdminDescribeCluster is used to dump information about the cluster

func AdminDescribeHistoryHost

func AdminDescribeHistoryHost(c *cli.Context)

AdminDescribeHistoryHost describes history host

func AdminDescribeShard

func AdminDescribeShard(c *cli.Context)

AdminDescribeShard describes shard by shard id

func AdminDescribeTask

func AdminDescribeTask(c *cli.Context)

AdminDescribeTask outputs the details of a task given Task Id, Task Type, Shard Id and Visibility Timestamp

func AdminDescribeTaskQueue

func AdminDescribeTaskQueue(c *cli.Context)

AdminDescribeTaskQueue displays poller and status information of task queue.

func AdminDescribeWorkflow

func AdminDescribeWorkflow(c *cli.Context)

AdminDescribeWorkflow describe a new workflow execution for admin

func AdminGetDLQMessages

func AdminGetDLQMessages(c *cli.Context)

AdminGetDLQMessages gets DLQ metadata

func AdminGetNamespaceIDOrName

func AdminGetNamespaceIDOrName(c *cli.Context)

AdminGetNamespaceIDOrName map namespace

func AdminGetSearchAttributes

func AdminGetSearchAttributes(c *cli.Context)

AdminGetSearchAttributes to print search attributes

func AdminGetShardID

func AdminGetShardID(c *cli.Context)

AdminGetShardID get shardID

func AdminListClusterMembers

func AdminListClusterMembers(c *cli.Context)

AdminListClusterMembers outputs a list of cluster members

func AdminListClusters

func AdminListClusters(c *cli.Context)

AdminListClusters is used to fetch information about all clusters

func AdminListGossipMembers

func AdminListGossipMembers(c *cli.Context)

AdminListGossipMembers outputs a list of gossip members

func AdminListShardTasks

func AdminListShardTasks(c *cli.Context)

AdminListShardTasks outputs a list of a tasks for given Shard and Task Category

func AdminListTaskQueueTasks

func AdminListTaskQueueTasks(c *cli.Context)

AdminListTaskQueueTasks displays task information

func AdminMergeDLQMessages

func AdminMergeDLQMessages(c *cli.Context)

AdminMergeDLQMessages merges message from DLQ

func AdminPurgeDLQMessages

func AdminPurgeDLQMessages(c *cli.Context)

AdminPurgeDLQMessages deletes messages from DLQ

func AdminRefreshWorkflowTasks

func AdminRefreshWorkflowTasks(c *cli.Context)

AdminRefreshWorkflowTasks refreshes all the tasks of a workflow

func AdminRemoveRemoteCluster

func AdminRemoveRemoteCluster(c *cli.Context)

AdminRemoveRemoteCluster is used to remove remote cluster information from the cluster

func AdminRemoveSearchAttributes

func AdminRemoveSearchAttributes(c *cli.Context)

AdminRemoveSearchAttributes to add search attributes

func AdminRemoveTask

func AdminRemoveTask(c *cli.Context)

AdminRemoveTask describes history host

func AdminShardManagement

func AdminShardManagement(c *cli.Context)

AdminShardManagement describes history host

func AdminShowWorkflow

func AdminShowWorkflow(c *cli.Context)

AdminShowWorkflow shows history

func BackfillSchedule added in v1.17.0

func BackfillSchedule(c *cli.Context) error

func BatchCancelV2 added in v1.17.1

func BatchCancelV2(c *cli.Context)

BatchCancelV2 cancel a list of workflows

func BatchSignalV2 added in v1.17.1

func BatchSignalV2(c *cli.Context)

BatchSignalV2 send a signal to a list of workflows

func BatchTerminateV2 added in v1.17.1

func BatchTerminateV2(c *cli.Context)

BatchTerminateV2 terminate a list of workflows

func CancelWorkflow

func CancelWorkflow(c *cli.Context)

CancelWorkflow cancels a workflow execution

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)

CompleteActivity completes an activity

func CountWorkflow

func CountWorkflow(c *cli.Context)

CountWorkflow count number of workflows

func CreateDefaultDBConfig

func CreateDefaultDBConfig(c *cli.Context) (config.DataStore, error)

CreateDefaultDBConfig return default DB configuration based on provided options

func CreatePersistenceFactory

func CreatePersistenceFactory(c *cli.Context) persistenceClient.Factory

CreatePersistenceFactory returns an initialized persistence managers factory. The factory allows to easily initialize concrete persistence managers to execute commands against persistence layer

func CreateSchedule added in v1.17.0

func CreateSchedule(c *cli.Context) error

func DataConverter

func DataConverter(c *cli.Context)

DataConverter provides a data converter over a websocket for Temporal web

func DeleteSchedule added in v1.17.0

func DeleteSchedule(c *cli.Context) error

func DescribeBatchJob

func DescribeBatchJob(c *cli.Context)

DescribeBatchJob describe the status of the batch job

func DescribeBatchJobV2 added in v1.17.1

func DescribeBatchJobV2(c *cli.Context)

DescribeBatchJobV2 describe the status of the batch job

func DescribeSchedule added in v1.17.0

func DescribeSchedule(c *cli.Context) error

func DescribeTaskQueue

func DescribeTaskQueue(c *cli.Context)

DescribeTaskQueue show pollers info of a given taskqueue

func DescribeWorkflow

func DescribeWorkflow(c *cli.Context)

DescribeWorkflow show information about the specified workflow execution

func DescribeWorkflowWithID

func DescribeWorkflowWithID(c *cli.Context)

DescribeWorkflowWithID show information about the specified workflow execution

func ErrorAndExit

func ErrorAndExit(msg string, err error)

ErrorAndExit print easy to understand error msg first then error detail in a new line

func FailActivity

func FailActivity(c *cli.Context)

FailActivity fails an activity

func GetHistory

func GetHistory(ctx context.Context, workflowClient sdkclient.Client, workflowID, runID string) (*historypb.History, error)

GetHistory helper method to iterate over all pages and return complete list of history events

func GetQPS

func GetQPS() int

GetQPS returns default queries per second

func GetSearchAttributes

func GetSearchAttributes(c *cli.Context)

GetSearchAttributes get valid search attributes

func GetValue

func GetValue(c *cli.Context) error

func HealthCheck

func HealthCheck(c *cli.Context)

HealthCheck check frontend health.

func HistoryEventToString

func HistoryEventToString(e *historypb.HistoryEvent, printFully bool, maxFieldLength int) string

HistoryEventToString convert HistoryEvent to string

func ListAllWorkflow

func ListAllWorkflow(c *cli.Context)

ListAllWorkflow list all workflow executions based on filters

func ListArchivedWorkflow

func ListArchivedWorkflow(c *cli.Context)

ListArchivedWorkflow lists archived workflow executions based on filters

func ListBatchJobs

func ListBatchJobs(c *cli.Context)

ListBatchJobs list the started batch jobs

func ListBatchJobsV2 added in v1.17.1

func ListBatchJobsV2(c *cli.Context)

ListBatchJobs list the started batch jobs

func ListSchedules added in v1.17.0

func ListSchedules(c *cli.Context) error

func ListTaskQueuePartitions

func ListTaskQueuePartitions(c *cli.Context)

ListTaskQueuePartitions gets all the taskqueue partition and host information.

func ListWorkflow

func ListWorkflow(c *cli.Context)

ListWorkflow list workflow executions based on filters

func NewCliApp

func NewCliApp() *cli.App

NewCliApp instantiates a new instance of the CLI application.

func NewContextWithCLIHeaders added in v1.16.1

func NewContextWithCLIHeaders() (context.Context, context.CancelFunc)

NewContextWithCLIHeaders creates context with version headers for CLI.

func NewContextWithTimeoutAndCLIHeaders added in v1.16.1

func NewContextWithTimeoutAndCLIHeaders(timeout time.Duration) (context.Context, context.CancelFunc)

NewContextWithTimeoutAndCLIHeaders creates context with timeout and version headers for CLI.

func ObserveHistory

func ObserveHistory(c *cli.Context)

ObserveHistory show the process of running workflow

func ObserveHistoryWithID

func ObserveHistoryWithID(c *cli.Context)

ObserveHistoryWithID show the process of running workflow

func QueryWorkflow

func QueryWorkflow(c *cli.Context)

QueryWorkflow query workflow execution

func QueryWorkflowUsingStackTrace

func QueryWorkflowUsingStackTrace(c *cli.Context)

QueryWorkflowUsingStackTrace query workflow execution using __stack_trace as query type

func ResetInBatch

func ResetInBatch(c *cli.Context)

ResetInBatch resets workflow in batch

func ResetWorkflow

func ResetWorkflow(c *cli.Context)

ResetWorkflow reset workflow

func RunWorkflow

func RunWorkflow(c *cli.Context)

RunWorkflow starts a new workflow execution and print workflow progress and result

func ScanAllWorkflow

func ScanAllWorkflow(c *cli.Context)

ScanAllWorkflow list all workflow executions using Scan API. It should be faster than ListAllWorkflow, but result are not sorted.

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 SetValue

func SetValue(c *cli.Context) error

func ShowHistory

func ShowHistory(c *cli.Context)

ShowHistory shows the history of given workflow execution based on workflowID and runID.

func ShowHistoryWithWID

func ShowHistoryWithWID(c *cli.Context)

ShowHistoryWithWID shows the history of given workflow with workflow_id

func SignalWorkflow

func SignalWorkflow(c *cli.Context)

SignalWorkflow signals a workflow execution

func StartBatchJob

func StartBatchJob(c *cli.Context)

StartBatchJob starts a batch job

func StartWorkflow

func StartWorkflow(c *cli.Context)

StartWorkflow starts a new workflow execution

func StopBatchJobV2 added in v1.17.1

func StopBatchJobV2(c *cli.Context)

StopBatchJobV2 stops a batch job

func TerminateBatchJob

func TerminateBatchJob(c *cli.Context)

TerminateBatchJob stops abatch job

func TerminateWorkflow

func TerminateWorkflow(c *cli.Context)

TerminateWorkflow terminates a workflow execution

func ToggleSchedule added in v1.17.0

func ToggleSchedule(c *cli.Context) error

func TriggerSchedule added in v1.17.0

func TriggerSchedule(c *cli.Context) error

func UpdateSchedule added in v1.17.0

func UpdateSchedule(c *cli.Context) error

Types

type BufferedWriter

type BufferedWriter interface {
	Add(interface{})
	Flush()
}

BufferedWriter is used to buffer entities and write them to a file

func NewBufferedWriter

func NewBufferedWriter(f *os.File) BufferedWriter

NewBufferedWriter constructs a new BufferedWriter

type CleanOutputDirectories

type CleanOutputDirectories struct {
	ShardCleanReportDirectoryPath    string
	SuccessfullyCleanedDirectoryPath string
	FailedCleanedDirectoryPath       string
}

CleanOutputDirectories are the directory paths for output of clean

type CleanProgressReport

type CleanProgressReport struct {
	NumberOfShardsFinished     int
	TotalExecutionsCount       int64
	SuccessfullyCleanedCount   int64
	FailedCleanedCount         int64
	TotalDBRequests            int64
	DatabaseRPS                float64
	NumberOfShardCleanFailures int64
	ShardsPerHour              float64
	ExecutionsPerHour          float64
}

CleanProgressReport represents the aggregate progress of the clean job. It is periodically printed to stdout

type ClientFactory

type ClientFactory interface {
	FrontendClient(c *cli.Context) workflowservice.WorkflowServiceClient
	AdminClient(c *cli.Context) adminservice.AdminServiceClient
	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 CorruptedExceptionMetadata

type CorruptedExceptionMetadata struct {
	CorruptionType CorruptionType
	Note           string
	Details        string
}

CorruptedExceptionMetadata is the metadata for a CorruptedExecution

type CorruptedExecution

type CorruptedExecution struct {
	ShardID                    int32
	NamespaceID                string
	WorkflowID                 string
	RunID                      string
	NextEventID                int64
	TreeID                     primitives.UUID
	BranchID                   primitives.UUID
	CloseStatus                enumspb.WorkflowExecutionStatus
	CorruptedExceptionMetadata CorruptedExceptionMetadata
}

CorruptedExecution is the type that gets written to CorruptedExecutionFile

type CorruptionType

type CorruptionType string

CorruptionType indicates the type of corruption that was found

type CorruptionTypeBreakdown

type CorruptionTypeBreakdown struct {
	TotalHistoryMissing                            int64
	TotalInvalidFirstEvent                         int64
	TotalOpenExecutionInvalidCurrentExecution      int64
	TotalActivityIdsCorrupted                      int64
	PercentageHistoryMissing                       float64
	PercentageInvalidStartEvent                    float64
	PercentageOpenExecutionInvalidCurrentExecution float64
	PercentageActivityIdsCorrupted                 float64
}

CorruptionTypeBreakdown breaks down counts and percentages of corruption types

type ExecutionCheckFailure

type ExecutionCheckFailure struct {
	ShardID     int32
	NamespaceID string
	WorkflowID  string
	RunID       string
	Note        string
	Details     string
}

ExecutionCheckFailure is the type that gets written to ExecutionCheckFailureFile

type HttpGetter

type HttpGetter interface {
	Get(url string) (resp *http.Response, err error)
}

HttpGetter defines http.Client.Get(...) as an interface so we can mock it

type PayloadRequest

type PayloadRequest struct {
	RequestID string `json:"requestId"`
	Payload   string `json:"payload"`
}

type PayloadResponse

type PayloadResponse struct {
	RequestID string `json:"requestId"`
	Content   string `json:"content"`
}

type ProgressReport

type ProgressReport struct {
	NumberOfShardsFinished           int
	TotalExecutionsCount             int64
	CorruptedExecutionsCount         int64
	ExecutionCheckFailureCount       int64
	NumberOfShardScanFailures        int64
	PercentageCorrupted              float64
	PercentageCheckFailure           float64
	Rates                            Rates
	CorruptionTypeBreakdown          CorruptionTypeBreakdown
	ShardExecutionCountsDistribution ShardExecutionCountsDistribution
}

ProgressReport contains metadata about the scan for all shards which have been finished This is periodically printed to stdout

type Rates

type Rates struct {
	TimeRunning       string
	DatabaseRPS       float64
	TotalDBRequests   int64
	ShardsPerHour     float64
	ExecutionsPerHour float64
}

Rates indicates the rates at which the scan is progressing

type ScanOutputDirectories

type ScanOutputDirectories struct {
	ShardScanReportDirectoryPath       string
	ExecutionCheckFailureDirectoryPath string
	CorruptedExecutionDirectoryPath    string
}

ScanOutputDirectories are the directory paths for output of scan

type ShardCleanOutputFiles

type ShardCleanOutputFiles struct {
	ShardCleanReportFile    *os.File
	SuccessfullyCleanedFile *os.File
	FailedCleanedFile       *os.File
}

ShardCleanOutputFiles are the files produced for a clean of a single shard

type ShardCleanReport

type ShardCleanReport struct {
	ShardID         int32
	TotalDBRequests int64
	Handled         *ShardCleanReportHandled
	Failure         *ShardCleanReportFailure
}

ShardCleanReport represents the result of cleaning a single shard

type ShardCleanReportFailure

type ShardCleanReportFailure struct {
	Note    string
	Details string
}

ShardCleanReportFailure is the part of ShardCleanReport that indicates a failure to clean some or all of the executions found in corruption file

type ShardCleanReportHandled

type ShardCleanReportHandled struct {
	TotalExecutionsCount     int64
	SuccessfullyCleanedCount int64
	FailedCleanedCount       int64
}

ShardCleanReportHandled is the part of ShardCleanReport of executions which were read from corruption file and were attempted to be deleted

type ShardExecutionCountsDistribution

type ShardExecutionCountsDistribution struct {
	MinExecutions     *int64
	MaxExecutions     *int64
	AverageExecutions int64
}

ShardExecutionCountsDistribution breaks down stats on the distribution of executions per shard

type ShardScanOutputFiles

type ShardScanOutputFiles struct {
	ShardScanReportFile       *os.File
	ExecutionCheckFailureFile *os.File
	CorruptedExecutionFile    *os.File
}

ShardScanOutputFiles are the files produced for a scan of a single shard

type ShardScanReport

type ShardScanReport struct {
	ShardID         int32
	TotalDBRequests int64
	Scanned         *ShardScanReportExecutionsScanned
	Failure         *ShardScanReportFailure
}

ShardScanReport is the type that gets written to ShardScanReportFile

type ShardScanReportExecutionsScanned

type ShardScanReportExecutionsScanned struct {
	TotalExecutionsCount       int64
	CorruptedExecutionsCount   int64
	ExecutionCheckFailureCount int64
	CorruptionTypeBreakdown    CorruptionTypeBreakdown
}

ShardScanReportExecutionsScanned is the part of the ShardScanReport of executions which were scanned

type ShardScanReportFailure

type ShardScanReportFailure struct {
	Note    string
	Details string
}

ShardScanReportFailure is the part of the ShardScanReport that indicates failure to scan all or part of the shard

type VerificationResult

type VerificationResult int

VerificationResult is the result of running a verification

const (
	// VerificationResultNoCorruption indicates that no corruption was found
	VerificationResultNoCorruption VerificationResult = iota
	// VerificationResultDetectedCorruption indicates a corruption was found
	VerificationResultDetectedCorruption
	// VerificationResultCheckFailure indicates there was a failure to check corruption
	VerificationResultCheckFailure
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL