defaults

package
v0.0.0-...-0d95af9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAmazonProfileTablaName = "amazon_default_profile"
	DefaultAzureProfileTablaName  = "azure_default_profile"
	DefaultGoogleProfileTablaName = "google_default_profile"
)

cluster profile table names

Variables

This section is empty.

Functions

func GetDefaultProfileName

func GetDefaultProfileName() string

GetDefaultProfileName reads the default profile name env var

func SetDefaultValues

func SetDefaultValues() error

SetDefaultValues saves the default cluster profile into the database if not exists yet

Types

type AKSProfile

type AKSProfile struct {
	DefaultModel
	Location          string `gorm:"default:'eastus'"`
	NodeInstanceType  string `gorm:"default:'Standard_D2_v2'"`
	AgentCount        int    `gorm:"default:1"`
	AgentName         string `gorm:"default:'agentpool1'"`
	KubernetesVersion string `gorm:"default:'1.8.2'"`
}

AKSProfile describes an Azure cluster profile

func (*AKSProfile) DeleteProfile

func (d *AKSProfile) DeleteProfile() error

DeleteProfile deletes cluster profile from database

func (*AKSProfile) GetProfile

func (d *AKSProfile) GetProfile() *components.ClusterProfileResponse

GetProfile load profile from database and converts ClusterProfileResponse

func (*AKSProfile) GetType

func (d *AKSProfile) GetType() string

GetType returns profile's cloud type

func (*AKSProfile) IsDefinedBefore

func (d *AKSProfile) IsDefinedBefore() bool

IsDefinedBefore returns true if database contains en entry with profile name

func (*AKSProfile) SaveInstance

func (d *AKSProfile) SaveInstance() error

SaveInstance saves cluster profile into database

func (AKSProfile) TableName

func (AKSProfile) TableName() string

TableName overrides AKSProfile's table name

func (*AKSProfile) UpdateProfile

func (d *AKSProfile) UpdateProfile(r *components.ClusterProfileRequest, withSave bool) error

UpdateProfile update profile's data with ClusterProfileRequest's data and if bool is true then update in the database

type AWSProfile

type AWSProfile struct {
	DefaultModel
	Location           string `gorm:"default:'eu-west-1'"`
	NodeInstanceType   string `gorm:"default:'m4.xlarge'"`
	NodeImage          string `gorm:"default:'ami-06d1667f'"`
	MasterInstanceType string `gorm:"default:'m4.xlarge'"`
	MasterImage        string `gorm:"default:'ami-06d1667f'"`
	NodeSpotPrice      string `gorm:"default:'0.2'"`
	NodeMinCount       int    `gorm:"default:1"`
	NodeMaxCount       int    `gorm:"default:2"`
}

AWSProfile describes an Amazon cluster profile

func (*AWSProfile) DeleteProfile

func (d *AWSProfile) DeleteProfile() error

DeleteProfile deletes cluster profile from database

func (*AWSProfile) GetProfile

func (d *AWSProfile) GetProfile() *components.ClusterProfileResponse

GetProfile load profile from database and converts ClusterProfileResponse

func (*AWSProfile) GetType

func (d *AWSProfile) GetType() string

GetType returns profile's cloud type

func (*AWSProfile) IsDefinedBefore

func (d *AWSProfile) IsDefinedBefore() bool

IsDefinedBefore returns true if database contains en entry with profile name

func (*AWSProfile) SaveInstance

func (d *AWSProfile) SaveInstance() error

SaveInstance saves cluster profile into database

func (AWSProfile) TableName

func (AWSProfile) TableName() string

TableName overrides AWSProfile's table name

func (*AWSProfile) UpdateProfile

func (d *AWSProfile) UpdateProfile(r *components.ClusterProfileRequest, withSave bool) error

UpdateProfile update profile's data with ClusterProfileRequest's data and if bool is true then update in the database

type ClusterProfile

type ClusterProfile interface {
	IsDefinedBefore() bool
	SaveInstance() error
	GetType() string
	GetProfile() *components.ClusterProfileResponse
	UpdateProfile(*components.ClusterProfileRequest, bool) error
	DeleteProfile() error
}

ClusterProfile describes a cluster profile

func GetAllProfiles

func GetAllProfiles(cloudType string) ([]ClusterProfile, error)

GetAllProfiles loads all saved cluster profile from database by given cloud type

func GetDefaultProfiles

func GetDefaultProfiles() []ClusterProfile

GetDefaultProfiles create all types of clouds with default profile name

func GetProfile

func GetProfile(cloudType string, name string) (ClusterProfile, error)

GetProfile finds cluster profile from database by given name and cloud type

type DefaultModel

type DefaultModel struct {
	Name      string `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

DefaultModel describes the common variables all types of clouds

type GKEProfile

type GKEProfile struct {
	DefaultModel
	Location         string `gorm:"default:'us-central1-a'"`
	NodeInstanceType string `gorm:"default:'n1-standard-1'"`
	NodeCount        int    `gorm:"default:1"`
	NodeVersion      string `gorm:"default:'1.7.12-gke.1'"`
	MasterVersion    string `gorm:"default:'1.7.12-gke.1'"`
	ServiceAccount   string
}

GKEProfile describes a Google cluster profile

func (*GKEProfile) DeleteProfile

func (d *GKEProfile) DeleteProfile() error

DeleteProfile deletes cluster profile from database

func (*GKEProfile) GetProfile

func (d *GKEProfile) GetProfile() *components.ClusterProfileResponse

GetProfile load profile from database and converts ClusterProfileResponse

func (*GKEProfile) GetType

func (d *GKEProfile) GetType() string

GetType returns profile's cloud type

func (*GKEProfile) IsDefinedBefore

func (d *GKEProfile) IsDefinedBefore() bool

IsDefinedBefore returns true if database contains en entry with profile name

func (*GKEProfile) SaveInstance

func (d *GKEProfile) SaveInstance() error

SaveInstance saves cluster profile into database

func (GKEProfile) TableName

func (GKEProfile) TableName() string

TableName overrides GKEProfile's table name

func (*GKEProfile) UpdateProfile

func (d *GKEProfile) UpdateProfile(r *components.ClusterProfileRequest, withSave bool) error

UpdateProfile update profile's data with ClusterProfileRequest's data and if bool is true then update in the database

Jump to

Keyboard shortcuts

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