Documentation ¶
Overview ¶
Package iaas provides interfaces that need to be satisfied in order to implement a new iaas on tsuru.
Package iaas provides interfaces that need to be satisfied in order to implement a new iaas on tsuru.
Index ¶
- Variables
- func BuildHealthCheck(providerName string) func() error
- func Describe(iaasName ...string) (string, error)
- func DestroyTemplate(name string) error
- func ExpandTemplate(name string, params map[string]string) (map[string]string, error)
- func RegisterIaasProvider(name string, factory iaasFactory)
- func ResetAll()
- type Describer
- type HealthChecker
- type IaaS
- type InitializableIaaS
- type Machine
- func CreateMachine(params map[string]string) (*Machine, error)
- func CreateMachineForIaaS(iaasName string, params map[string]string) (*Machine, error)
- func FindMachineByAddress(address string) (Machine, error)
- func FindMachineById(id string) (Machine, error)
- func FindMachineByIdOrAddress(id string, address string) (Machine, error)
- func ListMachines() ([]Machine, error)
- type NamedIaaS
- type Template
- type TemplateData
- type TemplateDataList
- type UserDataIaaS
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMachineNotFound = errors.New("machine not found")
)
View Source
var ErrNoDefaultIaaS = errors.New("no default iaas configured")
Functions ¶
func BuildHealthCheck ¶
BuildHealthCheck creates a healthcheck function for the given providerName.
It will call the HealthCheck() method in the provider (only if it's also a HealthChecker), for each instance of it (including the "main" instance and all custom IaaSes).
func DestroyTemplate ¶
func ExpandTemplate ¶
func RegisterIaasProvider ¶
func RegisterIaasProvider(name string, factory iaasFactory)
Types ¶
type HealthChecker ¶
type HealthChecker interface {
HealthCheck() error
}
type IaaS ¶
type IaaS interface { // Called when tsuru is creating a Machine. CreateMachine(params map[string]string) (*Machine, error) // Called when tsuru is destroying a Machine. DeleteMachine(m *Machine) error }
Every Tsuru IaaS must implement this interface.
type InitializableIaaS ¶
type InitializableIaaS interface {
Initialize() error
}
type Machine ¶
type Machine struct { Id string `bson:"_id"` Iaas string Status string Address string Port int Protocol string CreationParams map[string]string CustomData map[string]interface{} `json:"-"` CaCert []byte `json:"-"` ClientCert []byte `json:"-"` ClientKey []byte `json:"-"` }
func CreateMachineForIaaS ¶
func FindMachineByAddress ¶
func FindMachineById ¶
func FindMachineByIdOrAddress ¶
Uses id or address, this is only used because previously we didn't have iaas-id in node metadata.
func ListMachines ¶
func (*Machine) FormatNodeAddress ¶
type Template ¶
type Template struct { Name string `bson:"_id"` IaaSName string Data TemplateDataList }
func FindTemplate ¶
func ListTemplates ¶
type TemplateData ¶
type TemplateDataList ¶
type TemplateDataList []TemplateData
func (TemplateDataList) Len ¶
func (l TemplateDataList) Len() int
func (TemplateDataList) Less ¶
func (l TemplateDataList) Less(i, j int) bool
func (TemplateDataList) Swap ¶
func (l TemplateDataList) Swap(i, j int)
type UserDataIaaS ¶
type UserDataIaaS struct {
NamedIaaS
}
func (*UserDataIaaS) ReadUserData ¶
func (i *UserDataIaaS) ReadUserData(params map[string]string) (string, error)
Click to show internal directories.
Click to hide internal directories.