providers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 20 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 InitializeBucket

func InitializeBucket(svc api.ClientAPI, location objectstorage.Location) error

InitializeBucket creates the Object Storage Container/Bucket that will store the metadata id contains a unique identifier of the tenant (something coming from the provider, not the tenant name)

func RankDRF

func RankDRF(t *model.HostTemplate) float32

RankDRF computes the Dominant Resource Fairness Rank of an host template

func Register

func Register(name string, client api.ClientAPI)

Register a ClientAPI referenced by the provider name. Ex: "ovh", &ovh.Client{} 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

func Tenants

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

Tenants returns all known tenants

Types

type ByRankDRF

type ByRankDRF []model.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 HostAccess

type HostAccess struct {
	Host    *model.Host
	Key     *model.KeyPair
	User    string
	Gateway *HostAccess
}

HostAccess an host and the SSH Key Pair

func (*HostAccess) GetAccessIP

func (access *HostAccess) GetAccessIP() string

GetAccessIP returns the access IP

type Service

type Service struct {
	api.ClientAPI
	ObjectStorage  objectstorage.Location
	MetadataBucket objectstorage.Bucket
}

Service Client High level service

func GetService

func GetService(tenantName string) (*Service, error)

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

func (*Service) CopyObject

func (svc *Service) CopyObject(bucketNameSrc, objectSrc, objectDst string) error

CopyObject copies an object

func (*Service) CreateBucket

func (svc *Service) CreateBucket(bucketName string) error

CreateBucket creates an object container

func (*Service) CreateHostWithKeyPair

func (svc *Service) CreateHostWithKeyPair(request model.HostRequest) (*model.Host, *model.KeyPair, error)

CreateHostWithKeyPair creates an host

func (*Service) DeleteBucket

func (svc *Service) DeleteBucket(bucketName string) error

DeleteBucket deletes an object container

func (*Service) DeleteObject

func (svc *Service) DeleteObject(bucketName, objectName string) error

DeleteObject delete an object from a container

func (*Service) FilterImages

func (svc *Service) FilterImages(filter string) ([]model.Image, error)

FilterImages search an images corresponding to OS Name

func (*Service) GetBucket

func (svc *Service) GetBucket(bucketName string) (objectstorage.Bucket, error)

GetBucket returns info about the Bucket

func (*Service) GetObject

func (svc *Service) GetObject(bucketName string, objectName string, ranges []model.Range) (*model.Object, error)

GetObject get object content from a Bucket

func (*Service) GetObjectMetadata

func (svc *Service) GetObjectMetadata(bucketName string, objectName string) (*model.Object, error)

GetObjectMetadata get object metadata from a Bucket

func (*Service) ListBuckets

func (svc *Service) ListBuckets() ([]string, error)

ListBuckets list object containers

func (*Service) ListHostsByName

func (svc *Service) ListHostsByName() (map[string]*model.Host, error)

ListHostsByName list hosts by name

func (*Service) ListObjects

func (svc *Service) ListObjects(bucketName string, filter model.ObjectFilter) ([]string, error)

ListObjects list objects of a container

func (*Service) PutObject

func (svc *Service) PutObject(bucketName string, obj model.Object) error

PutObject put an object into a Bucket

func (*Service) SearchImage

func (svc *Service) SearchImage(osname string) (*model.Image, error)

SearchImage search an image corresponding to OS Name

func (*Service) SelectTemplatesBySize

func (svc *Service) SelectTemplatesBySize(sizing model.SizingRequirements, force bool) ([]model.HostTemplate, error)

SelectTemplatesBySize select templates satisfying sizing requirements returned list is ordered by size fitting

func (*Service) UpdateObjectMetadata

func (svc *Service) UpdateObjectMetadata(bucketName string, obj model.Object) error

UpdateObjectMetadata update an object into object container

func (*Service) WaitHostState

func (svc *Service) WaitHostState(hostID string, state HostState.Enum, timeout time.Duration) error

WaitHostState waits an host achieve state

func (*Service) WaitVolumeState

func (svc *Service) WaitVolumeState(volumeID string, state VolumeState.Enum, timeout time.Duration) (*model.Volume, error)

WaitVolumeState waits an host achieve state

Directories

Path Synopsis
filters
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

Jump to

Keyboard shortcuts

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