keptn

package
v0.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 23 Imported by: 53

Documentation

Index

Constants

View Source
const ActionFinishedEventType = "sh.keptn.event.action.finished"

ActionFinishedEventType is a CloudEvent for indicating that an action has been finished

View Source
const ActionStartedEventType = "sh.keptn.event.action.started"

ActionStartedEventType is a CloudEvent for confirming the start of an action

View Source
const ActionTriggeredEventType = "sh.keptn.event.action.triggered"

ActionTriggeredEventType is a CloudEvent for triggering actions

View Source
const ApprovalFinishedEventType = "sh.keptn.event.approval.finished"

ApprovalFinishedEventType is a CloudEvent confirming an open approval

View Source
const ApprovalTriggeredEventType = "sh.keptn.event.approval.triggered"

ApprovalTriggeredEvent is a CloudEvent triggering a new approval

View Source
const ConfigurationChangeEventType = "sh.keptn.event.configuration.change"

ConfigurationChangeEventType is a CloudEvent type for changing the configuration

View Source
const ConfigureMonitoringEventType = "sh.keptn.event.monitoring.configure"

ConfigureMonitoringEventType is a CloudEvent for configuring monitoring

View Source
const DeploymentFinishedEventType = "sh.keptn.events.deployment-finished"

DeploymentFinishedEventType is a CloudEvent for indicating that the deployment has finished

View Source
const EvaluationDoneEventType = "sh.keptn.events.evaluation-done"

EvaluationDoneEventType is a CloudEvent for indicating that the evaluation has finished

View Source
const InternalGetSLIDoneEventType = "sh.keptn.internal.event.get-sli.done"

InternalGetSLIDoneEventType is a CloudEvent for submitting SLI values

View Source
const InternalGetSLIEventType = "sh.keptn.internal.event.get-sli"

InternalGetSLIEventType is a CloudEvent for retrieving SLI values

View Source
const InternalProjectCreateEventType = "sh.keptn.internal.event.project.create"

InternalProjectCreateEventType is a CloudEvent type for creating a new project

View Source
const InternalProjectDeleteEventType = "sh.keptn.internal.event.project.delete"

InternalProjectDeleteEventType is a CloudEvent type for deleting a project

View Source
const InternalServiceCreateEventType = "sh.keptn.internal.event.service.create"

InternalServiceCreateEventType is a CloudEvent type for creating a new service

View Source
const InternalServiceDeleteEventType = "sh.keptn.internal.event.service.delete"

InternalServiceDeleteEventType is a CloudEvent type for deleting a new service

View Source
const MAX_SEND_RETRIES = 3
View Source
const ProblemEventType = "sh.keptn.events.problem"

ProblemEventType is a CloudEvent type to inform about a problem

View Source
const ProblemOpenEventType = "sh.keptn.event.problem.open"

ProblemOpenEventType is a CloudEvent type to inform about an open problem

View Source
const RemediationFinishedEventType = "sh.keptn.event.remediation.finished"

RemediationFinishedEventType is a CloudEvent to indicate that the status of a remediation has been changed

View Source
const RemediationStartedEventType = "sh.keptn.event.remediation.started"

RemediationTriggeredEventType is a CloudEvent to indicate the start of a remediation

View Source
const RemediationStatusChangedEventType = "sh.keptn.event.remediation.status.changed"

RemediationStatusChangedEventType is a CloudEvent to indicate that the status of a remediation has been changed

View Source
const RemediationTriggeredEventType = "sh.keptn.event.remediation.triggered"

RemediationTriggeredEventType is a CloudEvent for triggering remediations

View Source
const StartEvaluationEventType = "sh.keptn.event.start-evaluation"

StartEvaluationEventType is a CloudEvent for retrieving SLI values

View Source
const TestsFinishedEventType = "sh.keptn.events.tests-finished"

TestsFinishedEventType is a CloudEvent for indicating that tests have finished

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(command string, args []string) (string, error)

ExecuteCommand exectues the command using the args

func ExecuteCommandInDirectory

func ExecuteCommandInDirectory(command string, args []string, directory string) (string, error)

ExecuteCommandInDirectory executes the command using the args within the specified directory

Types

type ActionFinishedEventData added in v0.7.0

type ActionFinishedEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Action describes the type of action
	Action ActionResult `json:"action"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

ActionFinishedEventData contains information about the execution of an action

type ActionInfo added in v0.7.0

type ActionInfo struct {
	// Name is the name of the action
	Name string `json:"name"`
	// Action determines the type of action to be executed
	Action string `json:"action"`
	// Description contains the description of the action
	Description string `json:"description"`
	// Value contains the value of the action
	Value interface{} `json:"value,omitempty"`
}

ActionInfo contains information about the action to be performed

type ActionResult added in v0.7.0

type ActionResult struct {
	Result ActionResultType `json:"result"`
	Status ActionStatusType `json:"status"`
}

ActionResult contains information about the execution of an action

type ActionResultType added in v0.7.0

type ActionResultType string
const (
	ActionResultPass   ActionResultType = "pass"
	ActionResultFailed ActionResultType = "failed"
)

type ActionStartedEventData added in v0.7.0

type ActionStartedEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

ActionStartedEventData contains information about an action.started event

type ActionStatusType added in v0.7.0

type ActionStatusType string
const (
	ActionStatusSucceeded ActionStatusType = "succeeded"
	ActionStatusErrored   ActionStatusType = "errored"
	ActionStatusUnknown   ActionStatusType = "unknown"
)

type ActionTriggeredEventData added in v0.7.0

type ActionTriggeredEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Action describes the type of action
	Action ActionInfo `json:"action"`
	// Problem contains details about the problem
	Problem ProblemDetails `json:"problem"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

ActionTriggeredEventData contains information about an action.triggered event

type ApprovalData added in v0.7.0

type ApprovalData struct {
	Result string `json:"result"`
	Status string `json:"status"`
}

type ApprovalFinishedEventData added in v0.7.0

type ApprovalFinishedEventData struct {
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage        string  `json:"stage"`
	TestStrategy *string `json:"teststrategy,omitempty"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy *string `json:"deploymentstrategy,omitempty"`
	// Tag of the new deployed artifact
	Tag string `json:"tag,omitempty"`
	// Image of the new deployed artifact
	Image string `json:"image,omitempty"`
	// Labels contains labels
	Labels   map[string]string `json:"labels"`
	Approval ApprovalData      `json:"approval"`
}

ApprovalTriggeredEventData contains information about an approval.finished event

type ApprovalStrategy added in v0.7.0

type ApprovalStrategy int

ApprovalStrategy is used in the shipyard for either automatic or manual approvals

const (
	// Automatic: A step is approved in an automatic fashion
	Automatic ApprovalStrategy = iota
	// Manual: A step is approved in a manual fashion
	Manual
)

func (ApprovalStrategy) MarshalYAML added in v0.7.0

func (s ApprovalStrategy) MarshalYAML() (interface{}, error)

MarshalYAML marshalls the enum as a quoted json string

func (ApprovalStrategy) String added in v0.7.0

func (a ApprovalStrategy) String() string

func (*ApprovalStrategy) UnmarshalYAML added in v0.7.0

func (s *ApprovalStrategy) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshalls a quoted json string to the enum value

type ApprovalStrategyStruct added in v0.7.0

type ApprovalStrategyStruct struct {
	Pass    ApprovalStrategy `json:"pass,omitempty" yaml:"pass"`
	Warning ApprovalStrategy `json:"warning,omitempty" yaml:"warning"`
}

type ApprovalTriggeredEventData added in v0.7.0

type ApprovalTriggeredEventData struct {
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage        string  `json:"stage"`
	TestStrategy *string `json:"teststrategy,omitempty"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy *string `json:"deploymentstrategy,omitempty"`
	// Tag of the new deployed artifact
	Tag string `json:"tag,omitempty"`
	// Image of the new deployed artifact
	Image string `json:"image,omitempty"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`

	// Result is the result of an evaluation; possible values are: pass, warning, fail
	Result string `json:"result"`
}

ApprovalTriggeredEventData contains information about an approval.triggered event

type Canary

type Canary struct {
	// Value represents the traffic percentage on the canary
	Value int32 `json:"value,omitempty"`
	// Action represents the action of the canary
	Action CanaryAction `json:"action"`
}

Canary describes the new configuration in a canary release

type CanaryAction

type CanaryAction int

CanaryAction describes the excution of a canary release

const (
	// Set is used for setting a new traffic weight for the canary
	Set CanaryAction = iota
	// Promote is used for promoting the canary
	Promote
	// Discard is used for discarding the canary
	Discard
)

func (CanaryAction) MarshalJSON

func (s CanaryAction) MarshalJSON() ([]byte, error)

MarshalJSON marshalls the enum as a quoted json string

func (CanaryAction) String

func (s CanaryAction) String() string

func (*CanaryAction) UnmarshalJSON

func (s *CanaryAction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshalls a quoted json string to the enum value

type ConfigurationChangeEventData

type ConfigurationChangeEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// ValuesCanary contains new Helm values for canary
	ValuesCanary map[string]interface{} `json:"valuesCanary,omitempty"`
	// Canary contains a new configuration for canary releases
	Canary *Canary `json:"canary,omitempty"`
	// FileChangesUserChart provides new content for the user chart.
	// The key value pairs represent the URI within the chart (i.e. the key) and the new content (i.e. the value).
	FileChangesUserChart map[string]string `json:"fileChangesUserChart,omitempty"`
	// FileChangesGeneratedChart provides new content for the generated chart.
	// The key value pairs represent the URI within the chart (i.e. the key) and the new content (i.e. the value).
	FileChangesGeneratedChart map[string]string `json:"fileChangesGeneratedChart,omitempty"`
	// FileChangesUmbrellaChart provides new content for the umbrella chart.
	// The key value pairs represent the URI within the chart (i.e. the key) and the new content (i.e. the value).
	FileChangesUmbrellaChart map[string]string `json:"fileChangesUmbrellaChart,omitempty"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

ConfigurationChangeEventData represents the data for changing the service configuration

type ConfigureMonitoringEventData

type ConfigureMonitoringEventData struct {
	Type string `json:"type"`
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
}

ConfigureMonitoringEventData represents the data necessary to configure monitoring for a service

type Datastore

type Datastore interface {
	// contains filtered or unexported methods
}

Datastore represents the interface for accessing Keptn's datastore

type DeploymentFinishedEventData

type DeploymentFinishedEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Service is the name of the new service
	Service string `json:"service"`
	// TestStrategy is the testing strategy
	TestStrategy string `json:"teststrategy"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy string `json:"deploymentstrategy"`
	// Tag of the new deployed artifact
	Tag string `json:"tag"`
	// Image of the new deployed artifact
	Image string `json:"image"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
	// DeploymentURILocal contains the local URL
	DeploymentURILocal string `json:"deploymentURILocal,omitempty"`
	// DeploymentURIPublic contains the public URL
	DeploymentURIPublic string `json:"deploymentURIPublic,omitempty"`
}

DeploymentFinishedEventData represents the data for a deployment finished event

type DeploymentStrategy

type DeploymentStrategy int

DeploymentStrategy describes how a keptn-managed service is deployed

const (
	// Direct stores the chart which results in the
	Direct DeploymentStrategy = iota + 1

	// Duplicate generates a second chart in order to duplicate the deployments
	Duplicate
)

func GetDeploymentStrategy

func GetDeploymentStrategy(deploymentStrategy string) (DeploymentStrategy, error)

GetDeploymentStrategy tries to parse the deployment strategy into the enum If the provided deployment strategy is unsupported, an error is returned

func (DeploymentStrategy) MarshalJSON

func (s DeploymentStrategy) MarshalJSON() ([]byte, error)

MarshalJSON marshals the enum as a quoted json string

func (DeploymentStrategy) String

func (s DeploymentStrategy) String() string

func (*DeploymentStrategy) UnmarshalJSON

func (s *DeploymentStrategy) UnmarshalJSON(b []byte) error

UnmarshalJSON unmashals a quoted json string to the enum value

type EvaluationDetails

type EvaluationDetails struct {
	TimeStart        string                 `json:"timeStart"`
	TimeEnd          string                 `json:"timeEnd"`
	Result           string                 `json:"result"`
	Score            float64                `json:"score"`
	SLOFileContent   string                 `json:"sloFileContent"`
	IndicatorResults []*SLIEvaluationResult `json:"indicatorResults"`
	ComparedEvents   []string               `json:"comparedEvents"`
}

type EvaluationDoneEventData

type EvaluationDoneEventData struct {
	EvaluationDetails *EvaluationDetails `json:"evaluationdetails"`
	// Result is the result of an evaluation; possible values are: pass, warning, fail
	Result string `json:"result"`
	// Project is the name of the project
	Project string `json:"project"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Service is the name of the new service
	Service string `json:"service"`
	// TestStrategy is the testing strategy
	TestStrategy string `json:"teststrategy"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy string `json:"deploymentstrategy"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

EvaluationDoneEventData contains information about evaluation results

type EventHandler

type EventHandler struct {
	BaseURL    string
	AuthToken  string
	AuthHeader string
	HTTPClient *http.Client
	Scheme     string
}

EventHandler handles event

func NewEventHandler

func NewEventHandler(baseURL string) *EventHandler

NewEventHandler returns a new EventHandler

func (*EventHandler) GetEvent

func (e *EventHandler) GetEvent(keptnContext string, eventType string) (*models.KeptnContextExtendedCE, *models.Error)

GetEvent returns the latest event of a specific event type and from a specific Keptn context

type InternalGetSLIDoneEventData

type InternalGetSLIDoneEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Service is the name of the new service
	Service string `json:"service"`
	Start   string `json:"start"`
	End     string `json:"end"`
	// TestStrategy is the testing strategy
	TestStrategy    string       `json:"teststrategy"`
	IndicatorValues []*SLIResult `json:"indicatorValues"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy string `json:"deploymentstrategy"`
	Deployment         string `json:"deployment"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

InternalGetSLIDoneEventData contains a list of SLIs and their values

type InternalGetSLIEventData

type InternalGetSLIEventData struct {
	// SLIProvider is the name of the SLI provider which is queried
	SLIProvider string `json:"sliProvider"`
	// Project is the name of the project
	Project string `json:"project"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Service is the name of the new service
	Service string `json:"service"`
	Start   string `json:"start"`
	End     string `json:"end"`
	// TestStrategy is the testing strategy
	TestStrategy string `json:"teststrategy"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy string       `json:"deploymentstrategy"`
	Deployment         string       `json:"deployment"`
	Indicators         []string     `json:"indicators"`
	CustomFilters      []*SLIFilter `json:"customFilters"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

InternalGetSLIEventData describes a set of SLIs to be retrieved by a data source

type Keptn

type Keptn struct {
	keptn.KeptnBase
}

func NewKeptn

func NewKeptn(incomingEvent *cloudevents.Event, opts keptn.KeptnOpts) (*Keptn, error)

func (*Keptn) GetShipyard

func (k *Keptn) GetShipyard() (*Shipyard, error)

GetShipyard returns the shipyard definition of a project

func (*Keptn) ReplaceKeptnPlaceholders

func (k *Keptn) ReplaceKeptnPlaceholders(input string) string

replaces $ placeholders with actual values $CONTEXT, $EVENT, $SOURCE $PROJECT, $STAGE, $SERVICE, $DEPLOYMENT $TESTSTRATEGY $LABEL.XXXX -> will replace that with a label called XXXX $ENV.XXXX -> will replace that with an env variable called XXXX

func (*Keptn) SendActionFinishedEvent added in v0.7.1

func (k *Keptn) SendActionFinishedEvent(incomingEvent *cloudevents.Event, actionResult ActionResult, labels map[string]string, eventSource string) error

SendActionFinishedEvent sends a CloudEvent with type "sh.keptn.event.action.finished"

func (*Keptn) SendActionStartedEvent added in v0.7.1

func (k *Keptn) SendActionStartedEvent(incomingEvent *cloudevents.Event, labels map[string]string, eventSource string) error

SendActionStartedEvent sends a CloudEvent with type "sh.keptn.event.action.started"

func (*Keptn) SendCloudEvent

func (k *Keptn) SendCloudEvent(event cloudevents.Event) error

SendCloudEvent sends a cloudevent to the event broker

func (*Keptn) SendConfigurationChangeEvent

func (k *Keptn) SendConfigurationChangeEvent(incomingEvent *cloudevents.Event, labels map[string]string, eventSource string) error

SendConfigurationChangeEvent sends a CloudEvent with type "sh.keptn.event.configuration.change"

func (*Keptn) SendDeploymentFinishedEvent

func (k *Keptn) SendDeploymentFinishedEvent(incomingEvent *cloudevents.Event, teststrategy, deploymentstrategy, image, tag, deploymentURILocal, deploymentURIPublic string, labels map[string]string, eventSource string) error

SendDeploymentFinishedEvent sends a CloudEvent with type "sh.keptn.events.deployment-finished"

func (*Keptn) SendInternalGetSLIDoneEvent

func (k *Keptn) SendInternalGetSLIDoneEvent(incomingEvent *cloudevents.Event, indicators []string, indicatorValues []*SLIResult, labels map[string]string, err error, eventSource string) error

Sends a GetSLIDoneEvent == "sh.keptn.internal.event.get-sli.done" if err != nil all indicators will be set noMetric and each metric will be be set the error message from error!

func (*Keptn) SendTestsFinishedEvent

func (k *Keptn) SendTestsFinishedEvent(incomingEvent *cloudevents.Event, teststrategy, deploymentstrategy string, startedAt time.Time, result string, labels map[string]string, eventSource string) error

SendTestsFinishedEvent sends a CloudEvent with type "sh.keptn.events.tests-finished"

type KeptnBaseEvent

type KeptnBaseEvent struct {
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage        string  `json:"stage"`
	TestStrategy *string `json:"teststrategy,omitempty"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy *string `json:"deploymentstrategy,omitempty"`
	// Tag of the new deployed artifact
	Tag *string `json:"tag,omitempty"`
	// Image of the new deployed artifact
	Image *string `json:"image,omitempty"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

KeptnBaseEvent contains properties that are shared among most Keptn events

func (KeptnBaseEvent) GetLabels

func (k KeptnBaseEvent) GetLabels() map[string]string

func (KeptnBaseEvent) GetProject

func (k KeptnBaseEvent) GetProject() string

func (KeptnBaseEvent) GetService

func (k KeptnBaseEvent) GetService() string

func (KeptnBaseEvent) GetStage

func (k KeptnBaseEvent) GetStage() string

type ProblemDetails added in v0.7.0

type ProblemDetails struct {
	// State is the state of the problem; possible values are: OPEN, RESOLVED
	State string `json:"State,omitempty"`
	// ProblemID is a unique system identifier of the reported problem
	ProblemID string `json:"ProblemID"`
	// ProblemTitle is the display number of the reported problem.
	ProblemTitle string `json:"ProblemTitle"`
	// ProblemDetails are all problem event details including root cause
	ProblemDetails json.RawMessage `json:"ProblemDetails"`
	// PID is a unique system identifier of the reported problem.
	PID string `json:"PID"`
	// ImpcatedEntity is an identifier of the impacted entity
	// ProblemURL is a back link to the original problem
	ProblemURL     string `json:"ProblemURL,omitempty"`
	ImpactedEntity string `json:"ImpactedEntity,omitempty"`
	// Tags is a comma separated list of tags that are defined for all impacted entities.
	Tags string `json:"Tags,omitempty"`
}

ProblemDetails contains information about a problem

type ProblemEventData

type ProblemEventData struct {
	// State is the state of the problem; possible values are: OPEN, RESOLVED
	State string `json:"State,omitempty"`
	// ProblemID is a unique system identifier of the reported problem
	ProblemID string `json:"ProblemID"`
	// ProblemTitle is the display number of the reported problem.
	ProblemTitle string `json:"ProblemTitle"`
	// ProblemDetails are all problem event details including root cause
	ProblemDetails json.RawMessage `json:"ProblemDetails"`
	// PID is a unique system identifier of the reported problem.
	PID string `json:"PID"`
	// ProblemURL is a back link to the original problem
	ProblemURL string `json:"ProblemURL,omitempty"`
	// ImpcatedEntity is an identifier of the impacted entity
	ImpactedEntity string `json:"ImpactedEntity,omitempty"`
	// Tags is a comma separated list of tags that are defined for all impacted entities.
	Tags string `json:"Tags,omitempty"`
	// Project is the name of the project
	Project string `json:"project,omitempty"`
	// Stage is the name of the stage
	Stage string `json:"stage,omitempty"`
	// Service is the name of the new service
	Service string `json:"service,omitempty"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

ProblemEventData represents the data for describing a problem

type ProjectCreateEventData

type ProjectCreateEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Shipyard is a base64 encoded string of the shipyard file
	Shipyard string `json:"shipyard"`
	// GitUser is the name of a git user of an upstream repository
	GitUser string `json:"gitUser,omitempty"`
	// GitToken is the authentication token for the git user
	GitToken string `json:"gitToken,omitempty"`
	// GitRemoteURL is the remote url of a repository
	GitRemoteURL string `json:"gitRemoteURL,omitempty"`
}

ProjectCreateEventData represents the data for creating a new project

type ProjectDeleteEventData

type ProjectDeleteEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
}

ProjectDeleteEventData represents the data for deleting a project

type Remediation

type Remediation struct {
	Name    string               `json:"name" yaml:"name"`
	Actions []*RemediationAction `json:"actions" yaml:"actions"`
}

Remediation represents a remediation Deprecated: A new spec for Remediation is available

type RemediationAction

type RemediationAction struct {
	Action string `json:"action" yaml:"action"`
	Value  string `json:"value" yaml:"value"`
}

RemediationAction represents a remediation action Deprecated: A new spec for RemediationAction is available

type RemediationFinished added in v0.7.0

type RemediationFinished struct {
	// Status describes the status
	Status RemediationStatusType `json:"status"`
	// Result describes the result
	Result RemediationResultType `json:"result"`
	// Message contains a message about the status
	Message string `json:"message"`
}

RemediationFinished describes a finished remediation

type RemediationFinishedEventData added in v0.7.0

type RemediationFinishedEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Problem contains details about the problem
	Problem ProblemDetails `json:"problem"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
	// Remediation describes the remediation
	Remediation RemediationFinished `json:"remediation"`
}

RemediationFinishedEventData is a CloudEvent to indicate that the status of a remediation has been changed

type RemediationResult added in v0.7.0

type RemediationResult struct {
	// ActionIndex is the index of the action
	ActionIndex int `json:"actionIndex"`
	// ActionName is the name of the action
	ActionName string `json:"actionName"`
}

RemediationStatus describes the status of a remediation

type RemediationResultType added in v0.7.0

type RemediationResultType string
const (
	RemediationResultPass   RemediationResultType = "pass"
	RemediationResultFailed RemediationResultType = "failed"
)

type RemediationStartedEventData added in v0.7.0

type RemediationStartedEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
	// Remediation describes the remediation
	Remediation interface{} `json:"remediation"`
}

RemediationTriggeredEventType is a CloudEvent to indicate the start of a remediation

type RemediationStatusChanged added in v0.7.0

type RemediationStatusChanged struct {
	// Status describes the status of the remediation
	Status RemediationStatusType `json:"status"`
	// RemediationResult indicates the result
	Result RemediationResult `json:"result"`
}

RemediationStatus describes the result and status of a remediation

type RemediationStatusChangedEventData added in v0.7.0

type RemediationStatusChangedEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
	// Remediation describes the remediation
	Remediation RemediationStatusChanged `json:"remediation"`
}

RemediationStatusChangedEventData is a CloudEvent to indicate that the status of a remediation has been changed

type RemediationStatusType added in v0.7.0

type RemediationStatusType string
const (
	RemediationStatusSucceeded RemediationStatusType = "succeeded"
	RemediationStatusErrored   RemediationStatusType = "errored"
	RemediationStatusUnknown   RemediationStatusType = "unknown"
)

type RemediationTriggeredEventData added in v0.7.0

type RemediationTriggeredEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// Problem contains details about the problem
	Problem ProblemDetails `json:"problem"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
	// Remediation describes the remediation
	Remediation interface{} `json:"remediation"`
}

RemediationTriggeredEventData is a CloudEvent for triggering remediations

type Remediations

type Remediations struct {
	Remediations []*Remediation `json:"remediations" yaml:"remediations"`
}

Remediations contains remediation definitions for a service Deprecated: A new spec for Remediations is available

type SLIEvaluationResult

type SLIEvaluationResult struct {
	Score   float64      `json:"score"`
	Value   *SLIResult   `json:"value"`
	Targets []*SLITarget `json:"targets"`
	Status  string       `json:"status"` // pass | warning | fail
}

type SLIFilter

type SLIFilter struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type SLIResult

type SLIResult struct {
	Metric  string  `json:"metric"`
	Value   float64 `json:"value"`
	Success bool    `json:"success"`
	Message string  `json:"message,omitempty"`
}

type SLITarget

type SLITarget struct {
	Criteria    string  `json:"criteria"`
	TargetValue float64 `json:"targetValue"`
	Violated    bool    `json:"violated"`
}

type SLO

type SLO struct {
	SLI     string         `json:"sli" yaml:"sli"`
	Pass    []*SLOCriteria `json:"pass" yaml:"pass"`
	Warning []*SLOCriteria `json:"warning" yaml:"warning"`
	Weight  int            `json:"weight" yaml:"weight"`
	KeySLI  bool           `json:"key_sli" yaml:"key_sli"`
}

type SLOComparison

type SLOComparison struct {
	CompareWith               string `json:"compare_with" yaml:"compare_with"`                           // single_result|several_results
	IncludeResultWithScore    string `json:"include_result_with_score" yaml:"include_result_with_score"` // all|pass|pass_or_warn
	NumberOfComparisonResults int    `json:"number_of_comparison_results" yaml:"number_of_comparison_results"`
	AggregateFunction         string `json:"aggregate_function" yaml:"aggregate_function"`
}

type SLOCriteria

type SLOCriteria struct {
	Criteria []string `json:"criteria" yaml:"criteria"`
}

type SLOScore

type SLOScore struct {
	Pass    string `json:"pass" yaml:"pass"`
	Warning string `json:"warning" yaml:"warning"`
}

type ServiceCreateEventData

type ServiceCreateEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// HelmChart are the data of a Helm chart packed as tgz and base64 encoded
	HelmChart string `json:"helmChart"`
	// DeploymentStrategies contains the deployment strategy for the stages
	DeploymentStrategies map[string]DeploymentStrategy `json:"deploymentStrategies"`
}

ServiceCreateEventData represents the data for creating a new service

type ServiceDeleteEventData added in v0.7.1

type ServiceDeleteEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
}

ServiceDeleteEventData represents the data for deleting a new service

type ServiceLevelObjectives

type ServiceLevelObjectives struct {
	SpecVersion string            `json:"spec_version" yaml:"spec_version"`
	Filter      map[string]string `json:"filter" yaml:"filter"`
	Comparison  *SLOComparison    `json:"comparison" yaml:"comparison"`
	Objectives  []*SLO            `json:"objectives" yaml:"objectives"`
	TotalScore  *SLOScore         `json:"total_score" yaml:"total_score"`
}

ServiceLevelObjectives describes SLO requirements

type Shipyard

type Shipyard struct {
	Stages []struct {
		Name                string                  `json:"name" yaml:"name"`
		DeploymentStrategy  string                  `json:"deployment_strategy" yaml:"deployment_strategy"`
		TestStrategy        string                  `json:"test_strategy,omitempty" yaml:"test_strategy"`
		RemediationStrategy string                  `json:"remediation_strategy,omitempty" yaml:"remediation_strategy"`
		ApprovalStrategy    *ApprovalStrategyStruct `json:"approval_strategy,omitempty" yaml:"approval_strategy"`
	} `json:"stages" yaml:"stages"`
}

Shipyard defines the name, deployment strategy and test strategy of each stage

type StartEvaluationEventData

type StartEvaluationEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// TestStrategy is the testing strategy
	TestStrategy string `json:"teststrategy"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy string `json:"deploymentstrategy"`
	// Start indicates the starting timestamp of the tests
	Start string `json:"start"`
	// End indicates the end timestamp of the tests
	End string `json:"end"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
}

StartEvaluationEventData represents the data for a test finished event

type TestsFinishedEventData

type TestsFinishedEventData struct {
	// Project is the name of the project
	Project string `json:"project"`
	// Service is the name of the new service
	Service string `json:"service"`
	// Stage is the name of the stage
	Stage string `json:"stage"`
	// TestStrategy is the testing strategy
	TestStrategy string `json:"teststrategy"`
	// DeploymentStrategy is the deployment strategy
	DeploymentStrategy string `json:"deploymentstrategy"`
	// Start indicates the starting timestamp of the tests
	Start string `json:"start"`
	// End indicates the end timestamp of the tests
	End string `json:"end"`
	// Labels contains labels
	Labels map[string]string `json:"labels"`
	// Result shows the status of the test
	Result string `json:"result"`
}

TestsFinishedEventData represents the data for a test finished event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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