Documentation ¶
Index ¶
- Constants
- Variables
- type Application
- type ApplicationService
- type AwsProviderSettings
- type BakeStage
- type Capacity
- type Client
- func (client *Client) Do(req *http.Request) (*http.Response, error)
- func (client *Client) DoWithResponse(req *http.Request, v interface{}) (*http.Response, error)
- func (client *Client) DoWithRetry(createReq func() (*http.Request, error)) (*http.Response, error)
- func (client *Client) NewRequest(method string, path string) (*http.Request, error)
- func (client *Client) NewRequestWithBody(method string, path string, data interface{}) (*http.Request, error)
- type Config
- type CreatePipelineRequest
- type DeployStage
- type DeployStageCluster
- type DestroyServerGroupStage
- type JenkinsStage
- type Job
- type Message
- type MessageText
- type Moniker
- type Notification
- type NotificationLevel
- type Pipeline
- func (pipeline *Pipeline) AppendNotification(notification *Notification)
- func (p *Pipeline) AppendParameter(parameter *PipelineParameter)
- func (pipeline *Pipeline) AppendStage(stage Stage)
- func (pipeline *Pipeline) AppendTrigger(trigger *Trigger)
- func (pipeline *Pipeline) DeleteNotification(notificationID string) error
- func (p *Pipeline) DeleteParameter(parameterID string) error
- func (pipeline *Pipeline) DeleteStage(stageID string) error
- func (p *Pipeline) DeleteTrigger(triggerID string) error
- func (pipeline *Pipeline) GetNotification(notificationID string) (*Notification, error)
- func (p *Pipeline) GetParameter(parameterID string) (*PipelineParameter, error)
- func (pipeline *Pipeline) GetStage(stageID string) (Stage, error)
- func (p *Pipeline) GetTrigger(triggerID string) (*Trigger, error)
- func (pipeline *Pipeline) UpdateNotification(notification *Notification) error
- func (p *Pipeline) UpdateParameter(parameter *PipelineParameter) error
- func (pipeline *Pipeline) UpdateStage(stage Stage) error
- func (p *Pipeline) UpdateTrigger(trigger *Trigger) error
- type PipelineMessage
- func (m *PipelineMessage) CompleteText() string
- func (m *PipelineMessage) FailedText() string
- func (m *PipelineMessage) SetCompleteText(text string)
- func (m *PipelineMessage) SetFailedText(text string)
- func (m *PipelineMessage) SetStartingText(text string)
- func (m *PipelineMessage) StartingText() string
- type PipelineParameter
- type PipelineParameterOption
- type PipelineService
- func (service *PipelineService) CreatePipeline(pipeline *CreatePipelineRequest) error
- func (service *PipelineService) DeletePipeline(pipeline *Pipeline) error
- func (service *PipelineService) GetApplicationPipelines(applicationName string) (*[]*Pipeline, error)
- func (service *PipelineService) GetPipeline(applicationName string, pipelineName string) (*Pipeline, error)
- func (service *PipelineService) GetPipelineByID(id string) (*Pipeline, error)
- func (service *PipelineService) UpdatePipeline(pipeline *Pipeline) error
- type PipelineStage
- type ProviderSettings
- type ResizeServerGroupStage
- type Rollback
- type RollbackClusterStage
- type SerializableNotification
- type SerializablePipeline
- type SpinnakerError
- type Stage
- type StageEnabled
- type StageExecutionWindow
- type StageExecutionWindowJitter
- type StageExecutionWindowWhitelist
- type StageMessage
- type StageType
- type Task
- type Trigger
Constants ¶
const PipelineCompleteKey = "pipeline.complete"
PipelineCompleteKey for pipeline complete
const PipelineFailedKey = "pipeline.failed"
PipelineFailedKey for pipeline failed
const PipelineStartingKey = "pipeline.starting"
PipelineStartingKey for pipeline starting
const StageCompleteKey = "stage.complete"
StageCompleteKey for stage complete
const StageFailedKey = "stage.failed"
StageFailedKey for stage failed
const StageStartingKey = "stage.starting"
StageStartingKey for pipeline starting
Variables ¶
var ErrInvalidApplicationName = errors.New("Invalid application name")
ErrInvalidApplicationName invalid application name
var ErrInvalidDecodeResponseParameter = errors.New("nil interface provided to decodeResponse")
ErrInvalidDecodeResponseParameter invalid parameter for decodeResponse
var ErrInvalidNotificatoinLevel = errors.New("Invalid notification level")
ErrInvalidNotificatoinLevel invalid notification level
var ErrParameterNotFound = errors.New("could not find parameter")
ErrParameterNotFound parameter not found
var ErrPipelineNotFound = errors.New("Could not find pipeline")
ErrPipelineNotFound pipeline not found
var ErrPipelineNotificationNotFound = errors.New("notification not found")
ErrPipelineNotificationNotFound notification not found
var ErrStageNotFound = errors.New("Could not find stage")
ErrStageNotFound stage not found
var ErrTriggerNotFound = errors.New("could not find trigger")
ErrTriggerNotFound trigger not found
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { CloudProviders string `json:"cloudProviders"` InstancePort int `json:"instancePort"` ProviderSettings *ProviderSettings `json:"providerSettings"` Name string `json:"name"` Email string `json:"email"` }
Application Settings for Application
func NewApplication ¶
func NewApplication() *Application
NewApplication return Application object with default values
type ApplicationService ¶
type ApplicationService struct {
*Client
}
ApplicationService for interacting with spinnaker applications
func (*ApplicationService) CreateApplication ¶
func (service *ApplicationService) CreateApplication(app *Application) error
CreateApplication create an application
func (*ApplicationService) DeleteApplication ¶
func (service *ApplicationService) DeleteApplication(app *Application) error
DeleteApplication delete an application
func (*ApplicationService) GetApplications ¶
func (service *ApplicationService) GetApplications() (*[]*Application, error)
GetApplications get all applications
type AwsProviderSettings ¶
type AwsProviderSettings struct {
UseAmiBlockDeviceMappings bool `json:"useAmiBlockDeviceMappings"`
}
AwsProviderSettings Settings for AWS Provider
func NewAwsProviderSettings ¶
func NewAwsProviderSettings() *AwsProviderSettings
NewAwsProviderSettings return Aws provider settings with default values
type BakeStage ¶
type BakeStage struct { Notifications *[]*Notification `json:"notifications"` // contains filtered or unexported fields }
BakeStage for pipeline
type Client ¶
type Client struct { Config Config // contains filtered or unexported fields }
Client to talk to Spinnaker
func (*Client) DoWithResponse ¶
DoWithResponse send http request and parse response body
func (*Client) DoWithRetry ¶
DoWithRetry send http request with retry
func (*Client) NewRequest ¶
NewRequest create http request
type CreatePipelineRequest ¶
type CreatePipelineRequest struct { Application string `json:"application"` Name string `json:"name"` }
CreatePipelineRequest used to create pipeline
type DeployStage ¶
type DeployStage struct { Notifications *[]*Notification `json:"notifications"` // contains filtered or unexported fields }
DeployStage for pipeline
type DeployStageCluster ¶
type DeployStageCluster struct { Account string `json:"account"` Application string `json:"application"` AvailabilityZones map[string][]string `json:"availabilityZones"` Capacity *Capacity `json:"capacity"` CloudProvider string `json:"cloudProvider"` Cooldown int `json:"cooldown"` CopySourceCustomBlockDeviceMappings bool `json:"copySourceCustomBlockDeviceMappings"` DelayBeforeDisableSec int `json:"delayBeforeDisableSec"` DelayBeforeScaleDownSec int `json:"delayBeforeDisableSec"` Dirty map[string]interface{} `json:"dirty"` EBSOptimized bool `json:"ebsOptimized"` EnabledMetrics []string `json:"enabledMetrics"` FreeFormDetails string `json:"freeFormDetails"` HealthCheckGracePeriod string `json:"healthCheckGracePeriod"` HealthCheckType string `json:"healthCheckType"` IAMRole string `json:"iamRole"` InstanceMonitoring bool `json:"instanceMonitoring"` InstanceType string `json:"instanceType"` KeyPair string `json:"keyPair"` LoadBalancers []string `json:"loadBalancers"` MaxRemainingAsgs int `json:"maxRemainingAsgs"` Moniker *Moniker `json:"moniker"` Provider string `json:"provider"` Rollback *Rollback `json:"rollback"` ScaleDown bool `json:"scaleDown"` SecurityGroups []string `json:"securityGroups"` SpelLoadBalancers []string `json:"spelLoadBalancers"` SpelTargetGroups []string `json:"spelTargetGroups"` SpotPrice string `json:"spotPrice"` Stack string `json:"stack"` Strategy string `json:"strategy"` SubnetType string `json:"subnetType"` SuspendedProcesses []string `json:"suspendedProcesses"` Tags map[string]string `json:"tags"` TargetGroups []string `json:"targetGroups"` TargetHealthyDeployPercentage int `json:"targetHealthyDeployPercentage"` TerminationPolicies []string `json:"terminationPolicies"` UseAmiBlockDeviceMappings bool `json:"useAmiBlockDeviceMappings"` UseSourceCapacity bool `json:"useSourceCapacity"` }
DeployStageCluster cluster to deploy
func NewDeployStageCluster ¶
func NewDeployStageCluster() *DeployStageCluster
type DestroyServerGroupStage ¶
type DestroyServerGroupStage struct { Notifications *[]*Notification `json:"notifications"` // contains filtered or unexported fields }
DestroyServerGroupStage for pipeline
func NewDestroyServerGroupStage ¶
func NewDestroyServerGroupStage() *DestroyServerGroupStage
NewDestroyServerGroupStage for pipeline
func (*DestroyServerGroupStage) GetName ¶
func (s *DestroyServerGroupStage) GetName() string
GetName for Stage interface
func (*DestroyServerGroupStage) GetRefID ¶
func (s *DestroyServerGroupStage) GetRefID() string
GetRefID for Stage interface
func (*DestroyServerGroupStage) GetType ¶
func (s *DestroyServerGroupStage) GetType() StageType
GetType for Stage interface
type JenkinsStage ¶
type JenkinsStage struct { Notifications *[]*Notification `json:"notifications"` // contains filtered or unexported fields }
JenkinsStage for pipeline
func (*JenkinsStage) GetRefID ¶
func (s *JenkinsStage) GetRefID() string
GetRefID for Stage interface
func (*JenkinsStage) GetType ¶
func (s *JenkinsStage) GetType() StageType
GetType for Stage interface
type Job ¶
type Job struct { Type string `json:"type"` Application *Application `json:"application"` User string `json:"user"` }
Job a job to run
type Message ¶
type Message interface { SetCompleteText(string) CompleteText() string SetFailedText(string) FailedText() string SetStartingText(string) StartingText() string }
Message for Notification
type MessageText ¶
type MessageText struct {
Text string `json:"text"`
}
MessageText for Pipeline Notification
type Moniker ¶
type Moniker struct { App string `json:"app,omitempty"` Cluster string `json:"cluster,omitempty"` Detail string `json:"detail,omitempty"` Stack string `json:"stack,omitempty"` Sequence string `json:"sequence,omitempty"` }
Moniker for cluster
type Notification ¶
type Notification struct { SerializableNotification Message Message `json:"message"` }
Notification for pipeline
type NotificationLevel ¶
type NotificationLevel string
NotificationLevel level of notification
const NotificationLevelPipeline NotificationLevel = "pipeline"
NotificationLevelPipeline pipeline level notifaction
const NotificationLevelStage NotificationLevel = "stage"
NotificationLevelStage stage level notifaction
type Pipeline ¶
type Pipeline struct { SerializablePipeline Notifications *[]*Notification `json:"notifications"` Stages *[]Stage `json:"stages"` }
Pipeline deploy pipeline in application
func (*Pipeline) AppendNotification ¶
func (pipeline *Pipeline) AppendNotification(notification *Notification)
AppendNotification append notification
func (*Pipeline) AppendParameter ¶
func (p *Pipeline) AppendParameter(parameter *PipelineParameter)
AppendParameter append parameter
func (*Pipeline) AppendStage ¶
AppendStage append stage
func (*Pipeline) AppendTrigger ¶
AppendTrigger append trigger
func (*Pipeline) DeleteNotification ¶
DeleteNotification delete notification
func (*Pipeline) DeleteParameter ¶
DeleteParameter in pipeline
func (*Pipeline) DeleteStage ¶
DeleteStage delete stage
func (*Pipeline) DeleteTrigger ¶
DeleteTrigger in pipeline
func (*Pipeline) GetNotification ¶
func (pipeline *Pipeline) GetNotification(notificationID string) (*Notification, error)
GetNotification Get notification by id
func (*Pipeline) GetParameter ¶
func (p *Pipeline) GetParameter(parameterID string) (*PipelineParameter, error)
GetParameter by ID
func (*Pipeline) GetTrigger ¶
GetTrigger by ID
func (*Pipeline) UpdateNotification ¶
func (pipeline *Pipeline) UpdateNotification(notification *Notification) error
UpdateNotification update notification
func (*Pipeline) UpdateParameter ¶
func (p *Pipeline) UpdateParameter(parameter *PipelineParameter) error
UpdateParameter in pipeline
func (*Pipeline) UpdateStage ¶
UpdateStage update stage
func (*Pipeline) UpdateTrigger ¶
UpdateTrigger in pipeline
type PipelineMessage ¶
type PipelineMessage struct { Complete *MessageText `json:"pipeline.complete" mapstructure:"pipeline.complete"` Failed *MessageText `json:"pipeline.failed" mapstructure:"pipeline.failed"` Starting *MessageText `json:"pipeline.starting" mapstructure:"pipeline.starting"` }
PipelineMessage for Pipeline Notification
func (*PipelineMessage) CompleteText ¶
func (m *PipelineMessage) CompleteText() string
CompleteText for Message interface
func (*PipelineMessage) FailedText ¶
func (m *PipelineMessage) FailedText() string
FailedText for Message interface
func (*PipelineMessage) SetCompleteText ¶
func (m *PipelineMessage) SetCompleteText(text string)
SetCompleteText for Message interface
func (*PipelineMessage) SetFailedText ¶
func (m *PipelineMessage) SetFailedText(text string)
SetFailedText for Message interface
func (*PipelineMessage) SetStartingText ¶
func (m *PipelineMessage) SetStartingText(text string)
SetStartingText for Message interface
func (*PipelineMessage) StartingText ¶
func (m *PipelineMessage) StartingText() string
StartingText for Message interface
type PipelineParameter ¶
type PipelineParameter struct { ID string `json:"id"` Default string `json:"default"` Description string `json:"description"` HasOptions bool `json:"hasOptions"` Label string `json:"label"` Name string `json:"name"` Options *[]*PipelineParameterOption `json:"options"` Required bool `json:"required"` }
type PipelineParameterOption ¶
type PipelineParameterOption struct {
Value string `json:"value"`
}
type PipelineService ¶
type PipelineService struct {
*Client
}
PipelineService used to manage pipelines
func (*PipelineService) CreatePipeline ¶
func (service *PipelineService) CreatePipeline(pipeline *CreatePipelineRequest) error
CreatePipeline in application
func (*PipelineService) DeletePipeline ¶
func (service *PipelineService) DeletePipeline(pipeline *Pipeline) error
DeletePipeline in application
func (*PipelineService) GetApplicationPipelines ¶
func (service *PipelineService) GetApplicationPipelines(applicationName string) (*[]*Pipeline, error)
GetApplicationPipelines get all pipelines for an application
func (*PipelineService) GetPipeline ¶
func (service *PipelineService) GetPipeline(applicationName string, pipelineName string) (*Pipeline, error)
GetPipeline get pipeline by name and application
func (*PipelineService) GetPipelineByID ¶
func (service *PipelineService) GetPipelineByID(id string) (*Pipeline, error)
GetPipelineByID get pipeline by id
func (*PipelineService) UpdatePipeline ¶
func (service *PipelineService) UpdatePipeline(pipeline *Pipeline) error
UpdatePipeline in application
type PipelineStage ¶
type PipelineStage struct { Notifications *[]*Notification `json:"notifications"` // contains filtered or unexported fields }
PipelineStage for pipeline
func (*PipelineStage) GetName ¶
func (s *PipelineStage) GetName() string
GetName for Stage interface
func (*PipelineStage) GetRefID ¶
func (s *PipelineStage) GetRefID() string
GetRefID for Stage interface
func (*PipelineStage) GetType ¶
func (s *PipelineStage) GetType() StageType
GetType for Stage interface
type ProviderSettings ¶
type ProviderSettings struct {
AWS *AwsProviderSettings `json:"aws"`
}
ProviderSettings Settings for Provider
type ResizeServerGroupStage ¶
type ResizeServerGroupStage struct { Notifications *[]*Notification `json:"notifications"` // contains filtered or unexported fields }
ResizeServerGroupStage for pipeline
func NewResizeServerGroupStage ¶
func NewResizeServerGroupStage() *ResizeServerGroupStage
NewResizeServerGroupStage for pipeline
func (*ResizeServerGroupStage) GetName ¶
func (s *ResizeServerGroupStage) GetName() string
GetName for Stage interface
func (*ResizeServerGroupStage) GetRefID ¶
func (s *ResizeServerGroupStage) GetRefID() string
GetRefID for Stage interface
func (*ResizeServerGroupStage) GetType ¶
func (s *ResizeServerGroupStage) GetType() StageType
GetType for Stage interface
type Rollback ¶
type Rollback struct {
OnFailure bool `json:"onFailure"`
}
func NewRollback ¶
func NewRollback() *Rollback
type RollbackClusterStage ¶
type RollbackClusterStage struct { Notifications *[]*Notification `json:"notifications"` // contains filtered or unexported fields }
RollbackClusterStage for pipeline
func NewRollbackClusterStage ¶
func NewRollbackClusterStage() *RollbackClusterStage
NewRollbackClusterStage for pipeline
func (*RollbackClusterStage) GetName ¶
func (s *RollbackClusterStage) GetName() string
GetName for Stage interface
func (*RollbackClusterStage) GetRefID ¶
func (s *RollbackClusterStage) GetRefID() string
GetRefID for Stage interface
func (*RollbackClusterStage) GetType ¶
func (s *RollbackClusterStage) GetType() StageType
GetType for Stage interface
type SerializableNotification ¶
type SerializableNotification struct { ID string `json:"id,omitempty"` Address string `json:"address"` Level NotificationLevel `json:"level"` Type string `json:"type"` When []string `json:"when"` }
SerializableNotification for pipeline
type SerializablePipeline ¶
type SerializablePipeline struct { Application string `json:"application"` AppConfig map[string]interface{} `json:"appConfig"` Disabled bool `json:"disabled"` ID string `json:"id"` Index int `json:"index"` KeepWaitingPipelines bool `json:"keepWaitingPipelines"` LimitConcurrent bool `json:"limitConcurrent"` Name string `json:"name"` ParameterConfig *[]*PipelineParameter `json:"parameterConfig"` Roles *[]string `json:"roles"` ServiceAccount string `json:"serviceAccount,omitempty"` Triggers []*Trigger `json:"triggers"` }
SerializablePipeline deploy pipeline in application
func NewSerializablePipeline ¶
func NewSerializablePipeline() SerializablePipeline
NewSerializablePipeline Pipeline with default values
type SpinnakerError ¶
type SpinnakerError struct { ErrorMsg string `json:"error"` Exception string `json:"exception"` Message string `json:"message"` Status int `json:"status"` Timestamp int64 `json:"timestamp"` Body string `json:"body"` }
SpinnakerError Error response from spinnaker
type StageEnabled ¶
StageEnabled when stage is enabled
type StageExecutionWindow ¶
type StageExecutionWindow struct { Days []int `json:"days"` Jitter *StageExecutionWindowJitter `json:"jitter"` Whitelist *[]*StageExecutionWindowWhitelist `json:"whitelist"` }
StageExecutionWindow when to execute pipeline stage
type StageExecutionWindowJitter ¶
type StageExecutionWindowJitter struct { Enabled bool `json:"enabled"` MaxDelay int `json:"maxDelay"` MinDelay int `json:"minDelay"` SkipManual bool `json:"skipManual"` }
StageExecutionWindowJitter random jitter to add to execution window
type StageExecutionWindowWhitelist ¶
type StageExecutionWindowWhitelist struct { EndHour int `json:"endHour"` EndMin int `json:"endMin"` StartHour int `json:"startHour"` StartMin int `json:"startMin"` }
StageExecutionWindowWhitelist which hours to deploy
type StageMessage ¶
type StageMessage struct { Complete *MessageText `json:"stage.complete" mapstructure:"stage.complete"` Failed *MessageText `json:"stage.failed" mapstructure:"stage.failed"` Starting *MessageText `json:"stage.starting" mapstructure:"stage.starting"` }
StageMessage for Stage Notification
func (*StageMessage) CompleteText ¶
func (m *StageMessage) CompleteText() string
CompleteText for Message interface
func (*StageMessage) FailedText ¶
func (m *StageMessage) FailedText() string
FailedText for Message interface
func (*StageMessage) SetCompleteText ¶
func (m *StageMessage) SetCompleteText(text string)
SetCompleteText for Message interface
func (*StageMessage) SetFailedText ¶
func (m *StageMessage) SetFailedText(text string)
SetFailedText for Message interface
func (*StageMessage) SetStartingText ¶
func (m *StageMessage) SetStartingText(text string)
SetStartingText for Message interface
func (*StageMessage) StartingText ¶
func (m *StageMessage) StartingText() string
StartingText for Message interface
type StageType ¶
type StageType string
StageType type of stage
var BakeStageType StageType = "bake"
BakeStageType bake stage
var DeployStageType StageType = "deploy"
DeployStageType deploy stage
var DestroyServerGroupStageType StageType = "destroyServerGroup"
DestroyServerGroupStageType destroy server group stage
var JenkinsStageType StageType = "jenkins"
JenkinsStageType jenkins stage
var PipelineStageType StageType = "pipeline"
PipelineStageType pipeline stage
var ResizeServerGroupStageType StageType = "resizeServerGroup"
ResizeServerGroupStageType resize server group stage
var RollbackClusterStageType StageType = "rollbackCluster"
RollbackClusterStageType rollback cluster stage
Source Files ¶
- application.go
- application_service.go
- bake_stage.go
- capacity.go
- client.go
- deploy_stage.go
- deploy_stage_cluster.go
- destroy_server_group_stage.go
- jenkins_stage.go
- job.go
- message.go
- moniker.go
- notification.go
- notification_level.go
- pipeline.go
- pipeline_message.go
- pipeline_parameter.go
- pipeline_service.go
- pipeline_stage.go
- resize_server_group_stage.go
- rollback.go
- rollback_cluster_stage.go
- spinnaker_error.go
- stage.go
- stage_execution_window.go
- stage_message.go
- stage_type.go
- task.go
- trigger.go