Documentation
¶
Index ¶
- Constants
- func InitializeBucket(svc api.ClientAPI, location objectstorage.Location) error
- func RankDRF(t *model.HostTemplate) float32
- func Register(name string, client api.ClientAPI)
- func SimilarityScore(ref string, s string) float64
- func Tenants() (map[string]string, error)
- type ByRankDRF
- type HostAccess
- type Service
- func (svc *Service) CopyObject(bucketNameSrc, objectSrc, objectDst string) error
- func (svc *Service) CreateBucket(bucketName string) error
- func (svc *Service) CreateHostWithKeyPair(request model.HostRequest) (*model.Host, *model.KeyPair, error)
- func (svc *Service) DeleteBucket(bucketName string) error
- func (svc *Service) DeleteObject(bucketName, objectName string) error
- func (svc *Service) FilterImages(filter string) ([]model.Image, error)
- func (svc *Service) GetBucket(bucketName string) (objectstorage.Bucket, error)
- func (svc *Service) GetObject(bucketName string, objectName string, ranges []model.Range) (*model.Object, error)
- func (svc *Service) GetObjectMetadata(bucketName string, objectName string) (*model.Object, error)
- func (svc *Service) ListBuckets() ([]string, error)
- func (svc *Service) ListHostsByName() (map[string]*model.Host, error)
- func (svc *Service) ListObjects(bucketName string, filter model.ObjectFilter) ([]string, error)
- func (svc *Service) PutObject(bucketName string, obj model.Object) error
- func (svc *Service) SearchImage(osname string) (*model.Image, error)
- func (svc *Service) SelectTemplatesBySize(sizing model.SizingRequirements, force bool) ([]model.HostTemplate, error)
- func (svc *Service) UpdateObjectMetadata(bucketName string, obj model.Object) error
- func (svc *Service) WaitHostState(hostID string, state HostState.Enum, timeout time.Duration) error
- func (svc *Service) WaitVolumeState(volumeID string, state VolumeState.Enum, timeout time.Duration) (*model.Volume, error)
Constants ¶
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 ¶
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 ¶
SimilarityScore computes a similariy score between 2 strings
Types ¶
type ByRankDRF ¶
type ByRankDRF []model.HostTemplate
ByRankDRF implements sort.Interface for []HostTemplate based on the Dominant Resource Fairness
type 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 ¶
GetService return the service referenced by the given name. If necessary, this function try to load service from configuration file
func (*Service) CopyObject ¶
CopyObject copies an object
func (*Service) CreateBucket ¶
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 ¶
DeleteBucket deletes an object container
func (*Service) DeleteObject ¶
DeleteObject delete an object from a container
func (*Service) FilterImages ¶
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 ¶
GetObjectMetadata get object metadata from a Bucket
func (*Service) ListBuckets ¶
ListBuckets list object containers
func (*Service) ListHostsByName ¶
ListHostsByName list hosts by name
func (*Service) ListObjects ¶
ListObjects list objects of a container
func (*Service) SearchImage ¶
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 ¶
UpdateObjectMetadata update an object into object container
func (*Service) WaitHostState ¶
WaitHostState 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 |