iaas

package
v21.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

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 CacheMissOption

func CacheMissOption(fn func() (cache.Cacheable, fail.Error), timeout time.Duration) []data.ImmutableKeyValue

CacheMissOption returns []data.ImmutableKeyValue options to use on cache miss with timeout

func GetTenantNames

func GetTenantNames() (map[string]string, fail.Error)

GetTenantNames returns all known tenants names

func GetTenants

func GetTenants() ([]map[string]interface{}, fail.Error)

GetTenants returns all known tenants

func NullService

func NullService() *service

NullService creates a service instance corresponding to null value

func RankDRF

func RankDRF(t *abstract.HostTemplate) float32

RankDRF computes the Dominant Resource Fairness Rank of a host template

func Register

func Register(name string, provider providers.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

Types

type ByRankDRF

type ByRankDRF []*abstract.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 ResourceCache

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

ResourceCache contains the caches for all kinds of resources

func NewResourceCache

func NewResourceCache(name string) (*ResourceCache, fail.Error)

NewResourceCache initializes a new instance of ResourceCache

func (*ResourceCache) AddEntry

func (instance *ResourceCache) AddEntry(content cache.Cacheable) (ce *cache.Entry, xerr fail.Error)

AddEntry ...

func (*ResourceCache) CommitEntry

func (instance *ResourceCache) CommitEntry(key string, content cache.Cacheable) (ce *cache.Entry, xerr fail.Error)

CommitEntry confirms the entry in the cache with the content passed as parameter

func (*ResourceCache) FreeEntry

func (instance *ResourceCache) FreeEntry(key string) fail.Error

FreeEntry removes the reservation in cache

func (*ResourceCache) Get

func (instance *ResourceCache) Get(key string, options ...data.ImmutableKeyValue) (ce *cache.Entry, xerr fail.Error)

Get returns the content associated with key

func (*ResourceCache) ReserveEntry

func (instance *ResourceCache) ReserveEntry(key string, timeout time.Duration) fail.Error

ReserveEntry sets a cache entry to reserve the key and returns the Entry associated

type Service

type Service interface {
	CreateHostWithKeyPair(abstract.HostRequest) (*abstract.HostFull, *userdata.Content, *abstract.KeyPair, fail.Error)
	FilterImages(string) ([]abstract.Image, fail.Error)
	FindTemplateBySizing(abstract.HostSizingRequirements) (*abstract.HostTemplate, fail.Error)
	FindTemplateByName(string) (*abstract.HostTemplate, fail.Error)
	GetProviderName() (string, fail.Error)
	GetMetadataBucket() (abstract.ObjectStorageBucket, fail.Error)
	GetMetadataKey() (*crypt.Key, fail.Error)
	InspectHostByName(string) (*abstract.HostFull, fail.Error)
	InspectSecurityGroupByName(networkID string, name string) (*abstract.SecurityGroup, fail.Error)
	ListHostsByName(bool) (map[string]*abstract.HostFull, fail.Error)
	ListTemplatesBySizing(abstract.HostSizingRequirements, bool) ([]*abstract.HostTemplate, fail.Error)
	ObjectStorageConfiguration() objectstorage.Config
	SearchImage(string) (*abstract.Image, fail.Error)
	TenantCleanup(bool) fail.Error // cleans up the data relative to SafeScale from tenant (not implemented yet)
	WaitHostState(string, hoststate.Enum, time.Duration) fail.Error
	WaitVolumeState(string, volumestate.Enum, time.Duration) (*abstract.Volume, fail.Error)

	GetCache(string) (*ResourceCache, fail.Error)

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

	LookupRuleInSecurityGroup(*abstract.SecurityGroup, *abstract.SecurityGroupRule) (bool, fail.Error)

	// Location --- from interface objectstorage.Location ---
	objectstorage.Location
}

Service consolidates Provider and ObjectStorage.Location interfaces in a single interface completed with higher-level methods

func UseService

func UseService(tenantName, metadataVersion string) (newService Service, xerr fail.Error)

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

Directories

Path Synopsis
aws
gcp
ovh
api
aws
Package aws contains the implementation of stack for Amazon
Package aws contains the implementation of stack for Amazon
gcp

Jump to

Keyboard shortcuts

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