cli

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 60 Imported by: 0

README

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

Quick Start

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

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

Documentation

Index

Constants

View Source
const (
	FlagPort                              = "port"
	FlagUsername                          = "username"
	FlagPassword                          = "password"
	FlagKeyspace                          = "keyspace"
	FlagAddress                           = "address"
	FlagAddressWithAlias                  = FlagAddress + ", ad"
	FlagHistoryAddress                    = "history_address"
	FlagHistoryAddressWithAlias           = FlagHistoryAddress + ", had"
	FlagDomainID                          = "domain_id"
	FlagDomain                            = "domain"
	FlagDomainWithAlias                   = FlagDomain + ", do"
	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"
	FlagTaskList                          = "tasklist"
	FlagTaskListWithAlias                 = FlagTaskList + ", tl"
	FlagTaskListType                      = "tasklisttype"
	FlagTaskListTypeWithAlias             = FlagTaskListType + ", tlt"
	FlagWorkflowIDReusePolicy             = "workflowidreusepolicy"
	FlagWorkflowIDReusePolicyAlias        = FlagWorkflowIDReusePolicy + ", wrp"
	FlagCronSchedule                      = "cron"
	FlagWorkflowType                      = "workflow_type"
	FlagWorkflowTypeWithAlias             = FlagWorkflowType + ", wt"
	FlagWorkflowStatus                    = "status"
	FlagWorkflowStatusWithAlias           = FlagWorkflowStatus + ", s"
	FlagExecutionTimeout                  = "execution_timeout"
	FlagExecutionTimeoutWithAlias         = FlagExecutionTimeout + ", et"
	FlagDecisionTimeout                   = "decision_timeout"
	FlagDecisionTimeoutWithAlias          = FlagDecisionTimeout + ", dt"
	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"
	FlagSkipCurrent                       = "skip_current_open"
	FlagInputTopic                        = "input_topic"
	FlagInputTopicWithAlias               = FlagInputTopic + ", it"
	FlagHostFile                          = "host_file"
	FlagCluster                           = "cluster"
	FlagInputCluster                      = "input_cluster"
	FlagStartOffset                       = "start_offset"
	FlagTopic                             = "topic"
	FlagGroup                             = "group"
	FlagResult                            = "result"
	FlagIdentity                          = "identity"
	FlagDetail                            = "detail"
	FlagReason                            = "reason"
	FlagReasonWithAlias                   = FlagReason + ", re"
	FlagOpen                              = "open"
	FlagOpenWithAlias                     = FlagOpen + ", op"
	FlagMore                              = "more"
	FlagMoreWithAlias                     = FlagMore + ", m"
	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"
	FlagRetentionDays                     = "retention"
	FlagRetentionDaysWithAlias            = FlagRetentionDays + ", rd"
	FlagEmitMetric                        = "emit_metric"
	FlagEmitMetricWithAlias               = FlagEmitMetric + ", em"
	FlagHistoryArchivalStatus             = "history_archival_status"
	FlagHistoryArchivalStatusWithAlias    = FlagHistoryArchivalStatus + ", has"
	FlagHistoryArchivalURI                = "history_uri"
	FlagHistoryArchivalURIWithAlias       = FlagHistoryArchivalURI + ", huri"
	FlagVisibilityArchivalStatus          = "visibility_archival_status"
	FlagVisibilityArchivalStatusWithAlias = FlagVisibilityArchivalStatus + ", 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"
	FlagShowDetail                        = "show_detail"
	FlagShowDetailWithAlias               = FlagShowDetail + ", sd"
	FlagActiveClusterName                 = "active_cluster"
	FlagActiveClusterNameWithAlias        = FlagActiveClusterName + ", ac"
	FlagClusters                          = "clusters"
	FlagClustersWithAlias                 = FlagClusters + ", cl"
	FlagIsGlobalDomain                    = "global_domain"
	FlagIsGlobalDomainWithAlias           = FlagIsGlobalDomain + ", gd"
	FlagDomainData                        = "domain_data"
	FlagDomainDataWithAlias               = FlagDomainData + ", dmd"
	FlagEventID                           = "event_id"
	FlagEventIDWithAlias                  = FlagEventID + ", eid"
	FlagActivityID                        = "activity_id"
	FlagActivityIDWithAlias               = FlagActivityID + ", aid"
	FlagMaxFieldLength                    = "max_field_length"
	FlagMaxFieldLengthWithAlias           = FlagMaxFieldLength + ", maxl"
	FlagSecurityToken                     = "security_token"
	FlagSecurityTokenWithAlias            = FlagSecurityToken + ", st"
	FlagSkipErrorMode                     = "skip_errors"
	FlagSkipErrorModeWithAlias            = FlagSkipErrorMode + ", serr"
	FlagHeadersMode                       = "headers"
	FlagHeadersModeWithAlias              = FlagHeadersMode + ", he"
	FlagMessageType                       = "message_type"
	FlagMessageTypeWithAlias              = FlagMessageType + ", mt"
	FlagURL                               = "url"
	FlagMuttleyDestination                = "muttely_destination"
	FlagMuttleyDestinationWithAlias       = FlagMuttleyDestination + ", muttley"
	FlagIndex                             = "index"
	FlagBatchSize                         = "batch_size"
	FlagBatchSizeWithAlias                = FlagBatchSize + ", bs"
	FlagMemoKey                           = "memo_key"
	FlagMemo                              = "memo"
	FlagMemoFile                          = "memo_file"
	FlagSearchAttributesKey               = "search_attr_key"
	FlagSearchAttributesVal               = "search_attr_value"
	FlagSearchAttributesType              = "search_attr_type"
	FlagAddBadBinary                      = "add_bad_binary"
	FlagRemoveBadBinary                   = "remove_bad_binary"
	FlagResetType                         = "reset_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"
	FlagRPS                               = "rps"
	FlagJobID                             = "job_id"
	FlagJobIDWithAlias                    = FlagJobID + ", jid"
	FlagYes                               = "yes"
)

Flags used to specify cli command line arguments

View Source
const (
	// Version is the controlled version string. It should be updated every time
	// before we release a new version.
	Version = "0.8.0"
)

Variables

This section is empty.

Functions

func AdminAddSearchAttribute added in v0.6.0

func AdminAddSearchAttribute(c *cli.Context)

AdminAddSearchAttribute to whitelist search attribute

func AdminCatIndices added in v0.5.3

func AdminCatIndices(c *cli.Context)

AdminCatIndices cat indices for ES cluster

func AdminDeleteWorkflow added in v0.5.0

func AdminDeleteWorkflow(c *cli.Context)

AdminDeleteWorkflow describe a new workflow execution for admin

func AdminDescribeHistoryHost added in v0.3.13

func AdminDescribeHistoryHost(c *cli.Context)

AdminDescribeHistoryHost describes history host

func AdminDescribeTaskList added in v0.5.7

func AdminDescribeTaskList(c *cli.Context)

AdminDescribeTaskList displays poller and status information of task list.

func AdminDescribeWorkflow added in v0.3.13

func AdminDescribeWorkflow(c *cli.Context)

AdminDescribeWorkflow describe a new workflow execution for admin

func AdminGetDomainIDOrName added in v0.5.0

func AdminGetDomainIDOrName(c *cli.Context)

AdminGetDomainIDOrName map domain

func AdminGetShardID added in v0.5.0

func AdminGetShardID(c *cli.Context)

AdminGetShardID get shardID

func AdminIndex added in v0.5.3

func AdminIndex(c *cli.Context)

AdminIndex used to bulk insert message from kafka parse

func AdminKafkaParse added in v0.5.0

func AdminKafkaParse(c *cli.Context)

AdminKafkaParse parses the output of k8read and outputs replication tasks

func AdminMergeDLQ added in v0.5.0

func AdminMergeDLQ(c *cli.Context)

AdminMergeDLQ publish replication tasks from DLQ or JSON file

func AdminPurgeTopic added in v0.5.0

func AdminPurgeTopic(c *cli.Context)

AdminPurgeTopic is used to purge kafka topic

func AdminRereplicate added in v0.5.0

func AdminRereplicate(c *cli.Context)

AdminRereplicate parses will re-publish replication tasks to topic

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

func DescribeBatchJob(c *cli.Context)

DescribeBatchJob describe the status of the batch job

func DescribeDomain

func DescribeDomain(c *cli.Context)

DescribeDomain updates a domain

func DescribeTaskList

func DescribeTaskList(c *cli.Context)

DescribeTaskList show pollers info of a given tasklist

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

func GenerateReport(c *cli.Context)

GenerateReport generate report for an aggregation query to ES

func GetHistory

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

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

func GetSearchAttributes added in v0.5.9

func GetSearchAttributes(c *cli.Context)

GetSearchAttributes get valid search attributes

func HistoryEventToString

func HistoryEventToString(e *s.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 ListBatchJobs added in v0.7.0

func ListBatchJobs(c *cli.Context)

ListBatchJobs list the started batch jobs

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 RegisterDomain

func RegisterDomain(c *cli.Context)

RegisterDomain register a domain

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

func SetFactory(factory ClientFactory)

SetFactory is used to set the ClientFactory global

func SetRequiredDomainDataKeys added in v0.3.14

func SetRequiredDomainDataKeys(keys []string)

SetRequiredDomainDataKeys will set requiredDomainDataKeys

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

func UpdateDomain

func UpdateDomain(c *cli.Context)

UpdateDomain updates a domain

Types

type ClientFactory added in v0.5.0

type ClientFactory interface {
	ClientFrontendClient(c *cli.Context) clientFrontend.Interface
	ServerFrontendClient(c *cli.Context) serverFrontend.Interface
	ServerAdminClient(c *cli.Context) serverAdmin.Interface
}

ClientFactory is used to construct rpc clients

func NewClientFactory added in v0.5.0

func NewClientFactory() ClientFactory

NewClientFactory creates a new ClientFactory

type ClustersConfig added in v0.5.0

type ClustersConfig struct {
	Clusters map[string]messaging.ClusterConfig
	TLS      messaging.TLS
}

ClustersConfig describes the kafka clusters

type JSONHistorySerializer

type JSONHistorySerializer struct{}

JSONHistorySerializer is used to encode history event in JSON

func (*JSONHistorySerializer) Deserialize

func (j *JSONHistorySerializer) Deserialize(data []byte) (*s.History, error)

Deserialize deserializes history

func (*JSONHistorySerializer) Serialize

func (j *JSONHistorySerializer) Serialize(h *s.History) ([]byte, error)

Serialize serializes history.

Jump to

Keyboard shortcuts

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