iaas

package
v0.0.0-...-9451de5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 17 Imported by: 0

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

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

func BuildHealthCheck(providerName string) func() error

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 Describe

func Describe(iaasName ...string) (string, error)

func DestroyTemplate

func DestroyTemplate(name string) error

func ExpandTemplate

func ExpandTemplate(name string, params map[string]string) (map[string]string, error)

func RegisterIaasProvider

func RegisterIaasProvider(name string, factory iaasFactory)

func ResetAll

func ResetAll()

Types

type Describer

type Describer interface {
	Describe() string
}

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 CreateMachine

func CreateMachine(params map[string]string) (*Machine, error)

func CreateMachineForIaaS

func CreateMachineForIaaS(iaasName string, params map[string]string) (*Machine, error)

func FindMachineByAddress

func FindMachineByAddress(address string) (Machine, error)

func FindMachineById

func FindMachineById(id string) (Machine, error)

func FindMachineByIdOrAddress

func FindMachineByIdOrAddress(id string, address string) (Machine, error)

Uses id or address, this is only used because previously we didn't have iaas-id in node metadata.

func ListMachines

func ListMachines() ([]Machine, error)

func (*Machine) Destroy

func (m *Machine) Destroy() error

func (*Machine) FormatNodeAddress

func (m *Machine) FormatNodeAddress() string

type NamedIaaS

type NamedIaaS struct {
	BaseIaaSName string
	IaaSName     string
}

func (*NamedIaaS) GetConfig

func (i *NamedIaaS) GetConfig(name string) (interface{}, error)

func (*NamedIaaS) GetConfigString

func (i *NamedIaaS) GetConfigString(name string) (string, error)

type Template

type Template struct {
	Name     string `bson:"_id"`
	IaaSName string
	Data     TemplateDataList
}

func FindTemplate

func FindTemplate(name string) (*Template, error)

func ListTemplates

func ListTemplates() ([]Template, error)

func (*Template) Save

func (t *Template) Save() error

func (*Template) Update

func (t *Template) Update(toMerge *Template) error

type TemplateData

type TemplateData struct {
	Name  string
	Value string
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL