iaas

package
v19.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 28 Imported by: 38

Documentation

Index

Constants

View Source
const (
	// CoreDRFWeight is the Dominant Resource Fairness weight of a core
	CoreDRFWeight float32 = 1.0
	// RAMDRFWeight is the Dominant Resource Fairness weight of 1 GB of RAM
	RAMDRFWeight float32 = 1.0 / 8.0
	// DiskDRFWeight is the Dominant Resource Fairness weight of 1 GB of Disk
	DiskDRFWeight float32 = 1.0 / 16.0
)

Variables

This section is empty.

Functions

func GetTenantNames

func GetTenantNames() (map[string]string, error)

GetTenantNames returns all known tenants names

func GetTenants

func GetTenants() ([]interface{}, error)

GetTenants returns all known tenants

func InitializeBucket

func InitializeBucket(svc *service, location objectstorage.Location) error

InitializeBucket creates the Object Storage Container/Bucket that will store the metadata

func RankDRF

func RankDRF(t *resources.HostTemplate) float32

RankDRF computes the Dominant Resource Fairness Rank of an host template

func Register

func Register(name string, provider api.Provider)

Register a Client referenced by the provider name. Ex: "ovh", ovh.New() This function shoud be called by the init function of each provider to be registered in SafeScale

func SimilarityScore

func SimilarityScore(ref string, s string) float64

SimilarityScore computes a similariy score between 2 strings

Types

type ByRankDRF

type ByRankDRF []*resources.HostTemplate

ByRankDRF implements sort.Interface for []HostTemplate based on the Dominant Resource Fairness

func (ByRankDRF) Len

func (a ByRankDRF) Len() int

func (ByRankDRF) Less

func (a ByRankDRF) Less(i, j int) bool

func (ByRankDRF) Swap

func (a ByRankDRF) Swap(i, j int)

type Service

type Service interface {
	CreateHostWithKeyPair(resources.HostRequest) (*resources.Host, *userdata.Content, *resources.KeyPair, error)
	FilterImages(string) ([]resources.Image, error)
	GetMetadataKey() *crypt.Key
	GetMetadataBucket() objectstorage.Bucket
	ListHostsByName() (map[string]*resources.Host, error)
	SearchImage(string) (*resources.Image, error)
	SelectTemplatesBySize(resources.SizingRequirements, bool) ([]*resources.HostTemplate, error)
	SelectTemplateByName(string) (*resources.HostTemplate, error)
	WaitHostState(string, HostState.Enum, time.Duration) error
	WaitVolumeState(string, VolumeState.Enum, time.Duration) (*resources.Volume, error)

	// --- from interface iaas.Providers ---
	providers.Provider

	objectstorage.Location
}

Service agglomerates Provider and ObjectStorage interfaces in a single interface completed with higher-level methods

func UseService

func UseService(tenantName string) (Service, error)

UseService return the service referenced by the given name. If necessary, this function try to load service from configuration file

type StorageServices

type StorageServices struct {
	// contains filtered or unexported fields
}

StorageServices ...

func NewStorageService

func NewStorageService() StorageServices

NewStorageService ...

func UseStorages

func UseStorages(tenantNames []string) (*StorageServices, error)

UseStorages return the storageService build around storages referenced in tenantNames

func (*StorageServices) GetBuckets

func (sts *StorageServices) GetBuckets() []objectstorage.Bucket

GetBuckets ...

func (*StorageServices) RegisterStorage

func (sts *StorageServices) RegisterStorage(tenantName string) error

RegisterStorage ...

Directories

Path Synopsis
api
gcp
ovh
enums/VolumeSpeed
Package VolumeSpeed defines an enum to represents Volume type
Package VolumeSpeed defines an enum to represents Volume type
enums/VolumeState
Package VolumeState defines an enum to represents Volume states life cycle
Package VolumeState defines an enum to represents Volume states life cycle
api
gcp

Jump to

Keyboard shortcuts

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