api

package
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 21 Imported by: 0

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

View Source
const AllowedKeyspaceNameRegex = "[a-zA-Z0-9_]+"
View Source
const CapillariesIcons100x100 = `` /* 18873-byte string literal not displayed */
View Source
const ProhibitedKeyspaceNameRegex = "^system"

Variables

This section is empty.

Functions

func DropKeyspace

func DropKeyspace(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string) error

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 GetCapigraphDiagram(scriptDef *sc.ScriptDef, showIdx bool, showFields bool, useRootPalette bool, nodeStringColorMap map[string]int32) string

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

func IsSystemKeyspaceName(keyspace string) bool

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.

func StopRun

func StopRun(logger *l.CapiLogger, cqlSession *gocql.Session, keyspace string, runId int16, comment string) error

Used by Webapi and Toolbelt (stop_run command)

Types

type DiagramType added in v1.1.23

type DiagramType string
const (
	DiagramIndexes   DiagramType = "indexes"
	DiagramFields    DiagramType = "fields"
	DiagramRunStatus DiagramType = "run_status"
)

Jump to

Keyboard shortcuts

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