cli

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 98 Imported by: 0

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"
	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"
	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"

	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 added in v1.14.0

func AdminAddOrUpdateRemoteCluster(c *cli.Context)

AdminAddOrUpdateRemoteCluster is used to add or update remote cluster information

func AdminAddSearchAttributes added in v1.10.0

func AdminAddSearchAttributes(c *cli.Context)

AdminAddSearchAttributes to add search attributes

func AdminDBClean added in v0.27.0

func AdminDBClean(c *cli.Context)

AdminDBClean is the command to clean up executions

func AdminDBScan added in v0.27.0

func AdminDBScan(c *cli.Context)

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

func AdminDecodeBase64 added in v1.5.7

func AdminDecodeBase64(c *cli.Context)

func AdminDecodeProto added in v1.5.7

func AdminDecodeProto(c *cli.Context)

func AdminDeleteWorkflow added in v0.5.0

func AdminDeleteWorkflow(c *cli.Context)

AdminDeleteWorkflow delete a workflow execution from Cassandra and visibility document from Elasticsearch.

func AdminDescribeCluster added in v0.27.0

func AdminDescribeCluster(c *cli.Context)

AdminDescribeCluster is used to dump information about the cluster

func AdminDescribeHistoryHost added in v0.3.13

func AdminDescribeHistoryHost(c *cli.Context)

AdminDescribeHistoryHost describes history host

func AdminDescribeShard added in v0.27.0

func AdminDescribeShard(c *cli.Context)

AdminDescribeShard describes shard by shard id

func AdminDescribeTask added in v0.27.0

func AdminDescribeTask(c *cli.Context)

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

func AdminDescribeTaskQueue added in v0.27.0

func AdminDescribeTaskQueue(c *cli.Context)

AdminDescribeTaskQueue displays poller and status information of task queue.

func AdminDescribeWorkflow added in v0.3.13

func AdminDescribeWorkflow(c *cli.Context)

AdminDescribeWorkflow describe a new workflow execution for admin

func AdminGetDLQMessages added in v0.27.0

func AdminGetDLQMessages(c *cli.Context)

AdminGetDLQMessages gets DLQ metadata

func AdminGetSearchAttributes added in v1.10.0

func AdminGetSearchAttributes(c *cli.Context)

AdminGetSearchAttributes to print search attributes

func AdminGetShardID added in v0.5.0

func AdminGetShardID(c *cli.Context)

AdminGetShardID get shardID

func AdminListClusterMembers added in v1.14.0

func AdminListClusterMembers(c *cli.Context)

AdminListClusterMembers outputs a list of cluster members

func AdminListClusters added in v1.15.0

func AdminListClusters(c *cli.Context)

AdminListClusters is used to fetch information about all clusters

func AdminListGossipMembers added in v0.27.0

func AdminListGossipMembers(c *cli.Context)

AdminListGossipMembers outputs a list of gossip members

func AdminListShardTasks added in v1.14.0

func AdminListShardTasks(c *cli.Context)

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

func AdminListTaskQueueTasks added in v0.27.0

func AdminListTaskQueueTasks(c *cli.Context)

AdminListTaskQueueTasks displays task information

func AdminMergeDLQMessages added in v0.27.0

func AdminMergeDLQMessages(c *cli.Context)

AdminMergeDLQMessages merges message from DLQ

func AdminPurgeDLQMessages added in v0.27.0

func AdminPurgeDLQMessages(c *cli.Context)

AdminPurgeDLQMessages deletes messages from DLQ

func AdminRefreshWorkflowTasks added in v0.27.0

func AdminRefreshWorkflowTasks(c *cli.Context)

AdminRefreshWorkflowTasks refreshes all the tasks of a workflow

func AdminRemoveRemoteCluster added in v1.14.0

func AdminRemoveRemoteCluster(c *cli.Context)

AdminRemoveRemoteCluster is used to remove remote cluster information from the cluster

func AdminRemoveSearchAttributes added in v1.11.0

func AdminRemoveSearchAttributes(c *cli.Context)

AdminRemoveSearchAttributes to add search attributes

func AdminRemoveTask added in v0.27.0

func AdminRemoveTask(c *cli.Context)

AdminRemoveTask describes history host

func AdminShardManagement added in v0.27.0

func AdminShardManagement(c *cli.Context)

AdminShardManagement describes history host

func AdminShowWorkflow added in v0.5.0

func AdminShowWorkflow(c *cli.Context)

AdminShowWorkflow shows history

func CancelWorkflow

func CancelWorkflow(c *cli.Context)

CancelWorkflow cancels a workflow execution

func ColorEvent added in v0.3.11

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 added in v0.5.7

func CompleteActivity(c *cli.Context)

CompleteActivity completes an activity

func CountWorkflow added in v0.6.0

func CountWorkflow(c *cli.Context)

CountWorkflow count number of workflows

func CreateDefaultDBConfig added in v0.27.0

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

CreateDefaultDBConfig return default DB configuration based on provided options

func CreatePersistenceFactory added in v0.27.0

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 DataConverter added in v1.10.0

func DataConverter(c *cli.Context)

DataConverter provides a data converter over a websocket for Temporal web

func DescribeBatchJob added in v0.7.0

func DescribeBatchJob(c *cli.Context)

DescribeBatchJob describe the status of the batch job

func DescribeTaskQueue added in v0.27.0

func DescribeTaskQueue(c *cli.Context)

DescribeTaskQueue show pollers info of a given taskqueue

func DescribeWorkflow added in v0.3.11

func DescribeWorkflow(c *cli.Context)

DescribeWorkflow show information about the specified workflow execution

func DescribeWorkflowWithID added in v0.3.11

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 added in v0.5.7

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 added in v0.27.0

func GetQPS(...dynamicconfig.FilterOption) int

GetQPS returns default queries per second

func GetSearchAttributes added in v0.5.9

func GetSearchAttributes(c *cli.Context)

GetSearchAttributes get valid search attributes

func HealthCheck added in v1.5.0

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 added in v0.3.11

func ListAllWorkflow(c *cli.Context)

ListAllWorkflow list all workflow executions based on filters

func ListArchivedWorkflow added in v0.27.0

func ListArchivedWorkflow(c *cli.Context)

ListArchivedWorkflow lists archived workflow executions based on filters

func ListBatchJobs added in v0.7.0

func ListBatchJobs(c *cli.Context)

ListBatchJobs list the started batch jobs

func ListTaskQueuePartitions added in v0.27.0

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 ObserveHistory added in v0.3.11

func ObserveHistory(c *cli.Context)

ObserveHistory show the process of running workflow

func ObserveHistoryWithID added in v0.3.11

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 added in v0.5.8

func ResetInBatch(c *cli.Context)

ResetInBatch resets workflow in batch

func ResetWorkflow added in v0.5.2

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 added in v0.27.0

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 added in v0.5.0

func SetFactory(factory ClientFactory)

SetFactory is used to set the ClientFactory global

func SetRequiredNamespaceDataKeys added in v0.27.0

func SetRequiredNamespaceDataKeys(keys []string)

SetRequiredNamespaceDataKeys will set requiredNamespaceDataKeys

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 added in v0.7.0

func StartBatchJob(c *cli.Context)

StartBatchJob starts a batch job

func StartWorkflow

func StartWorkflow(c *cli.Context)

StartWorkflow starts a new workflow execution

func TerminateBatchJob added in v0.7.0

func TerminateBatchJob(c *cli.Context)

TerminateBatchJob stops abatch job

func TerminateWorkflow

func TerminateWorkflow(c *cli.Context)

TerminateWorkflow terminates a workflow execution

Types

type BufferedWriter added in v0.27.0

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

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

func NewBufferedWriter added in v0.27.0

func NewBufferedWriter(f *os.File) BufferedWriter

NewBufferedWriter constructs a new BufferedWriter

type CleanOutputDirectories added in v0.27.0

type CleanOutputDirectories struct {
	ShardCleanReportDirectoryPath    string
	SuccessfullyCleanedDirectoryPath string
	FailedCleanedDirectoryPath       string
}

CleanOutputDirectories are the directory paths for output of clean

type CleanProgressReport added in v0.27.0

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 added in v0.5.0

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 added in v0.5.0

func NewClientFactory() ClientFactory

NewClientFactory creates a new ClientFactory

type CorruptedExceptionMetadata added in v0.27.0

type CorruptedExceptionMetadata struct {
	CorruptionType CorruptionType
	Note           string
	Details        string
}

CorruptedExceptionMetadata is the metadata for a CorruptedExecution

type CorruptedExecution added in v0.27.0

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 added in v0.27.0

type CorruptionType string

CorruptionType indicates the type of corruption that was found

type CorruptionTypeBreakdown added in v0.27.0

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 added in v0.27.0

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 added in v1.12.0

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 added in v1.10.0

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

type PayloadResponse added in v1.10.0

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

type ProgressReport added in v0.27.0

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 added in v0.27.0

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 added in v0.27.0

type ScanOutputDirectories struct {
	ShardScanReportDirectoryPath       string
	ExecutionCheckFailureDirectoryPath string
	CorruptedExecutionDirectoryPath    string
}

ScanOutputDirectories are the directory paths for output of scan

type ShardCleanOutputFiles added in v0.27.0

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 added in v0.27.0

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

ShardCleanReport represents the result of cleaning a single shard

type ShardCleanReportFailure added in v0.27.0

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 added in v0.27.0

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 added in v0.27.0

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

ShardExecutionCountsDistribution breaks down stats on the distribution of executions per shard

type ShardScanOutputFiles added in v0.27.0

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 added in v0.27.0

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

ShardScanReport is the type that gets written to ShardScanReportFile

type ShardScanReportExecutionsScanned added in v0.27.0

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 added in v0.27.0

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 added in v0.27.0

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