Documentation ¶
Index ¶
- Constants
- func ExecuteCommand(command string, args []string) (string, error)
- func ExecuteCommandInDirectory(command string, args []string, directory string) (string, error)
- func ExecuteCommandWithEnv(command string, args []string, env []string) (string, error)
- type ApprovalStrategy
- type ApprovalStrategyStruct
- type CanaryAction
- type ConfigureMonitoringEventData
- type Datastore
- type DeploymentStrategy
- type EventHandler
- type ProblemEventData
- type Remediation
- type RemediationAction
- type Remediations
- type SLO
- type SLOComparison
- type SLOCriteria
- type SLOScore
- type ServiceLevelObjectives
- type Shipyard
Constants ¶
const ConfigureMonitoringEventType = "sh.keptn.event.monitoring.configure"
ConfigureMonitoringEventType is a CloudEvent for configuring monitoring
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
Variables ¶
This section is empty.
Functions ¶
func ExecuteCommand ¶
ExecuteCommand executes the command using the args
func ExecuteCommandInDirectory ¶
ExecuteCommandInDirectory executes the command using the args within the specified directory
Types ¶
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 (a 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 (a *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 CanaryAction ¶
type CanaryAction int
CanaryAction describes the execution 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 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 DeploymentStrategy ¶
type DeploymentStrategy int
DeploymentStrategy describes how a keptn-managed service is deployed
const ( // Direct generates a second chart to expose the service via istio Direct DeploymentStrategy = iota + 1 // Duplicate generates a second chart in order to support blue/green deployments Duplicate // UserManaged does not generate any further charts UserManaged )
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 unmarshalls a quoted json string to the enum value
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 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"` // ImpactedEntity 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 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 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 SLO ¶
type SLO struct { SLI string `json:"sli" yaml:"sli"` DisplayName string `json:"displayName" yaml:"displayName"` 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 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