v0_2_0

package
v0.8.0-test6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ActionTaskName = "action"
View Source
const ApprovalAutomatic = "automatic"

ApprovalAutomatic indicates an automatic approval strategy

View Source
const ApprovalManual = "manual"

ApprovalManual indicates a manual approval strategy

View Source
const ApprovalTaskName = "approval"
View Source
const ConfigureMonitoringTaskName = "configure-monitoring"
View Source
const DefaultHTTPEventEndpoint = "http://localhost:8081/event"
View Source
const DeploymentTaskName = "deployment"
View Source
const EvaluationTaskName = "evaluation"
View Source
const GetSLITaskName = "get-sli"
View Source
const MAX_SEND_RETRIES = 3
View Source
const ProjectCreateTaskName = "project.create"
View Source
const ProjectDeleteTaskName = "project.delete"
View Source
const ReleaseTaskName = "release"
View Source
const RemediationTaskName = "remediation"
View Source
const RollbackTaskName = "rollback"
View Source
const ServiceCreateTaskName = "service.create"
View Source
const ServiceDeleteTaskName = "service.delete"
View Source
const TestTaskName = "test"

Variables

This section is empty.

Functions

func Decode

func Decode(in, out interface{}) error

Decode decodes the given raw interface to the target pointer specified by the out parameter

func EventDataAs

func EventDataAs(in models.KeptnContextExtendedCE, out interface{}) error

EventDataAs decodes the event data of the given keptn cloud event to the target pointer specified by the out parameter

func GetEventTypeForTriggeredEvent

func GetEventTypeForTriggeredEvent(baseTriggeredEventType, newEventTypeSuffix string) (string, error)

func GetFinishedEventType

func GetFinishedEventType(task string) string

GetFinishedEventType returns for the given task the name of the finished event type

func GetInvalidatedEventType

func GetInvalidatedEventType(task string) string

GetInvalidatedEventType returns for the given task the name of the finished event type

func GetStartedEventType

func GetStartedEventType(task string) string

GetStartedEventType returns for the given task the name of the started event type

func GetStatusChangedEventType

func GetStatusChangedEventType(task string) string

GetStatusChangedEventType returns for the given task the name of the status.changed event type

func GetTriggeredEventType

func GetTriggeredEventType(task string) string

GetTriggeredEventType returns for the given task the name of the triggered event type

Types

type ActionData

type ActionData struct {
	// GitCommit indicates the action
	GitCommit string `json:"gitCommit,omitempty"`
}

type ActionFinishedEventData

type ActionFinishedEventData struct {
	EventData
	Action ActionData `json:"action"`
}

ActionFinishedEventData contains information about the execution of an action

type ActionInfo

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,omitempty"`
	// Value contains the value of the action
	Value interface{} `json:"value,omitempty"`
}

ActionInfo contains information about the action to be performed

type ActionStartedEventData

type ActionStartedEventData struct {
	EventData
}

ActionStartedEventData contains information about an action.started event

type ActionTriggeredEventData

type ActionTriggeredEventData struct {
	EventData
	// Action describes the type of action
	Action ActionInfo `json:"action"`
	// Problem contains details about the problem
	Problem ProblemDetails `json:"problem"`
}

ActionTriggeredEventData contains information about an action.triggered event

type Approval

type Approval struct {
	Pass    string `json:"pass" jsonschema:"enum=automatic,enum=manual"`
	Warning string `json:"warning" jsonschema:"enum=automatic,enum=manual"`
}

type ApprovalFinishedEventData

type ApprovalFinishedEventData struct {
	EventData
}

type ApprovalStartedEventData

type ApprovalStartedEventData struct {
	EventData
}

type ApprovalStatusChangedEventData

type ApprovalStatusChangedEventData struct {
	EventData
}

type ApprovalTriggeredEventData

type ApprovalTriggeredEventData struct {
	EventData
	// Approval contains information about the approval strategy
	Approval Approval `json:"approval"`
}

type ConfigurationChange

type ConfigurationChange struct {
	Values map[string]interface{} `json:"values"`
}

type ConfigureMonitoringFinishedEventData

type ConfigureMonitoringFinishedEventData struct {
	EventData
}

ConfigureMonitoringFinishedEventData godoc

type ConfigureMonitoringStartedEventData

type ConfigureMonitoringStartedEventData struct {
	EventData
}

ConfigureMonitoringStartedEventData godoc

type ConfigureMonitoringTriggeredEventData

type ConfigureMonitoringTriggeredEventData struct {
	EventData

	ConfigureMonitoring ConfigureMonitoringTriggeredParams `json:"configureMonitoring"`
}

ConfigureMonitoringTriggeredEventData godoc

type ConfigureMonitoringTriggeredParams

type ConfigureMonitoringTriggeredParams struct {
	Type string `json:"type"`
}

ConfigureMonitoringTriggeredParams godoc

type Deployment

type Deployment struct {
	// DeploymentNames gives the names of the deployments
	DeploymentNames []string `json:"deploymentNames"`
}

type DeploymentFinishedData

type DeploymentFinishedData struct {
	// DeploymentStrategy defines the used deployment strategy
	DeploymentStrategy string `json:"deploymentstrategy" jsonschema:"enum=direct,enum=blue_green_service,enum=user_managed"`
	// DeploymentURILocal contains the local URL
	DeploymentURIsLocal []string `json:"deploymentURIsLocal"`
	// DeploymentURIPublic contains the public URL
	DeploymentURIsPublic []string `json:"deploymentURIsPublic,omitempty"`
	// DeploymentNames gives the names of the deployments
	DeploymentNames []string `json:"deploymentNames"`
	// GitCommit indicates the version which should be deployed
	GitCommit string `json:"gitCommit"`
}

DeploymentFinishedData contains the data associated with a .deployment.finished event

type DeploymentFinishedEventData

type DeploymentFinishedEventData struct {
	EventData
	Deployment DeploymentFinishedData `json:"deployment"`
}

type DeploymentStartedEventData

type DeploymentStartedEventData struct {
	EventData
}

type DeploymentStatusChangedEventData

type DeploymentStatusChangedEventData struct {
	EventData
}

type DeploymentTriggeredData

type DeploymentTriggeredData struct {
	// DeploymentURILocal contains the local URL
	DeploymentURIsLocal []string `json:"deploymentURIsLocal"`
	// DeploymentURIPublic contains the public URL
	DeploymentURIsPublic []string `json:"deploymentURIsPublic,omitempty"`
	// DeploymentStrategy defines the used deployment strategy
	DeploymentStrategy string `json:"deploymentstrategy" jsonschema:"enum=direct,enum=blue_green_service,enum=user_managed"`
}

DeploymentTriggeredData contains the data associated with a .deployment.triggered event

type DeploymentTriggeredEventData

type DeploymentTriggeredEventData struct {
	EventData
	ConfigurationChange ConfigurationChange     `json:"configurationChange"`
	Deployment          DeploymentTriggeredData `json:"deployment"`
}

type Evaluation

type Evaluation struct {
	// Start indicates the starting timestamp of the tests
	Start string `json:"start"`
	// End indicates the end timestamp of the tests
	End string `json:"end"`
}

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,omitempty"`
	// GitCommit indicates the version which should be deployed
	GitCommit string `json:"gitCommit"`
}

type EvaluationFinishedEventData

type EvaluationFinishedEventData struct {
	EventData
	Evaluation EvaluationDetails `json:"evaluation,omitempty"`
}

type EvaluationStartedEventData

type EvaluationStartedEventData struct {
	EventData
}

type EvaluationStatusChangedEventData

type EvaluationStatusChangedEventData struct {
	EventData
}

type EvaluationTriggeredEventData

type EvaluationTriggeredEventData struct {
	EventData
	Test       Test       `json:"test"`
	Evaluation Evaluation `json:"evaluation"`
	Deployment Deployment `json:"deployment"`
}

type EventData

type EventData struct {
	Project string            `json:"project,omitempty"`
	Stage   string            `json:"stage,omitempty"`
	Service string            `json:"service,omitempty"`
	Labels  map[string]string `json:"labels,omitempty"`

	Status  StatusType `json:"status,omitempty" jsonschema:"enum=succeeded,enum=errored,enum=unknown"`
	Result  ResultType `json:"result,omitempty" jsonschema:"enum=pass,enum=warning,enum=fail"`
	Message string     `json:"message,omitempty"`
}

EventData contains mandatory fields of all Keptn CloudEvents

func (*EventData) GetLabels

func (e *EventData) GetLabels() map[string]string

func (*EventData) GetProject

func (e *EventData) GetProject() string

func (*EventData) GetService

func (e *EventData) GetService() string

func (*EventData) GetStage

func (e *EventData) GetStage() string

func (*EventData) SetLabels

func (e *EventData) SetLabels(labels map[string]string)

func (*EventData) SetProject

func (e *EventData) SetProject(project string)

func (*EventData) SetService

func (e *EventData) SetService(service string)

func (*EventData) SetStage

func (e *EventData) SetStage(stage string)

type GetSLI

type GetSLI struct {
	// SLIProvider defines the name of the monitoring solution that provides the SLIs
	SLIProvider string `json:"sliProvider"`
	// Start defines the start timestamp
	Start string `json:"start"`
	// End defines the end timestamp
	End string `json:"end"`
	// Indicators defines the SLI names
	Indicators []string `json:"indicators,omitempty"`
	// CustomFilters defines filters on the SLIs
	CustomFilters []*SLIFilter `json:"customFilters,omitempty"`
}

type GetSLIFinished

type GetSLIFinished struct {
	// Start defines the start timestamp
	Start string `json:"start"`
	// End defines the end timestamp
	End string `json:"end"`
	// IndicatorValues defines the fetched SLI values
	IndicatorValues []*SLIResult `json:"indicatorValues,omitempty"`
}

type GetSLIFinishedEventData

type GetSLIFinishedEventData struct {
	EventData
	GetSLI GetSLIFinished `json:"get-sli"`
}

type GetSLIStartedEventData

type GetSLIStartedEventData struct {
	EventData
}

type GetSLITriggeredEventData

type GetSLITriggeredEventData struct {
	EventData
	GetSLI     GetSLI `json:"get-sli"`
	Deployment string `json:"deployment"`
}

type HTTPEventSender

type HTTPEventSender struct {
	// EventsEndpoint is the http endpoint the events are sent to
	EventsEndpoint string
	// Client is an implementation of the cloudevents.Client interface
	Client cloudevents.Client
}

HTTPEventSender sends CloudEvents via HTTP

func NewHTTPEventSender

func NewHTTPEventSender(endpoint string) (*HTTPEventSender, error)

NewHTTPEventSender creates a new HTTPSender

func (HTTPEventSender) SendEvent

func (httpSender HTTPEventSender) SendEvent(event cloudevents.Event) error

SendEvent sends a CloudEvent

type Helm

type Helm struct {
	Chart string `json:"chart"`
}

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) SendCloudEvent

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

SendCloudEvent sends a cloudevent to the event broker

func (*Keptn) SendTaskFinishedEvent

func (k *Keptn) SendTaskFinishedEvent(data keptn.EventProperties, source string) (string, error)

SendTaskStartedEvent sends a .finished event for the incoming .triggered event the KeptnHandler was initialized with. It returns the ID of the sent CloudEvent or an error

func (*Keptn) SendTaskStartedEvent

func (k *Keptn) SendTaskStartedEvent(data keptn.EventProperties, source string) (string, error)

SendTaskStartedEvent sends a .started event for the incoming .triggered event the KeptnHandler was initialized with. It returns the ID of the sent CloudEvent or an error

func (*Keptn) SendTaskStatusChangedEvent

func (k *Keptn) SendTaskStatusChangedEvent(data keptn.EventProperties, source string) (string, error)

SendTaskStartedEvent sends a .status.changed event for the incoming .triggered event the KeptnHandler was initialized with. It returns the ID of the sent CloudEvent or an error

type Metadata

type Metadata struct {
	Name string `json:"name" yaml:"name"`
}

Metadata contains meta-data of a resource

type ProblemDetails

type ProblemDetails struct {
	// State is the state of the problem; possible values are: OPEN, RESOLVED
	State string `json:"State,omitempty jsonschema:"enum=open,enum=resolved"`
	// 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"`
	// ImpactedEntity 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 ProjectCreateData

type ProjectCreateData struct {
	ProjectName  string `json:"projectName"`
	GitRemoteURL string `json:"gitRemoteURL,omitempty"`
	Shipyard     string `json:"shipyard"`
}

type ProjectCreateFinishedEventData

type ProjectCreateFinishedEventData struct {
	EventData
	CreatedProject ProjectCreateData `json:"createdProject"`
}

type ProjectCreateStartedEventData

type ProjectCreateStartedEventData struct {
	EventData
}

type ProjectDeleteData

type ProjectDeleteData struct {
}

type ProjectDeleteFinishedEventData

type ProjectDeleteFinishedEventData struct {
	EventData
}

type ProjectDeleteStartedEventData

type ProjectDeleteStartedEventData struct {
	EventData
}

type ReleaseData

type ReleaseData struct {
	// GitCommit indicates the version which should be deployed
	GitCommit string `json:"gitCommit"`
}

type ReleaseFinishedEventData

type ReleaseFinishedEventData struct {
	EventData
	Release ReleaseData `json:"release"`
}

type ReleaseStartedEventData

type ReleaseStartedEventData struct {
	EventData
}

type ReleaseStatusChangedEventData

type ReleaseStatusChangedEventData struct {
	EventData
}

type ReleaseTriggeredEventData

type ReleaseTriggeredEventData struct {
	EventData
	Deployment DeploymentFinishedData `json:"deployment"`
}

type Remediation

type Remediation 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 RemediationFinishedEventData

type RemediationFinishedEventData struct {
	EventData
}

RemediationFinishedEventData describes a finished remediation

type RemediationStartedEventData

type RemediationStartedEventData struct {
	EventData
}

RemediationTriggeredEventType is a CloudEvent to indicate the start of a remediation

type RemediationStatusChangedEventData

type RemediationStatusChangedEventData struct {
	EventData

	// Remediation indicates the result
	Remediation Remediation `json:"remediation"`
}

RemediationStatus describes the result and status of a remediation

type RemediationTriggeredEventData

type RemediationTriggeredEventData struct {
	EventData

	// Problem contains details about the problem
	Problem ProblemDetails `json:"problem"`
}

RemediationTriggeredEventData is a CloudEvent for triggering remediations

type ResultType

type ResultType string
const (
	ResultPass    ResultType = "pass"
	ResultWarning ResultType = "warning"
	ResultFailed  ResultType = "fail"
)

type RollbackData

type RollbackData struct {
}

type RollbackFinishedEventData

type RollbackFinishedEventData struct {
	EventData
}

type RollbackStartedEventData

type RollbackStartedEventData struct {
	EventData
}

type RollbackTriggeredEventData

type RollbackTriggeredEventData struct {
	EventData
}

type SLIEvaluationResult

type SLIEvaluationResult struct {
	Score          float64      `json:"score"`
	Value          *SLIResult   `json:"value"`
	DisplayName    string       `json:"displayName"`
	PassTargets    []*SLITarget `json:"passTargets"`
	WarningTargets []*SLITarget `json:"warningTargets"`
	KeySLI         bool         `json:"keySli"`
	Status         string       `json:"status" jsonschema:"enum=pass,enum=warning,enum=fail"`
}

type SLIFilter

type SLIFilter struct {
	// Key defines the key of the SLI filter
	Key string `json:"key"`
	// Value defines the value of the SLI filter
	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 Selector

type Selector struct {
	Match map[string]string `json:"match" yaml:"match"`
}

Selector defines conditions that need to evaluate to true for a trigger to fire

type Sequence

type Sequence struct {
	Name        string    `json:"name" yaml:"name"`
	TriggeredOn []Trigger `json:"triggeredOn,omitempty" yaml:"triggeredOn,omitempty"`
	Tasks       []Task    `json:"tasks" yaml:"tasks"`
}

Sequence defines a task sequence by its name and tasks. The triggers property is optional

type ServiceCreateFinishedEventData

type ServiceCreateFinishedEventData struct {
	EventData
}

type ServiceCreateStartedEventData

type ServiceCreateStartedEventData struct {
	EventData
}

type ServiceCreateStatusChangedEventData

type ServiceCreateStatusChangedEventData struct {
	EventData
}

type ServiceDeleteFinishedEventData

type ServiceDeleteFinishedEventData struct {
	EventData
}

type ServiceDeleteStartedEventData

type ServiceDeleteStartedEventData struct {
	EventData
}

type ServiceDeleteStatusChangedEventData

type ServiceDeleteStatusChangedEventData struct {
	EventData
}

type Shipyard

type Shipyard struct {
	ApiVersion string       `json:"apiVersion" yaml:"apiVersion"`
	Kind       string       `json:"kind" yaml:"kind"`
	Metadata   Metadata     `json:"metadata" yaml:"metadata"`
	Spec       ShipyardSpec `json:"spec" yaml:"spec"`
}

Shipyard describes a shipyard specification according to Keptn spec 0.2.0

type ShipyardSpec

type ShipyardSpec struct {
	Stages []Stage `json:"stages" yaml:"stages"`
}

ShipyardSpec consists of any number of stages

type Stage

type Stage struct {
	Name      string     `json:"name" yaml:"name"`
	Sequences []Sequence `json:"sequences" yaml:"sequences"`
}

Stage defines a stage by its name and list of task sequences

type StatusType

type StatusType string
const (
	StatusSucceeded StatusType = "succeeded"
	StatusErrored   StatusType = "errored"
	StatusUnknown   StatusType = "unknown"
)

type Task

type Task struct {
	Name       string      `json:"name" yaml:"name"`
	Properties interface{} `json:"properties" yaml:"properties"`
}

Task defines a task by its name and optional properties

type Test

type Test struct {
	// Start indicates the starting timestamp of the tests
	Start string `json:"start"`
	// End indicates the end timestamp of the tests
	End string `json:"end"`
}

type TestFinishedDetails

type TestFinishedDetails struct {
	// Start indicates the starting timestamp of the tests
	Start string `json:"start"`
	// End indicates the end timestamp of the tests
	End string `json:"end"`
	// GitCommit indicates the version which should be deployed
	GitCommit string `json:"gitCommit"`
}

type TestFinishedEventData

type TestFinishedEventData struct {
	EventData
	Test TestFinishedDetails `json:"test"`
}

type TestStartedEventData

type TestStartedEventData struct {
	EventData
}

type TestStatusChangedEventData

type TestStatusChangedEventData struct {
	EventData
}

type TestTriggeredDeploymentDetails

type TestTriggeredDeploymentDetails struct {
	// DeploymentURILocal contains the local URL
	DeploymentURIsLocal []string `json:"deploymentURIsLocal"`
	// DeploymentURIPublic contains the public URL
	DeploymentURIsPublic []string `json:"deploymentURIsPublic,omitempty"`
}

type TestTriggeredDetails

type TestTriggeredDetails struct {
	// TestStrategy is the testing strategy and is defined in the shipyard
	TestStrategy string `json:"teststrategy" jsonschema:"enum=real-user,enum=functional,enum=performance,enum=healthcheck"`
}

type TestTriggeredEventData

type TestTriggeredEventData struct {
	EventData

	Test TestTriggeredDetails `json:"test"`

	Deployment TestTriggeredDeploymentDetails `json:"deployment"`
}

type Trigger

type Trigger struct {
	Event    string   `json:"event" yaml:"event"`
	Selector Selector `json:"selector,omitempty" yaml:"selector,omitempty"`
}

Trigger defines a trigger which causes a sequence to get activated

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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