Documentation ¶
Overview ¶
Package api contains functions used by Toolbelt, Webapi and third party solutions to start/stop runs and to analyze process state by reading node and batch status.
Index ¶
- Constants
- func DropKeyspace(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string) error
- func GetBatchHistoryForRunsAndNodes(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, ...) ([]*wfmodel.BatchHistoryEvent, error)
- func GetCapigraphDiagram(scriptDef *sc.ScriptDef, showIdx bool, showFields bool, useRootPalette bool, ...) string
- func GetDotDiagram(scriptDef *sc.ScriptDef, showIdx bool, showFields bool, ...) string
- func GetNodeHistoryForRun(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16) ([]*wfmodel.NodeHistoryEvent, error)
- func GetNodeHistoryForRuns(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, ...) ([]*wfmodel.NodeHistoryEvent, error)
- func GetRunHistory(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string) ([]*wfmodel.RunHistoryEvent, error)
- func GetRunNodeBatchHistory(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16, ...) ([]*wfmodel.BatchHistoryEvent, error)
- func GetRunProperties(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16) ([]*wfmodel.RunProperties, error)
- func GetTablesCql(script *sc.ScriptDef, keyspace string, runId int16, startNodeNames []string) string
- func HarvestRunLifespans(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, ...) (wfmodel.RunLifespanMap, error)
- func IsSystemKeyspaceName(keyspace string) bool
- func NodeBatchStatusToCapigraphColor(status wfmodel.NodeBatchStatusType) int32
- func NodeBatchStatusToDotColor(status wfmodel.NodeBatchStatusType) string
- func RunNode(envConfig *env.EnvConfig, logger *l.CapiLogger, nodeName string, runId int16, ...) (int16, error)
- func StartRun(envConfig *env.EnvConfig, logger *l.CapiLogger, amqpChannel *amqp.Channel, ...) (int16, error)
- func StopRun(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16, ...) error
- type DiagramType
Constants ¶
const AllowedKeyspaceNameRegex = "[a-zA-Z0-9_]+"
const CapillariesIcons100x100 = `` /* 18873-byte string literal not displayed */
const ProhibitedKeyspaceNameRegex = "^system"
Variables ¶
This section is empty.
Functions ¶
func DropKeyspace ¶
Used by Toolbelt and Webapi to drop Cassandra keyspace
func GetBatchHistoryForRunsAndNodes ¶ added in v1.1.16
func GetBatchHistoryForRunsAndNodes(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runIds []int16, scriptNodes []string) ([]*wfmodel.BatchHistoryEvent, error)
Used by Toolbelt (get_batch_history command) to retrieve batch status history for a subset of runs and nodes (not used in Webapi or tests at the moment, and may be deprecated)
func GetCapigraphDiagram ¶ added in v1.1.23
func GetDotDiagram ¶ added in v1.1.23
func GetDotDiagram(scriptDef *sc.ScriptDef, showIdx bool, showFields bool, nodeColorMap map[string]string) string
Used by Toolbelt and Webapi
func GetNodeHistoryForRun ¶ added in v1.1.0
func GetNodeHistoryForRun(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16) ([]*wfmodel.NodeHistoryEvent, error)
Used by Webapi to retrieve each node status history for a run
func GetNodeHistoryForRuns ¶ added in v1.1.16
func GetNodeHistoryForRuns(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runIds []int16) ([]*wfmodel.NodeHistoryEvent, error)
Used by Webapi and Toolbelt (get_node_history, get_run_status_diagram commands) to retrieve each node status history for multiple runs (used by WebUI main screen and in integration tests)
func GetRunHistory ¶
func GetRunHistory(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string) ([]*wfmodel.RunHistoryEvent, error)
Used by Toolbelt (get_run_history command) to retrieve run status history for a keyspace (used in integration tests)
func GetRunNodeBatchHistory ¶ added in v1.1.0
func GetRunNodeBatchHistory(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16, nodeName string) ([]*wfmodel.BatchHistoryEvent, error)
Used by Webapi to retrieve batch status history for a run/node pair
func GetRunProperties ¶ added in v1.1.0
func GetRunProperties(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16) ([]*wfmodel.RunProperties, error)
Used by Webapi to retrieve static run properties
func GetTablesCql ¶
func GetTablesCql(script *sc.ScriptDef, keyspace string, runId int16, startNodeNames []string) string
Used by Toolbelt get_table_cql cmd, prints out CQL to create all workflow tables and data/index tables for a specific keyspace. startNodeNames - list of script nodes that will be started immediately upon run start, helps find out which tables referenced by the script will be affected, to avoid unnecessary table creation.
func HarvestRunLifespans ¶ added in v1.1.0
func HarvestRunLifespans(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runIds []int16) (wfmodel.RunLifespanMap, error)
Used by Webapi to retrieve all runs that happened in this keyspace and their current status
func IsSystemKeyspaceName ¶ added in v1.1.0
Used by Webapi to ignore Cassandra system keyspaces
func NodeBatchStatusToCapigraphColor ¶ added in v1.1.23
func NodeBatchStatusToCapigraphColor(status wfmodel.NodeBatchStatusType) int32
func NodeBatchStatusToDotColor ¶ added in v1.1.23
func NodeBatchStatusToDotColor(status wfmodel.NodeBatchStatusType) string
func RunNode ¶
func RunNode(envConfig *env.EnvConfig, logger *l.CapiLogger, nodeName string, runId int16, scriptFilePath string, paramsFilePath string, cqlSession *gocql.Session, keyspace string) (int16, error)
Used by Toolbelt (exec_node command), can be used for testing Capillaries node execution without RabbitMQ wokflow
func StartRun ¶
func StartRun(envConfig *env.EnvConfig, logger *l.CapiLogger, amqpChannel *amqp.Channel, scriptFilePath string, paramsFilePath string, cqlSession *gocql.Session, keyspace string, startNodes []string, desc string) (int16, error)
Used by Webapi and Toolbelt (start_run command). This is the way to start Capillaries processing. startNodes parameter contains names of the script nodes to be executed right upon run start.
Types ¶
type DiagramType ¶ added in v1.1.23
type DiagramType string
const ( DiagramIndexes DiagramType = "indexes" DiagramFields DiagramType = "fields" DiagramRunStatus DiagramType = "run_status" )