workflow

package
v0.0.0-...-d4d4b81 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedWorkflowRuns

type AggregatedWorkflowRuns struct {
	TotalFilteredWorkflowRuns []TotalFilteredData    `bson:"total_filtered_workflow_runs"`
	FlattenedWorkflowRuns     []FlattenedWorkflowRun `bson:"flattened_workflow_runs"`
}

type AggregatedWorkflows

type AggregatedWorkflows struct {
	TotalFilteredWorkflows []TotalFilteredData    `bson:"total_filtered_workflows"`
	ScheduledWorkflows     []ChaosWorkFlowRequest `bson:"scheduled_workflows"`
}

type ChaosWorkFlowRequest

type ChaosWorkFlowRequest struct {
	WorkflowID          string              `bson:"workflow_id"`
	WorkflowManifest    string              `bson:"workflow_manifest"`
	CronSyntax          string              `bson:"cronSyntax"`
	WorkflowName        string              `bson:"workflow_name"`
	WorkflowDescription string              `bson:"workflow_description"`
	Weightages          []*WeightagesInput  `bson:"weightages"`
	WorkflowType        ChaosWorkflowType   `bson:"type"`
	IsCustomWorkflow    bool                `bson:"isCustomWorkflow"`
	UpdatedAt           string              `bson:"updated_at"`
	CreatedAt           string              `bson:"created_at"`
	ProjectID           string              `bson:"project_id"`
	ClusterID           string              `bson:"cluster_id"`
	ClusterName         string              `bson:"cluster_name"`
	ClusterType         string              `bson:"cluster_type"`
	WorkflowRuns        []*ChaosWorkflowRun `bson:"workflow_runs"`
	IsRemoved           bool                `bson:"isRemoved"`
	LastUpdatedBy       string              `bson:"last_updated_by"`
}

ChaosWorkFlowRequest contains the required fields to be stored in the database for a chaos workflow input

type ChaosWorkflowRun

type ChaosWorkflowRun struct {
	WorkflowRunID      string   `bson:"workflow_run_id"`
	LastUpdated        string   `bson:"last_updated"`
	Phase              string   `bson:"phase"`
	ResiliencyScore    *float64 `bson:"resiliency_score,string,omitempty"`
	ExperimentsPassed  *int     `bson:"experiments_passed,string,omitempty"`
	ExperimentsFailed  *int     `bson:"experiments_failed,string,omitempty"`
	ExperimentsAwaited *int     `bson:"experiments_awaited,string,omitempty"`
	ExperimentsStopped *int     `bson:"experiments_stopped,string,omitempty"`
	ExperimentsNA      *int     `bson:"experiments_na,string,omitempty"`
	TotalExperiments   *int     `bson:"total_experiments,string,omitempty"`
	ExecutionData      string   `bson:"execution_data"`
	Completed          bool     `bson:"completed"`
	IsRemoved          *bool    `bson:"isRemoved"`
	ExecutedBy         string   `bson:"executed_by"`
}

ChaosWorkflowRun contains the required fields to be stored in the database for a workflow run

type ChaosWorkflowType

type ChaosWorkflowType string
const (
	Workflow    ChaosWorkflowType = "workflow"
	ChaosEngine ChaosWorkflowType = "chaosengine"
)

type FlattenedWorkflowRun

type FlattenedWorkflowRun struct {
	WorkflowID       string             `bson:"workflow_id"`
	CronSyntax       string             `bson:"cronSyntax"`
	WorkflowName     string             `bson:"workflow_name"`
	Weightages       []*WeightagesInput `bson:"weightages"`
	IsCustomWorkflow bool               `bson:"isCustomWorkflow"`
	UpdatedAt        string             `bson:"updated_at"`
	CreatedAt        string             `bson:"created_at"`
	ProjectID        string             `bson:"project_id"`
	ClusterID        string             `bson:"cluster_id"`
	ClusterName      string             `bson:"cluster_name"`
	ClusterType      string             `bson:"cluster_type"`
	WorkflowRuns     ChaosWorkflowRun   `bson:"workflow_runs"`
	IsRemoved        bool               `bson:"isRemoved"`
}

type Operator

type Operator struct {
	// contains filtered or unexported fields
}

Operator is the model for cluster collection

func NewChaosWorkflowOperator

func NewChaosWorkflowOperator(mongodbOperator mongodb.MongoOperator) *Operator

NewChaosWorkflowOperator returns a new instance of Operator

func (*Operator) GetAggregateWorkflows

func (c *Operator) GetAggregateWorkflows(pipeline mongo.Pipeline) (*mongo.Cursor, error)

GetAggregateWorkflows takes a mongo pipeline to retrieve the workflow details from the database

func (*Operator) GetWorkflow

func (c *Operator) GetWorkflow(query bson.D) (ChaosWorkFlowRequest, error)

GetWorkflow takes a query parameter to retrieve the workflow details from the database

func (*Operator) GetWorkflows

func (c *Operator) GetWorkflows(query bson.D) ([]ChaosWorkFlowRequest, error)

GetWorkflows takes a query parameter to retrieve the workflow details from the database

func (*Operator) GetWorkflowsByClusterID

func (c *Operator) GetWorkflowsByClusterID(clusterID string) ([]ChaosWorkFlowRequest, error)

GetWorkflowsByClusterID takes a clusterID parameter to retrieve the workflow details from the database

func (*Operator) InsertChaosWorkflow

func (c *Operator) InsertChaosWorkflow(chaosWorkflow ChaosWorkFlowRequest) error

InsertChaosWorkflow takes details of a workflow and inserts into the database collection

func (*Operator) UpdateChaosWorkflow

func (c *Operator) UpdateChaosWorkflow(query bson.D, update bson.D) error

UpdateChaosWorkflow takes query and update parameters to update the workflow details in the database

func (*Operator) UpdateWorkflowRun

func (c *Operator) UpdateWorkflowRun(workflowID string, wfRun ChaosWorkflowRun) (int, error)

UpdateWorkflowRun takes workflowID and wfRun parameters to update the workflow run details in the database

type TotalFilteredData

type TotalFilteredData struct {
	Count int `bson:"count"`
}

type WeightagesInput

type WeightagesInput struct {
	ExperimentName string `bson:"experiment_name"`
	Weightage      int    `bson:"weightage"`
}

WeightagesInput contains the required fields to be stored in the database for a weightages input

Jump to

Keyboard shortcuts

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