Documentation
¶
Index ¶
- Constants
- func ExecuteCommand(command string, args []string) (string, error)
- func ExecuteCommandInDirectory(command string, args []string, directory string) (string, error)
- func GetServiceEndpoint(service string) (url.URL, error)
- func OpenWS(connData ConnectionData, apiEndPoint url.URL) (*websocket.Conn, *http.Response, error)
- func ValidateKeptnEntityName(name string) bool
- func ValididateUnixDirectoryName(dirName string) bool
- func WriteLog(ws *websocket.Conn, logData LogData, shkeptnContext string) error
- func WriteWSLog(ws *websocket.Conn, logEvent cloudevents.Event, message string, terminate bool, ...) error
- type ActionFinishedEventData
- type ActionInfo
- type ActionResult
- type ActionResultType
- type ActionStartedEventData
- type ActionStatusType
- type ActionTriggeredEventData
- type ApprovalData
- type ApprovalFinishedEventData
- type ApprovalStrategy
- type ApprovalStrategyStruct
- type ApprovalTriggeredEventData
- type Canary
- type CanaryAction
- type CombinedLogger
- type ConfigurationChangeEventData
- type ConfigureMonitoringEventData
- type ConnectionData
- type Datastore
- type DeploymentFinishedEventData
- type DeploymentStrategy
- type EvaluationDetails
- type EvaluationDoneEventData
- type EventHandler
- type IncompleteCE
- type InternalGetSLIDoneEventData
- type InternalGetSLIEventData
- type Keptn
- func (k *Keptn) GetKeptnResource(resource string) (string, error)
- func (k *Keptn) GetSLIConfiguration(project string, stage string, service string, resourceURI string) (map[string]string, error)
- func (k *Keptn) GetShipyard() (*Shipyard, error)
- func (k *Keptn) ReplaceKeptnPlaceholders(input string) string
- func (k *Keptn) SendActionFinishedEvent(incomingEvent *cloudevents.Event, actionResult ActionResult, ...) error
- func (k *Keptn) SendActionStartedEvent(incomingEvent *cloudevents.Event, labels map[string]string, eventSource string) error
- func (k *Keptn) SendCloudEvent(event cloudevents.Event) error
- func (k *Keptn) SendConfigurationChangeEvent(incomingEvent *cloudevents.Event, labels map[string]string, eventSource string) error
- func (k *Keptn) SendDeploymentFinishedEvent(incomingEvent *cloudevents.Event, ...) error
- func (k *Keptn) SendTestsFinishedEvent(incomingEvent *cloudevents.Event, teststrategy, deploymentstrategy string, ...) error
- type KeptnBase
- type KeptnOpts
- type LogData
- type Logger
- type LoggerInterface
- type LoggingOpts
- type MyCloudEvent
- type ProblemDetails
- type ProblemEventData
- type ProjectCreateEventData
- type ProjectDeleteEventData
- type Remediation
- type RemediationAction
- type RemediationFinished
- type RemediationFinishedEventData
- type RemediationResult
- type RemediationResultType
- type RemediationStartedEventData
- type RemediationStatusChanged
- type RemediationStatusChangedEventData
- type RemediationStatusType
- type RemediationTriggeredEventData
- type Remediations
- type SLIConfig
- type SLIEvaluationResult
- type SLIFilter
- type SLIResult
- type SLITarget
- type SLO
- type SLOComparison
- type SLOCriteria
- type SLOScore
- type ServiceCreateEventData
- type ServiceDeleteEventData
- type ServiceLevelObjectives
- type Shipyard
- type StartEvaluationEventData
- type TestsFinishedEventData
Constants ¶
const ActionFinishedEventType = "sh.keptn.event.action.finished"
ActionFinishedEventType is a CloudEvent for indicating that an action has been finished
const ActionStartedEventType = "sh.keptn.event.action.started"
ActionStartedEventType is a CloudEvent for confirming the start of an action
const ActionTriggeredEventType = "sh.keptn.event.action.triggered"
ActionTriggeredEventType is a CloudEvent for triggering actions
const ApprovalFinishedEventType = "sh.keptn.event.approval.finished"
ApprovalFinishedEventType is a CloudEvent confirming an open approval
const ApprovalTriggeredEventType = "sh.keptn.event.approval.triggered"
ApprovalTriggeredEvent is a CloudEvent triggering a new approval
const ConfigurationChangeEventType = "sh.keptn.event.configuration.change"
ConfigurationChangeEventType is a CloudEvent type for changing the configuration
const ConfigureMonitoringEventType = "sh.keptn.event.monitoring.configure"
ConfigureMonitoringEventType is a CloudEvent for configuring monitoring
const DeploymentFinishedEventType = "sh.keptn.events.deployment-finished"
DeploymentFinishedEventType is a CloudEvent for indicating that the deployment has finished
const EvaluationDoneEventType = "sh.keptn.events.evaluation-done"
EvaluationDoneEventType is a CloudEvent for indicating that the evaluation has finished
const InternalGetSLIDoneEventType = "sh.keptn.internal.event.get-sli.done"
InternalGetSLIDoneEventType is a CloudEvent for submitting SLI values
const InternalGetSLIEventType = "sh.keptn.internal.event.get-sli"
InternalGetSLIEventType is a CloudEvent for retrieving SLI values
const InternalProjectCreateEventType = "sh.keptn.internal.event.project.create"
InternalProjectCreateEventType is a CloudEvent type for creating a new project
const InternalProjectDeleteEventType = "sh.keptn.internal.event.project.delete"
InternalProjectDeleteEventType is a CloudEvent type for deleting a project
const InternalServiceCreateEventType = "sh.keptn.internal.event.service.create"
InternalServiceCreateEventType is a CloudEvent type for creating a new service
const InternalServiceDeleteEventType = "sh.keptn.internal.event.service.delete"
InternalServiceDeleteEventType is a CloudEvent type for deleting a new service
const MAX_SEND_RETRIES = 3
const ProblemEventType = "sh.keptn.events.problem"
ProblemEventType is a CloudEvent type to inform about a problem
const ProblemOpenEventType = "sh.keptn.event.problem.open"
ProblemOpenEventType is a CloudEvent type to inform about an open problem
const RemediationFinishedEventType = "sh.keptn.event.remediation.finished"
RemediationFinishedEventType is a CloudEvent to indicate that the status of a remediation has been changed
const RemediationStartedEventType = "sh.keptn.event.remediation.started"
RemediationTriggeredEventType is a CloudEvent to indicate the start of a remediation
const RemediationStatusChangedEventType = "sh.keptn.event.remediation.status.changed"
RemediationStatusChangedEventType is a CloudEvent to indicate that the status of a remediation has been changed
const RemediationTriggeredEventType = "sh.keptn.event.remediation.triggered"
RemediationTriggeredEventType is a CloudEvent for triggering remediations
const StartEvaluationEventType = "sh.keptn.event.start-evaluation"
StartEvaluationEventType is a CloudEvent for retrieving SLI values
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 ¶
ExecuteCommand exectues the command using the args
func ExecuteCommandInDirectory ¶
ExecuteCommandInDirectory executes the command using the args within the specified directory
func GetServiceEndpoint ¶
getServiceEndpoint gets an endpoint stored in an environment variable and sets http as default scheme
func ValidateKeptnEntityName ¶
ValidateKeptnEntityName checks whether the provided name represents a valid project, service, or stage name
func ValididateUnixDirectoryName ¶
ValididateUnixDirectoryName checks whether the provided dirName contains any special character according to https://www.cyberciti.biz/faq/linuxunix-rules-for-naming-file-and-directory-names/
func WriteWSLog ¶
func WriteWSLog(ws *websocket.Conn, logEvent cloudevents.Event, message string, terminate bool, logLevel string) error
WriteWSLog writes the log event to the websocket
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 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 CombinedLogger ¶
type CombinedLogger struct {
// contains filtered or unexported fields
}
CombinedLogger logs messages to the logger as well as to the websocket
func NewCombinedLogger ¶
func NewCombinedLogger(logger *Logger, ws *websocket.Conn, shKeptnContext string) *CombinedLogger
NewCombinedLogger creates a new CombinedLogger which writes log messages to the logger as well as to the websocket
func (*CombinedLogger) Debug ¶
func (l *CombinedLogger) Debug(message string)
Debug logs a debug message
func (*CombinedLogger) Error ¶
func (l *CombinedLogger) Error(message string)
Error logs an error message
func (*CombinedLogger) Info ¶
func (l *CombinedLogger) Info(message string)
Info logs an info message
func (*CombinedLogger) Terminate ¶
func (l *CombinedLogger) Terminate(message string)
Terminate sends a terminate message to the websocket
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 ConnectionData ¶
type ConnectionData struct {
EventContext apimodels.EventContext `json:"eventContext"`
}
ConnectionData stores EventContext and Success data
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 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 IncompleteCE ¶
type IncompleteCE struct {
ConnData ConnectionData `json:"data"`
}
IncompleteCE is a helper type for unmarshalling the CE data
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 {
KeptnContext string
KeptnBase *KeptnBase
Logger LoggerInterface
// contains filtered or unexported fields
}
func (*Keptn) GetSLIConfiguration ¶
func (k *Keptn) GetSLIConfiguration(project string, stage string, service string, resourceURI string) (map[string]string, error)
GetSLIConfiguration retrieves the SLI configuration for a service considering SLI configuration on stage and project level. First, the configuration of project-level is retrieved, which is then overridden by configuration on stage level, overridden by configuration on service level.
func (*Keptn) GetShipyard ¶
GetShipyard returns the shipyard definition of a project
func (*Keptn) ReplaceKeptnPlaceholders ¶
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) 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 KeptnBase ¶
type KeptnBase 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"`
}
KeptnBase contains properties that are shared among most Keptn events
type KeptnOpts ¶
type KeptnOpts struct {
UseLocalFileSystem bool
ConfigurationServiceURL string
EventBrokerURL string
IncomingEvent *cloudevents.Event
LoggingOptions *LoggingOpts
}
type LogData ¶
type LogData struct {
Message string `json:"message"`
Terminate bool `json:"terminate"`
LogLevel string `json:"loglevel"`
}
LogData represents log data
type Logger ¶
type Logger struct {
KeptnContext string `json:"keptnContext"`
EventID string `json:"eventId"`
ServiceName string `json:"keptnService"`
}
Logger contains data for logging
type LoggerInterface ¶
type LoggerInterface interface {
Info(message string)
Error(message string)
Debug(message string)
Terminate(message string)
}
LoggerInterface collects signatures of the logger
type LoggingOpts ¶ added in v0.7.0
type MyCloudEvent ¶
type MyCloudEvent struct {
SpecVersoin string `json:"specversion"`
ContentType string `json:"contentType"`
Data json.RawMessage `json:"data"`
ID string `json:"id"`
Time string `json:"time"`
Type string `json:"type"`
Source string `json:"source"`
ShKeptnContext string `json:"shkeptncontext"`
}
MyCloudEvent represents a keptn cloud event
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 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 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