pools

package
v0.0.0-...-386ff76 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PoolKey        = "Pool"
	CleanupPoolKey = "Cleanup-Pool"
)

Variables

This section is empty.

Functions

func GetCleanupPoolKey

func GetCleanupPoolKey(name string) string

func GetPoolKey

func GetPoolKey(name string) string

func IsCommandMissingError

func IsCommandMissingError(err error) bool

func NewCommandMissingError

func NewCommandMissingError() error

func PrintIfDebug

func PrintIfDebug(debug bool, title string, out string)

Types

type Pool

type Pool struct {
	Name                        string            `json:"Name"`
	Description                 string            `json:"Description"`
	Size                        int               `json:"Size"`
	MaxSize                     int               `json:"MaxSize"`
	UnusedClusterTimeout        duration.Duration `json:"UnusedClusterTimeout"`
	UsedClusterTimeout          duration.Duration `json:"UsedClusterTimeout"`
	ParallelProvisioning        int               `json:"ParallelProvisioning"`
	ParallelDeProvisioning      int               `json:"ParallelDeProvisioning"`
	ProvisionCommand            string            `json:"ProvisionCommand"`
	DeProvisionCommand          string            `json:"DeProvisionCommand"`
	ForceDeprovisionCommand     string            `json:"ForceDeProvisionCommand"`
	ClusterURLCommand           string            `json:"ClusterUrlCommand"`
	ClusterAdminUserCommand     string            `json:"ClusterAdminUserCommand"`
	ClusterAdminPasswordCommand string            `json:"ClusterAdminPasswordCommand"`
	ClusterCAFilePath           string            `json:"ClusterCAFilePath"`
	ClusterCertFilePath         string            `json:"ClusterCertFilePath"`
	ClusterKeyFilePath          string            `json:"ClusterKeyFilePath"`
	ClusterExtraInfoCommand     string            `json:"ClusterExtraInfoCommand"`
}

Pool repersents generic of a pool

func List

func List(ctx *generic.Context, removal bool) ([]Pool, error)

List gets all pools in database

func NewEmptyPool

func NewEmptyPool() *Pool

func PoolByName

func PoolByName(ctx *generic.Context, name string, removal bool) (*Pool, error)

PoolByName gets a pool of specified name. If removal is set, then it gets the pool only if it marked for removal

func (Pool) ActivateCluster

func (p Pool) ActivateCluster(ctx *generic.Context) (*clusters.Cluster, error)

ActivateCluster activates a cluster, if it is available. This is the only direct db func in pool as we need to ensure cluster activation is a transaction

func (Pool) Destroy

func (p Pool) Destroy(ctx *generic.Context) error

Destroys the clusters and the pool

func (Pool) ExpiresOn

func (p Pool) ExpiresOn(c *clusters.Cluster) time.Time

Gets when a cluster will expire in conjunction with a pool config

func (Pool) GC

func (p Pool) GC(ctx *generic.Context) error

GC deprovisions clusters that have failed or outlived a timeout

func (Pool) GetClusters

func (p Pool) GetClusters(ctx *generic.Context) (*clusters.ClusterList, error)

func (Pool) IsMarkedForRemoval

func (p Pool) IsMarkedForRemoval(ctx *generic.Context) bool

func (Pool) MarkForRemoval

func (p Pool) MarkForRemoval(ctx *generic.Context) error

Mark for removal marks a pool for garbage collection

func (Pool) Reconcile

func (p Pool) Reconcile(ctx *generic.Context) error

Reconcile ensured that expected and actual pool size match

func (Pool) SaveInDB

func (p Pool) SaveInDB(ctx *generic.Context, removal bool) error

SaveInDB Saves the pool into database

Jump to

Keyboard shortcuts

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