iaas

package
v22.11.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 39 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

View Source
var IdentityField = []string{
	"AccessKey",
	"ApplicationKey",
	"OpenstackID",
	"OpenstackPassword",
	"Password",
	"SecretKey",
	"SecretAccessKey",
	"Username",
	"User",
	"UserID",
	"AlternateApiApplicationKey",
	"AlternateApiApplicationSecret",
	"AlternateApiConsumerKey",
	"AccessKeyID",
	"ProjectID",
	"DomainName",
	"DomainID",
	"IdentityEndpoint",
	"TokenID",
	"Endpoint",
	"provider",
	"IdentityEndpointVersion",

	"ProjectNumber",
	"project_id",
	"private_key_id",
	"private_key",
	"client_email",
	"client_id",
	"auth_uri",
	"token_uri",
	"auth_provider_x509_cert_url",
	"client_x509_cert_url",

	"ClientID",
	"ClientSecret",
	"SubscriptionID",
	"TenantID",
}
View Source
var MetadataField = []string{
	"AccessKey",
	"AuthURL",
	"DomainName",
	"Endpoint",
	"Domain",
	"OpenstackPassword",
	"ProjectID",
	"ProjectName",
	"Password",
	"Region",
	"AvailabilityZone",
	"SecretKey",
	"SecretAccessKey",
	"Tenant",
	"Type",
	"Username",
	"CryptKey",
	"MetadataBucketName",
	"Suffix",
	"Bucket",
}
View Source
var Networkfield = []string{
	"ProviderNetwork",
	"VPCCIDR",
	"VPCName",
	"FloatingIPPool",
	"DefaultNetworkName",
	"DefaultNetworkCIDR",
	"ExternalNetwork",
	"NetworkEndpointVersion",
	"NetworkClientEndpointVersion",
}
View Source
var OStorageField = []string{
	"AccessKey",
	"AuthURL",
	"Domain",
	"DomainName",
	"Endpoint",
	"OpenstackPassword",
	"OpenstackID",
	"ProjectID",
	"ProjectName",
	"Password",
	"Region",
	"AvailabilityZone",
	"SecretKey",
	"SecretAccessKey",
	"Tenant",
	"Type",
	"Username",
	"ApplicationKey",
	"Suffix",
}
View Source
var Sections = []string{
	"metadata",
	"objectstorage",
	"compute",
	"network",
	"identity",
	"name",
	"Name",
	"client",
	"Client",
	"provider",
	"clientType",
	"team",
}
View Source
var TeamField = []string{
	"WithConsul",
	"ConsulURL",
	"TerraformVersion",
}

Functions

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 NewWrappedCache

func NewWrappedCache(cm *cache.Cache) *wrappedCache

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 should 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

Less returns what entry is less between indexes i and j, based on rank. If rank is identical, compares entry names

func (ByRankDRF) Swap

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

type Service

type Service interface {
	FilterImages(context.Context, string) ([]*abstract.Image, fail.Error)
	FindTemplateBySizing(context.Context, abstract.HostSizingRequirements) (*abstract.HostTemplate, fail.Error)
	FindTemplateByName(context.Context, string) (*abstract.HostTemplate, fail.Error)
	FindTemplateByID(context.Context, string) (*abstract.HostTemplate, fail.Error)
	GetProviderName() (string, fail.Error)
	GetMetadataBucket(ctx context.Context) (abstract.ObjectStorageBucket, fail.Error)
	GetMetadataKey() (*crypt.Key, fail.Error)
	GetCache(context.Context) (cache.CacheInterface, fail.Error)
	InspectSecurityGroupByName(ctx context.Context, networkID string, name string) (*abstract.SecurityGroup, fail.Error)
	ListHostsWithTags(context.Context, []string, map[string]string) ([]*abstract.HostFull, fail.Error)
	ListTemplatesBySizing(context.Context, abstract.HostSizingRequirements, bool) ([]*abstract.HostTemplate, fail.Error)
	ObjectStorageConfiguration(ctx context.Context) (objectstorage.Config, fail.Error)
	SearchImage(context.Context, string) (*abstract.Image, fail.Error)

	GetLock(abstract.Enum) (*sync.Mutex, fail.Error)

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

	LookupRuleInSecurityGroup(context.Context, *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(inctx context.Context, tenantName string, metadataVersion string) (newService Service, ferr 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