Documentation
¶
Index ¶
- Constants
- Variables
- func MapSliceToMap(slice yaml.MapSlice) map[string]string
- func NewStorage(storage string) (utils.Storage, error)
- func UUID() string
- type Application
- func (a *Application) GetConstraints() map[string][]constraints.Constraint
- func (a *Application) GetInstances(mesos MesosState) int
- func (a *Application) IsDependencySatisfied(runningApps map[string]ApplicationStatus) bool
- func (a *Application) Run(context *RunContext, maxWait int) error
- func (a *Application) String() string
- func (a *Application) Validate() error
- type ApplicationRunStatus
- type ApplicationStatus
- type CassandraStateStorage
- func (css *CassandraStateStorage) GetStackState(name string, zone string) (*StackState, error)
- func (css *CassandraStateStorage) SaveApplicationStatus(stack string, zone string, applicationName string, status ApplicationStatus) error
- func (css *CassandraStateStorage) SaveStackStatus(name string, zone string, status StackStatus) error
- func (css *CassandraStateStorage) SaveStackVariables(stack string, zone string, variables *Variables) error
- type CassandraStorage
- func (cs *CassandraStorage) GetAll() ([]*Stack, error)
- func (cs *CassandraStorage) GetLayer(name string) (*Layer, error)
- func (cs *CassandraStorage) GetLayersStack(name string) (Merger, error)
- func (cs *CassandraStorage) GetStack(name string) (*Stack, error)
- func (cs *CassandraStorage) GetStackRunner(name string) (Runner, error)
- func (cs *CassandraStorage) Init() error
- func (cs *CassandraStorage) RemoveStack(stack string, force bool) error
- func (cs *CassandraStorage) StoreStack(stack *Stack) error
- type CassandraUserStorage
- func (cus CassandraUserStorage) CheckKey(name string, key string) (bool, error)
- func (cus CassandraUserStorage) CreateUser(name string, role UserRole) (string, error)
- func (cus CassandraUserStorage) GetUser(name string) (*User, error)
- func (cus CassandraUserStorage) Init() (string, error)
- func (cus CassandraUserStorage) IsAdmin(name string) (bool, error)
- func (cus CassandraUserStorage) RefreshToken(name string) (string, error)
- func (cus CassandraUserStorage) SaveUser(user User) error
- type Client
- func (c *Client) CreateLayer(data *CreateLayerRequest) error
- func (c *Client) CreateStack(data *CreateStackRequest) error
- func (c *Client) CreateUser(data *CreateUserRequest) (string, error)
- func (c *Client) GetStack(data *GetStackRequest) (*Stack, error)
- func (c *Client) List() ([]string, error)
- func (c *Client) Ping() error
- func (c *Client) RefreshToken(data *RefreshTokenRequest) (string, error)
- func (c *Client) RemoveScheduled(data *RemoveScheduledRequest) (string, error)
- func (c *Client) RemoveStack(data *RemoveStackRequest) error
- func (c *Client) Run(data *RunRequest) error
- func (c *Client) Scheduled() ([]*ScheduledTask, error)
- type CreateLayerRequest
- type CreateStackRequest
- type CreateUserRequest
- type CronScheduler
- type Docker
- type DockerPortMapping
- type DockerVolume
- type FrameworkStorage
- type GetStackRequest
- type InMemoryStateStorage
- func (s *InMemoryStateStorage) GetStackState(stack string, zone string) (*StackState, error)
- func (s *InMemoryStateStorage) SaveApplicationStatus(stack string, zone string, applicationName string, status ApplicationStatus) error
- func (s *InMemoryStateStorage) SaveStackStatus(name string, zone string, status StackStatus) error
- func (s *InMemoryStateStorage) SaveStackVariables(stack string, zone string, variables *Variables) error
- type InMemoryStorage
- func (s *InMemoryStorage) GetAll() ([]*Stack, error)
- func (s *InMemoryStorage) GetLayer(name string) (*Layer, error)
- func (s *InMemoryStorage) GetLayersStack(name string) (Merger, error)
- func (s *InMemoryStorage) GetStack(name string) (*Stack, error)
- func (s *InMemoryStorage) GetStackRunner(name string) (Runner, error)
- func (s *InMemoryStorage) Init() error
- func (s *InMemoryStorage) RemoveStack(name string, force bool) error
- func (s *InMemoryStorage) StoreStack(stack *Stack) error
- type Layer
- type Merger
- type MesosClusterState
- type MesosState
- type MesosTaskRunner
- type NoopUserStorage
- func (s *NoopUserStorage) CheckKey(string, string) (bool, error)
- func (s *NoopUserStorage) CreateUser(string, UserRole) (string, error)
- func (s *NoopUserStorage) GetUser(string) (*User, error)
- func (s *NoopUserStorage) IsAdmin(string) (bool, error)
- func (s *NoopUserStorage) RefreshToken(string) (string, error)
- func (s *NoopUserStorage) SaveUser(User) error
- type RefreshTokenRequest
- type RemoveScheduledRequest
- type RemoveStackRequest
- type RunContext
- type RunRequest
- type Runner
- type ScheduledTask
- type Scheduler
- type SchedulerConfig
- type Slave
- type Stack
- func (s *Stack) GetApplications() map[string]*Application
- func (s *Stack) GetRunner() Runner
- func (s *Stack) GetStack() *Stack
- func (s Stack) ID() string
- func (s *Stack) Merge(child *Stack)
- func (s *Stack) Run(request *RunRequest, context *RunContext) error
- func (s *Stack) String() string
- func (s *Stack) Validate() error
- type StackDeployScheduler
- func (s *StackDeployScheduler) Disconnected(scheduler.SchedulerDriver)
- func (s *StackDeployScheduler) Error(driver scheduler.SchedulerDriver, message string)
- func (s *StackDeployScheduler) ExecutorLost(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, ...)
- func (s *StackDeployScheduler) FrameworkMessage(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, ...)
- func (s *StackDeployScheduler) GetMesosState() MesosState
- func (s *StackDeployScheduler) GetScheduledTasks() []*ScheduledTask
- func (s *StackDeployScheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID)
- func (s *StackDeployScheduler) Registered(driver scheduler.SchedulerDriver, id *mesos.FrameworkID, ...)
- func (s *StackDeployScheduler) RemoveScheduled(id int64) bool
- func (s *StackDeployScheduler) Reregistered(driver scheduler.SchedulerDriver, master *mesos.MasterInfo)
- func (s *StackDeployScheduler) ResourceOffers(driver scheduler.SchedulerDriver, offers []*mesos.Offer)
- func (s *StackDeployScheduler) RunApplication(application *Application) <-chan *ApplicationRunStatus
- func (s *StackDeployScheduler) Shutdown(driver *scheduler.MesosSchedulerDriver)
- func (s *StackDeployScheduler) SlaveLost(driver scheduler.SchedulerDriver, slave *mesos.SlaveID)
- func (s *StackDeployScheduler) Start() error
- func (s *StackDeployScheduler) StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus)
- type StackDeployServer
- func (ts *StackDeployServer) Admin(handler http.HandlerFunc) http.HandlerFunc
- func (ts *StackDeployServer) Auth(handler http.HandlerFunc) http.HandlerFunc
- func (ts *StackDeployServer) CreateLayerHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) CreateStackHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) CreateUserHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) GetStackHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) HealthHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) ListHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) RefreshTokenHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) RemoveScheduledHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) RemoveStackHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) RunHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) ScheduledHandler(w http.ResponseWriter, r *http.Request)
- func (ts *StackDeployServer) Start()
- type StackState
- type StackStatus
- type StateStorage
- type Storage
- type TaskRunner
- type User
- type UserRole
- type UserStorage
- type Variables
- func (v *Variables) All() map[string]string
- func (v *Variables) Get(key string) (string, error)
- func (v *Variables) MarshalJSON() ([]byte, error)
- func (v *Variables) MustGet(key string) string
- func (v *Variables) SetArbitraryVariable(key string, value string)
- func (v *Variables) SetGlobalVariable(key string, value string)
- func (v *Variables) SetStackVariable(key string, value string)
- func (v *Variables) String() string
- func (v *Variables) UnmarshalJSON(data []byte) error
Constants ¶
View Source
const ( LayerZone = iota LayerCluster LayerDataCenter LayerStack )
View Source
const ( ConfigStack = iota ConfigDataCenter ConfigCluster ConfigZone )
Variables ¶
View Source
var ApplicationStatuses = map[ApplicationStatus]string{ ApplicationStatusStaging: "STAGING", ApplicationStatusRunning: "RUNNING", ApplicationStatusFailed: "FAILED", }
View Source
var ErrApplicationDoesNotExist = errors.New("Application does not exist")
View Source
var ErrApplicationInvalidCPU = errors.New("Invalid application CPU")
View Source
var ErrApplicationInvalidInstances = errors.New("Invalid number of application instances: supported are numbers greater than zero and 'all'")
View Source
var ErrApplicationInvalidMem = errors.New("Invalid application Mem")
View Source
var ErrApplicationNoID = errors.New("No application ID")
View Source
var ErrApplicationNoTaskRunner = errors.New("No task runner available for application")
View Source
var ErrApplicationNoType = errors.New("No application type")
View Source
var ErrHealthcheckNotPassing = errors.New("Task healthcheck is not passing")
View Source
var ErrStackStateDoesNotExist = errors.New("Stack state does not exist")
View Source
var ErrStackStateExists = errors.New("Stack state already exists")
View Source
var ErrTaskNotRunning = errors.New("Task is not running")
View Source
var Logger = log.NewDefaultLogger()
View Source
var MesosTaskRunners map[string]MesosTaskRunner
View Source
var TaskRunners map[string]TaskRunner
Functions ¶
func NewStorage ¶
Types ¶
type Application ¶
type Application struct {
sync.RWMutex
Type string `yaml:"type,omitempty"`
ID string `yaml:"id,omitempty"`
Version string `yaml:"version,omitempty"`
Cpu float64 `yaml:"cpu,omitempty"`
Mem float64 `yaml:"mem,omitempty"`
Ports []int `yaml:"ports,omitempty"`
Instances string `yaml:"instances,omitempty"`
Constraints [][]string `yaml:"constraints,omitempty"`
User string `yaml:"user,omitempty"`
Healthcheck string `yaml:"healthcheck,omitempty"`
LaunchCommand string `yaml:"launch_command,omitempty"`
Args []string `yaml:"args,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
ArtifactURLs []string `yaml:"artifact_urls,omitempty"`
AdditionalArtifacts []string `yaml:"additional_artifacts,omitempty"`
Scheduler map[string]string `yaml:"scheduler,omitempty"`
Tasks yaml.MapSlice `yaml:"tasks,omitempty"`
Dependencies []string `yaml:"dependencies,omitempty"`
Docker *Docker `yaml:"docker,omitempty"`
StartTime string `yaml:"start_time,omitempty"`
TimeSchedule string `yaml:"time_schedule,omitempty"`
BeforeScheduler []string `yaml:"before_scheduler,omitempty"`
AfterScheduler []string `yaml:"after_scheduler,omitempty"`
BeforeTask []string `yaml:"before_task,omitempty"`
AfterTask []string `yaml:"after_task,omitempty"`
AfterTasks []string `yaml:"after_tasks,omitempty"`
}
func (*Application) GetConstraints ¶
func (a *Application) GetConstraints() map[string][]constraints.Constraint
func (*Application) GetInstances ¶
func (a *Application) GetInstances(mesos MesosState) int
func (*Application) IsDependencySatisfied ¶
func (a *Application) IsDependencySatisfied(runningApps map[string]ApplicationStatus) bool
func (*Application) Run ¶
func (a *Application) Run(context *RunContext, maxWait int) error
func (*Application) String ¶
func (a *Application) String() string
func (*Application) Validate ¶
func (a *Application) Validate() error
type ApplicationRunStatus ¶
type ApplicationRunStatus struct {
Application *Application
Error error
}
func NewApplicationRunStatus ¶
func NewApplicationRunStatus(application *Application, err error) *ApplicationRunStatus
type ApplicationStatus ¶
type ApplicationStatus int
const ( ApplicationStatusStaging ApplicationStatus = iota ApplicationStatusRunning ApplicationStatusFailed )
type CassandraStateStorage ¶
type CassandraStateStorage struct {
// contains filtered or unexported fields
}
func NewCassandraStateStorage ¶
func NewCassandraStateStorage(connection *gocql.Session, keyspace string) (*CassandraStateStorage, error)
func (*CassandraStateStorage) GetStackState ¶
func (css *CassandraStateStorage) GetStackState(name string, zone string) (*StackState, error)
func (*CassandraStateStorage) SaveApplicationStatus ¶
func (css *CassandraStateStorage) SaveApplicationStatus(stack string, zone string, applicationName string, status ApplicationStatus) error
func (*CassandraStateStorage) SaveStackStatus ¶
func (css *CassandraStateStorage) SaveStackStatus(name string, zone string, status StackStatus) error
func (*CassandraStateStorage) SaveStackVariables ¶
func (css *CassandraStateStorage) SaveStackVariables(stack string, zone string, variables *Variables) error
type CassandraStorage ¶
type CassandraStorage struct {
// contains filtered or unexported fields
}
func (*CassandraStorage) GetAll ¶
func (cs *CassandraStorage) GetAll() ([]*Stack, error)
func (*CassandraStorage) GetLayer ¶
func (cs *CassandraStorage) GetLayer(name string) (*Layer, error)
func (*CassandraStorage) GetLayersStack ¶
func (cs *CassandraStorage) GetLayersStack(name string) (Merger, error)
func (*CassandraStorage) GetStack ¶
func (cs *CassandraStorage) GetStack(name string) (*Stack, error)
func (*CassandraStorage) GetStackRunner ¶
func (cs *CassandraStorage) GetStackRunner(name string) (Runner, error)
func (*CassandraStorage) Init ¶
func (cs *CassandraStorage) Init() error
func (*CassandraStorage) RemoveStack ¶
func (cs *CassandraStorage) RemoveStack(stack string, force bool) error
func (*CassandraStorage) StoreStack ¶
func (cs *CassandraStorage) StoreStack(stack *Stack) error
type CassandraUserStorage ¶
type CassandraUserStorage struct {
// contains filtered or unexported fields
}
func NewCassandraUserStorage ¶
func (CassandraUserStorage) CheckKey ¶
func (cus CassandraUserStorage) CheckKey(name string, key string) (bool, error)
func (CassandraUserStorage) CreateUser ¶
func (cus CassandraUserStorage) CreateUser(name string, role UserRole) (string, error)
func (CassandraUserStorage) GetUser ¶
func (cus CassandraUserStorage) GetUser(name string) (*User, error)
func (CassandraUserStorage) Init ¶
func (cus CassandraUserStorage) Init() (string, error)
func (CassandraUserStorage) IsAdmin ¶
func (cus CassandraUserStorage) IsAdmin(name string) (bool, error)
func (CassandraUserStorage) RefreshToken ¶
func (cus CassandraUserStorage) RefreshToken(name string) (string, error)
func (CassandraUserStorage) SaveUser ¶
func (cus CassandraUserStorage) SaveUser(user User) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateLayer ¶
func (c *Client) CreateLayer(data *CreateLayerRequest) error
func (*Client) CreateStack ¶
func (c *Client) CreateStack(data *CreateStackRequest) error
func (*Client) CreateUser ¶
func (c *Client) CreateUser(data *CreateUserRequest) (string, error)
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(data *RefreshTokenRequest) (string, error)
func (*Client) RemoveScheduled ¶
func (c *Client) RemoveScheduled(data *RemoveScheduledRequest) (string, error)
func (*Client) RemoveStack ¶
func (c *Client) RemoveStack(data *RemoveStackRequest) error
func (*Client) Run ¶
func (c *Client) Run(data *RunRequest) error
func (*Client) Scheduled ¶
func (c *Client) Scheduled() ([]*ScheduledTask, error)
type CreateLayerRequest ¶
type CreateStackRequest ¶
type CreateStackRequest struct {
Stackfile string `json:"stackfile"`
}
type CreateUserRequest ¶
type CronScheduler ¶
type Docker ¶
type Docker struct {
ForcePullImage bool `yaml:"force_pull_image,omitempty"`
Image string `yaml:"image,omitempty"`
Network string `yaml:"network,omitempty"`
Parameters map[string]string `yaml:"parameters,omitempty"`
PortMappings []*DockerPortMapping `yaml:"port_mappings,omitempty"`
Privileged bool `yaml:"privileged,omitempty"`
Volumes []*DockerVolume `yaml:"volumes,omitempty"`
}
func (*Docker) MarathonContainer ¶
type DockerPortMapping ¶
type DockerPortMapping struct {
ContainerPort int `yaml:"container_port,omitempty"`
HostPort int `yaml:"host_port"`
ServicePort int `yaml:"service_port,omitempty"`
Protocol string `yaml:"protocol"`
}
func (*DockerPortMapping) Marathon ¶
func (dpm *DockerPortMapping) Marathon() *marathon.PortMapping
type DockerVolume ¶
type DockerVolume struct {
ContainerPath string `yaml:"container_path,omitempty"`
HostPath string `yaml:"host_path,omitempty"`
Mode string `yaml:"mode,omitempty"`
}
func (*DockerVolume) Marathon ¶
func (dv *DockerVolume) Marathon() *marathon.Volume
type FrameworkStorage ¶
type FrameworkStorage struct {
FrameworkID string
BootstrapContext *Variables
// contains filtered or unexported fields
}
func NewFrameworkStorage ¶
func NewFrameworkStorage(storage string) (*FrameworkStorage, error)
func (*FrameworkStorage) Load ¶
func (s *FrameworkStorage) Load()
func (*FrameworkStorage) Save ¶
func (s *FrameworkStorage) Save()
type GetStackRequest ¶
type GetStackRequest struct {
Name string `json:"name"`
}
type InMemoryStateStorage ¶
type InMemoryStateStorage struct {
// contains filtered or unexported fields
}
func NewInMemoryStateStorage ¶
func NewInMemoryStateStorage() *InMemoryStateStorage
func (*InMemoryStateStorage) GetStackState ¶
func (s *InMemoryStateStorage) GetStackState(stack string, zone string) (*StackState, error)
func (*InMemoryStateStorage) SaveApplicationStatus ¶
func (s *InMemoryStateStorage) SaveApplicationStatus(stack string, zone string, applicationName string, status ApplicationStatus) error
func (*InMemoryStateStorage) SaveStackStatus ¶
func (s *InMemoryStateStorage) SaveStackStatus(name string, zone string, status StackStatus) error
func (*InMemoryStateStorage) SaveStackVariables ¶
func (s *InMemoryStateStorage) SaveStackVariables(stack string, zone string, variables *Variables) error
type InMemoryStorage ¶
type InMemoryStorage struct {
// contains filtered or unexported fields
}
func NewInMemoryStorage ¶
func NewInMemoryStorage() *InMemoryStorage
func (*InMemoryStorage) GetAll ¶
func (s *InMemoryStorage) GetAll() ([]*Stack, error)
func (*InMemoryStorage) GetLayersStack ¶
func (s *InMemoryStorage) GetLayersStack(name string) (Merger, error)
func (*InMemoryStorage) GetStackRunner ¶
func (s *InMemoryStorage) GetStackRunner(name string) (Runner, error)
func (*InMemoryStorage) Init ¶
func (s *InMemoryStorage) Init() error
func (*InMemoryStorage) RemoveStack ¶
func (s *InMemoryStorage) RemoveStack(name string, force bool) error
func (*InMemoryStorage) StoreStack ¶
func (s *InMemoryStorage) StoreStack(stack *Stack) error
type MesosClusterState ¶
type MesosClusterState struct {
ActivatedSlaves float64 `json:"activated_slaves"`
Slaves []Slave `json:"slaves"`
// contains filtered or unexported fields
}
TODO extend this struct when necessary
func NewMesosClusterState ¶
func NewMesosClusterState(master string) *MesosClusterState
func (*MesosClusterState) GetActivatedSlaves ¶
func (ms *MesosClusterState) GetActivatedSlaves() int
func (*MesosClusterState) GetSlaves ¶
func (ms *MesosClusterState) GetSlaves() []Slave
func (*MesosClusterState) String ¶
func (ms *MesosClusterState) String() string
func (*MesosClusterState) Update ¶
func (ms *MesosClusterState) Update() error
type MesosState ¶
type MesosTaskRunner ¶
type MesosTaskRunner interface {
ScheduleApplication(*Application, MesosState, CronScheduler) (int64, <-chan *ApplicationRunStatus)
DeleteSchedule(int64, CronScheduler)
StageApplication(application *Application, mesos MesosState) <-chan *ApplicationRunStatus
ResourceOffer(driver scheduler.SchedulerDriver, offer *mesos.Offer) (string, error)
StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus) bool
}
type NoopUserStorage ¶
type NoopUserStorage struct{}
func (*NoopUserStorage) CreateUser ¶
func (s *NoopUserStorage) CreateUser(string, UserRole) (string, error)
func (*NoopUserStorage) RefreshToken ¶
func (s *NoopUserStorage) RefreshToken(string) (string, error)
func (*NoopUserStorage) SaveUser ¶
func (s *NoopUserStorage) SaveUser(User) error
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
Name string `json:"name"`
}
type RemoveScheduledRequest ¶
type RemoveScheduledRequest struct {
ID int64 `json:"id"`
}
type RemoveStackRequest ¶
type RunContext ¶
type RunContext struct {
StackName string
Zone string
Variables *Variables
Marathon marathon.Marathon
Scheduler Scheduler
StateStorage StateStorage
}
func NewRunContext ¶
func NewRunContext(variables *Variables) *RunContext
type RunRequest ¶
type Runner ¶
type Runner interface {
Run(*RunRequest, *RunContext) error
GetStack() *Stack
}
type ScheduledTask ¶
type Scheduler ¶
type Scheduler interface {
Start() error
RunApplication(application *Application) <-chan *ApplicationRunStatus
GetMesosState() MesosState
GetScheduledTasks() []*ScheduledTask
RemoveScheduled(int64) bool
}
type SchedulerConfig ¶
type SchedulerConfig struct {
Master string
Storage *FrameworkStorage
User string
FrameworkName string
FrameworkRole string
FailoverTimeout time.Duration
}
func NewSchedulerConfig ¶
func NewSchedulerConfig() *SchedulerConfig
type Slave ¶
type Stack ¶
type Stack struct {
Namespace string
Name string `yaml:"name,omitempty"`
From string `yaml:"from,omitempty"`
Applications map[string]*Application `yaml:"applications,omitempty"`
Layer int
}
func UnmarshalStack ¶
func (*Stack) GetApplications ¶
func (s *Stack) GetApplications() map[string]*Application
func (*Stack) Run ¶
func (s *Stack) Run(request *RunRequest, context *RunContext) error
type StackDeployScheduler ¶
type StackDeployScheduler struct {
*SchedulerConfig
Cron *cron.Cron
// contains filtered or unexported fields
}
func NewScheduler ¶
func NewScheduler(config *SchedulerConfig) *StackDeployScheduler
func (*StackDeployScheduler) Disconnected ¶
func (s *StackDeployScheduler) Disconnected(scheduler.SchedulerDriver)
func (*StackDeployScheduler) Error ¶
func (s *StackDeployScheduler) Error(driver scheduler.SchedulerDriver, message string)
func (*StackDeployScheduler) ExecutorLost ¶
func (s *StackDeployScheduler) ExecutorLost(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, status int)
func (*StackDeployScheduler) FrameworkMessage ¶
func (s *StackDeployScheduler) FrameworkMessage(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, message string)
func (*StackDeployScheduler) GetMesosState ¶
func (s *StackDeployScheduler) GetMesosState() MesosState
func (*StackDeployScheduler) GetScheduledTasks ¶
func (s *StackDeployScheduler) GetScheduledTasks() []*ScheduledTask
func (*StackDeployScheduler) OfferRescinded ¶
func (s *StackDeployScheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID)
func (*StackDeployScheduler) Registered ¶
func (s *StackDeployScheduler) Registered(driver scheduler.SchedulerDriver, id *mesos.FrameworkID, master *mesos.MasterInfo)
func (*StackDeployScheduler) RemoveScheduled ¶
func (s *StackDeployScheduler) RemoveScheduled(id int64) bool
func (*StackDeployScheduler) Reregistered ¶
func (s *StackDeployScheduler) Reregistered(driver scheduler.SchedulerDriver, master *mesos.MasterInfo)
func (*StackDeployScheduler) ResourceOffers ¶
func (s *StackDeployScheduler) ResourceOffers(driver scheduler.SchedulerDriver, offers []*mesos.Offer)
func (*StackDeployScheduler) RunApplication ¶
func (s *StackDeployScheduler) RunApplication(application *Application) <-chan *ApplicationRunStatus
func (*StackDeployScheduler) Shutdown ¶
func (s *StackDeployScheduler) Shutdown(driver *scheduler.MesosSchedulerDriver)
func (*StackDeployScheduler) SlaveLost ¶
func (s *StackDeployScheduler) SlaveLost(driver scheduler.SchedulerDriver, slave *mesos.SlaveID)
func (*StackDeployScheduler) Start ¶
func (s *StackDeployScheduler) Start() error
func (*StackDeployScheduler) StatusUpdate ¶
func (s *StackDeployScheduler) StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus)
type StackDeployServer ¶
type StackDeployServer struct {
// contains filtered or unexported fields
}
func NewApiServer ¶
func NewApiServer(api string, marathonClient marathon.Marathon, globalVariables map[string]string, storage Storage, userStorage UserStorage, stateStorage StateStorage, scheduler Scheduler) *StackDeployServer
func (*StackDeployServer) Admin ¶
func (ts *StackDeployServer) Admin(handler http.HandlerFunc) http.HandlerFunc
Middleware for admin role check
func (*StackDeployServer) Auth ¶
func (ts *StackDeployServer) Auth(handler http.HandlerFunc) http.HandlerFunc
Middleware for authentication check
func (*StackDeployServer) CreateLayerHandler ¶
func (ts *StackDeployServer) CreateLayerHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) CreateStackHandler ¶
func (ts *StackDeployServer) CreateStackHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) CreateUserHandler ¶
func (ts *StackDeployServer) CreateUserHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) GetStackHandler ¶
func (ts *StackDeployServer) GetStackHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) HealthHandler ¶
func (ts *StackDeployServer) HealthHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) ListHandler ¶
func (ts *StackDeployServer) ListHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) RefreshTokenHandler ¶
func (ts *StackDeployServer) RefreshTokenHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) RemoveScheduledHandler ¶
func (ts *StackDeployServer) RemoveScheduledHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) RemoveStackHandler ¶
func (ts *StackDeployServer) RemoveStackHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) RunHandler ¶
func (ts *StackDeployServer) RunHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) ScheduledHandler ¶
func (ts *StackDeployServer) ScheduledHandler(w http.ResponseWriter, r *http.Request)
func (*StackDeployServer) Start ¶
func (ts *StackDeployServer) Start()
type StackState ¶
type StackState struct {
Name string
Zone string
Status StackStatus
Variables *Variables
Applications map[string]ApplicationStatus
}
type StackStatus ¶
type StackStatus int
const ( StackStatusStaging StackStatus = iota StackStatusRunning StackStatusFailed )
type StateStorage ¶
type StateStorage interface {
SaveStackStatus(name string, zone string, status StackStatus) error
SaveApplicationStatus(stack string, zone string, applicationName string, status ApplicationStatus) error
SaveStackVariables(stack string, zone string, variables *Variables) error
GetStackState(name string, zone string) (*StackState, error)
}
type Storage ¶
type Storage interface {
GetAll() ([]*Stack, error)
GetStack(string) (*Stack, error)
GetStackRunner(string) (Runner, error)
StoreStack(*Stack) error
RemoveStack(string, bool) error
Init() error
GetLayersStack(string) (Merger, error)
}
func NewCassandraStorage ¶
type TaskRunner ¶
type TaskRunner interface {
FillContext(context *Variables, application *Application, task marathon.Task) error
RunTask(context *Variables, application *Application, task map[string]string) error
}
type User ¶
func (*User) UnmarshalJSON ¶
type UserStorage ¶
type Variables ¶
type Variables struct {
// contains filtered or unexported fields
}
func NewVariables ¶
func NewVariables() *Variables
func (*Variables) MarshalJSON ¶
func (*Variables) SetArbitraryVariable ¶
func (*Variables) SetGlobalVariable ¶
func (*Variables) SetStackVariable ¶
func (*Variables) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.