Documentation
¶
Index ¶
- Constants
- func ResourceDuplicateError(resource, name string) scerr.ErrDuplicate
- func ResourceForbiddenError(resource, name string) scerr.ErrForbidden
- func ResourceInvalidRequestError(resource, reason string) scerr.ErrInvalidRequest
- func ResourceNotAvailableError(resource, name string) scerr.ErrNotAvailable
- func ResourceNotFoundError(resource, name string) scerr.ErrNotFound
- func ResourceTimeoutError(resource, name string, dur time.Duration) scerr.ErrTimeout
- func TimeoutError(message string, dur time.Duration) scerr.ErrTimeout
- type Bucket
- type Config
- type ConfigMap
- func (c ConfigMap) Config(name string) (interface{}, bool)
- func (c ConfigMap) Get(name string) (interface{}, bool)
- func (c ConfigMap) GetInteger(name string) int
- func (c ConfigMap) GetMapOfStrings(name string) map[string]string
- func (c ConfigMap) GetSliceOfStrings(name string) []string
- func (c ConfigMap) GetString(name string) string
- func (c ConfigMap) Set(name string, value interface{})
- type GatewayRequest
- type Host
- type HostDefinition
- type HostRequest
- type HostTemplate
- type Image
- type KeyPair
- type Network
- type NetworkRequest
- type Object
- type ObjectFilter
- type Range
- type SizingRequirements
- type StoredCPUInfo
- type VIP
- type Volume
- type VolumeAttachment
- type VolumeAttachmentRequest
- type VolumeRequest
Constants ¶
const ( // DefaultUser Default Host user DefaultUser = "safescale" // DefaultVolumeMountPoint Default mount point for volumes DefaultVolumeMountPoint = "/data/" // DefaultBucketMountPoint Default mount point for containers DefaultBucketMountPoint = "/buckets/" DefaultShareExportedPath = "/shared/data" DefaultShareMountPath = "/shared" // SingleHostNetworkName is the name to use to create the network owning single hosts (not attached to a named network) SingleHostNetworkName = "net-safescale" )
Variables ¶
This section is empty.
Functions ¶
func ResourceDuplicateError ¶
func ResourceDuplicateError(resource, name string) scerr.ErrDuplicate
ResourceDuplicateError creates a ResourceAlreadyExists error
func ResourceForbiddenError ¶
func ResourceForbiddenError(resource, name string) scerr.ErrForbidden
ResourceForbiddenError creates a ErrResourceForbidden error
func ResourceInvalidRequestError ¶
func ResourceInvalidRequestError(resource, reason string) scerr.ErrInvalidRequest
ResourceInvalidRequestError creates a ErrResourceInvalidRequest error
func ResourceNotAvailableError ¶
func ResourceNotAvailableError(resource, name string) scerr.ErrNotAvailable
ResourceNotAvailableError creates a ResourceNotAvailable error
func ResourceNotFoundError ¶
func ResourceNotFoundError(resource, name string) scerr.ErrNotFound
ResourceNotFoundError creates a ErrNotFound error
func ResourceTimeoutError ¶
func ResourceTimeoutError(resource, name string, dur time.Duration) scerr.ErrTimeout
ResourceTimeoutError creates a ErrTimeout error
func TimeoutError ¶
func TimeoutError(message string, dur time.Duration) scerr.ErrTimeout
TimeoutError creates a ErrTimeout error
Types ¶
type Bucket ¶
type Bucket struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Host string `json:"host,omitempty"`
MountPoint string `json:"mountPoint,omitempty"`
}
Bucket describes a Bucket
type Config ¶
type Config interface {
// Config gets a string configuration value and a
// bool indicating whether the value was present or not.
Config(name string) (interface{}, bool)
//Get is an alias to Config()
Get(name string) (interface{}, bool)
//Set sets the configuration name to specified value
Set(name string, value interface{})
//GetString returns a string corresponding to the key, empty string if it doesn't exist
GetString(name string) string
//GetSliceOfStrings returns a slice of strings corresponding to the key, empty string slice if it doesn't exist
GetSliceOfStrings(name string) []string
//GetMapOfStrings returns a string map of strings correspondong to the key, empty map if it doesn't exist
GetMapOfStrings(name string) map[string]string
//GetInteger returns an integer corresponding to the key, 0 if it doesn't exist
GetInteger(name string) int
}
Config represents key/value configuration.
type ConfigMap ¶
type ConfigMap map[string]interface{}
ConfigMap is a map[string]string that implements the Config method.
func (ConfigMap) Config ¶
Config gets a string configuration value and a bool indicating whether the value was present or not.
func (ConfigMap) GetInteger ¶
GetInteger returns an integer corresponding to the key, 0 if it doesn't exist
func (ConfigMap) GetMapOfStrings ¶
GetMapOfStrings returns a string map of strings correspondong to the key, empty map if it doesn't exist
func (ConfigMap) GetSliceOfStrings ¶
GetSliceOfStrings returns a string slice corresponding to the key, empty string slice if it doesn't exist
type GatewayRequest ¶
type GatewayRequest struct {
Network *Network
CIDR string
// TemplateID the UUID of the template used to size the host (see SelectTemplates)
TemplateID string
// ImageID is the UUID of the image that contains the server's OS and initial state.
ImageID string
KeyPair *KeyPair
// Name is the name to give to the gateway
Name string
}
GatewayRequest to create a Gateway into a network
type Host ¶
type Host struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
LastState HostState.Enum `json:"state,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
Password string `json:"password,omitempty"`
Properties *serialize.JSONProperties `json:"properties,omitempty"`
}
Host contains the information about a host
func (*Host) Deserialize ¶
Deserialize reads json code and reinstantiates an Host
func (*Host) GetAccessIP ¶
GetAccessIP returns the IP to reach the host
func (*Host) GetPublicIP ¶
GetPublicIP computes public IP of the host
func (*Host) IsConsistent ¶
IsConsistent tells if host struct is consistent
type HostDefinition ¶
type HostDefinition struct {
Cores int `json:"cores,omitempty"`
RAMSize float32 `json:"ram_size,omitempty"`
DiskSize int `json:"disk_size,omitempty"`
GPUNumber int `json:"gpu_number,omitempty"`
GPUType string `json:"gpu_type,omitempty"`
CPUFreq float32 `json:"cpu_freq,omitempty"`
ImageID string `json:"image_id,omitempty"`
//TODO: implement the handling of this field (will need to introduce provider capabilities to know if a specific provider allows this kind of host)
Replaceable bool `json:"replaceable,omitempty"` // Tells if we accept server that could be removed without notice (AWS proposes such kind of server with SPOT
}
HostDefinition ...
type HostRequest ¶
type HostRequest struct {
// ResourceName contains the name of the compute resource
ResourceName string
// HostName contains the hostname on the system (if empty, will use ResourceName)
HostName string
// Networks lists the networks the host must be connected to
Networks []*Network
// DefaultRouteIP is the IP used as default route
DefaultRouteIP string
// DefaultGateway is the host used as default gateway
DefaultGateway *Host
// PublicIP a flag telling if the host must have a public IP
PublicIP bool
// TemplateID is the UUID of the template used to size the host (see SelectTemplates)
TemplateID string
// ImageID is the UUID of the image that contains the server's OS and initial state.
ImageID string
// KeyPair is the (optional) specific KeyPair to use (if not provided, a new KeyPair will be generated)
KeyPair *KeyPair
// Password contains the safescale password usable on host console only
Password string
// DiskSize allows to ask for a specific size for system disk (in GB)
DiskSize int
}
HostRequest represents requirements to create host
type HostTemplate ¶
type HostTemplate struct {
Cores int `json:"cores,omitempty"`
RAMSize float32 `json:"ram_size,omitempty"`
DiskSize int `json:"disk_size,omitempty"`
GPUNumber int `json:"gpu_number,omitempty"`
GPUType string `json:"gpu_type,omitempty"`
CPUFreq float32 `json:"cpu_freq,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
HostTemplate ...
type Image ¶
type Image struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
URL string
}
Image represents an OS image
type KeyPair ¶
type KeyPair struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
PublicKey string `json:"public_key,omitempty"`
}
KeyPair represents a SSH key pair
type Network ¶
type Network struct {
ID string `json:"id,omitempty"` // ID for the network (from provider)
Name string `json:"name,omitempty"` // Name of the network
CIDR string `json:"mask,omitempty"` // network in CIDR notation
GatewayID string `json:"gateway_id,omitempty"` // contains the id of the host acting as primary gateway for the network
SecondaryGatewayID string `json:"secondary_gateway_id,omitempty"` // contains the id of the host acting as secondary gateway for the network
VIP *VIP `json:"vip,omitempty"` // contains the VIP of the network if created with HA
IPVersion IPVersion.Enum `json:"ip_version,omitempty"` // IPVersion is IPv4 or IPv6 (see IPVersion)
Properties *serialize.JSONProperties `json:"properties,omitempty"` // contains optional supplemental information
}
Network representes a virtual network
func (*Network) Deserialize ¶
Deserialize reads json code and reinstantiates an Host
type NetworkRequest ¶
type NetworkRequest struct {
Name string
// IPVersion must be IPv4 or IPv6 (see IPVersion)
IPVersion IPVersion.Enum
// CIDR mask
CIDR string
// DNSServers
DNSServers []string
// HA tells if 2 gateways and a VIP needs to be created; the VIP IP address will be used as gateway
HA bool
}
NetworkRequest represents network requirements to create a subnet where Mask is defined in CIDR notation like "192.0.2.0/24" or "2001:db8::/32", as defined in RFC 4632 and RFC 4291.
type Object ¶
type Object struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
DeleteAt time.Time `json:"delete_at,omitempty"`
Date time.Time `json:"date,omitempty"`
ContentType string `json:"content_type,omitempty"`
ContentLength int64 `json:"content_length,omitempty"`
Content io.ReadSeeker `json:"content,omitempty"`
Size int64 `json:"size,omitempty"`
Metadata objectstorage.ObjectMetadata `json:"metadata,omitempty"`
LastModified time.Time `json:"last_modified,omitempty"`
ETag string `json:"etag,omitempty"`
}
Object object to put in a container
type ObjectFilter ¶
type ObjectFilter struct {
Path string `json:"path,omitempty"`
Prefix string `json:"prefix,omitempty"`
}
ObjectFilter filter object
type SizingRequirements ¶
type SizingRequirements struct {
MinCores int `json:"min_cores,omitempty"`
MaxCores int `json:"max_cores,omitempty"`
MinRAMSize float32 `json:"min_ram_size,omitempty"`
MaxRAMSize float32 `json:"max_ram_size,omitempty"`
MinDiskSize int `json:"min_disk_size,omitempty"`
MinGPU int `json:"min_gpu,omitempty"`
MinFreq float32 `json:"min_freq,omitempty"`
Replaceable bool `json:"replaceable,omitempty"` // Tells if we accept server that could be removed without notice (AWS proposes such kind of server with SPOT
}
SizingRequirements represents host sizing requirements to fulfil
type StoredCPUInfo ¶
type StoredCPUInfo struct {
ID string `bow:"key"`
TenantName string `json:"tenant_name,omitempty"`
TemplateID string `json:"template_id,omitempty"`
TemplateName string `json:"template_name,omitempty"`
ImageID string `json:"image_id,omitempty"`
ImageName string `json:"image_name,omitempty"`
LastUpdated string `json:"last_updated,omitempty"`
NumberOfCPU int `json:"number_of_cpu,omitempty"`
NumberOfCore int `json:"number_of_core,omitempty"`
NumberOfSocket int `json:"number_of_socket,omitempty"`
CPUFrequency float64 `json:"cpu_frequency_Ghz,omitempty"`
CPUArch string `json:"cpu_arch,omitempty"`
Hypervisor string `json:"hypervisor,omitempty"`
CPUModel string `json:"cpu_model,omitempty"`
RAMSize float64 `json:"ram_size_Gb,omitempty"`
RAMFreq float64 `json:"ram_freq,omitempty"`
GPU int `json:"gpu,omitempty"`
GPUModel string `json:"gpu_model,omitempty"`
DiskSize int64 `json:"disk_size_Gb,omitempty"`
MainDiskType string `json:"main_disk_type"`
MainDiskSpeed float64 `json:"main_disk_speed_MBps"`
SampleNetSpeed float64 `json:"sample_net_speed_KBps"`
EphDiskSize int64 `json:"eph_disk_size_Gb"`
PricePerHour float64 `json:"price_in_dollars_hour"`
}
StoredCPUInfo ...
type VIP ¶
type VIP struct {
ID string
Name string
NetworkID string
PrivateIP string
PublicIP string
Hosts []*Host
}
VIP is a structure containing information needed to manage VIP (virtual IP)
type Volume ¶
type Volume struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Size int `json:"size,omitempty"`
Speed VolumeSpeed.Enum `json:"speed,omitempty"`
State VolumeState.Enum `json:"state,omitempty"`
Properties *serialize.JSONProperties `json:"properties,omitempty"`
}
Volume represents a block volume
func (*Volume) Deserialize ¶
Deserialize reads json code and restores an Host
type VolumeAttachment ¶
type VolumeAttachment struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
VolumeID string `json:"volume,omitempty"`
ServerID string `json:"host,omitempty"`
Device string `json:"device,omitempty"`
MountPoint string `json:"mountpoint,omitempty"`
Format string `json:"format,omitempty"`
}
VolumeAttachment represents a volume attachment
type VolumeAttachmentRequest ¶
type VolumeAttachmentRequest struct {
Name string `json:"name,omitempty"`
VolumeID string `json:"volume_id,omitempty"`
HostID string `json:"host_id,omitempty"`
}
VolumeAttachmentRequest represents a volume attachment request
type VolumeRequest ¶
type VolumeRequest struct {
Name string `json:"name,omitempty"`
Size int `json:"size,omitempty"`
Speed VolumeSpeed.Enum `json:"speed,omitempty"`
}
VolumeRequest represents a volume request
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
enums
|
|
|
VolumeSpeed
Package VolumeSpeed defines an enum to represents Volume type
|
Package VolumeSpeed defines an enum to represents Volume type |
|
VolumeState
Package VolumeState defines an enum to represents Volume states life cycle
|
Package VolumeState defines an enum to represents Volume states life cycle |
|
filters
|
|