Documentation
¶
Index ¶
- Constants
- func DeserializeFromJSON(buf []byte, data interface{}) error
- func SerializeToJSON(data interface{}) ([]byte, error)
- 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 ErrResource
- type ErrResourceAlreadyExists
- type ErrResourceInvalidRequest
- type ErrResourceNotAvailable
- type ErrResourceNotFound
- type ErrTimeout
- type Extensions
- type GatewayRequest
- type Host
- type HostRequest
- type HostSize
- type HostTemplate
- type Image
- type KeyPair
- type Network
- type NetworkRequest
- type Object
- type ObjectFilter
- type Range
- type Serializable
- type SizingRequirements
- type StoredCPUInfo
- type Volume
- type VolumeAttachment
- type VolumeAttachmentRequest
- type VolumeRequest
Constants ¶
const ( // DefaultUser Default Host user DefaultUser = "gpac" // 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 DeserializeFromJSON ¶
DeserializeFromJSON reads json code and reinstanciates an Host
func SerializeToJSON ¶
SerializeToJSON serializes Host instance into json.Marshal output
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 ErrResource ¶
ErrResource resource error
type ErrResourceAlreadyExists ¶
type ErrResourceAlreadyExists struct {
ErrResource
}
ErrResourceAlreadyExists resource already exists error
func ResourceAlreadyExistsError ¶
func ResourceAlreadyExistsError(resource string, name string) ErrResourceAlreadyExists
ResourceAlreadyExistsError creates a ResourceAlreadyExists error
func (ErrResourceAlreadyExists) Error ¶
func (e ErrResourceAlreadyExists) Error() string
type ErrResourceInvalidRequest ¶
type ErrResourceInvalidRequest struct {
ErrResource
}
ErrResourceInvalidRequest resource requested with invalid parameters
func ResourceInvalidRequestError ¶
func ResourceInvalidRequestError(resource string, reason string) ErrResourceInvalidRequest
ResourceInvalidRequestError creates a ErrResourceInvalidRequest error
func (ErrResourceInvalidRequest) Error ¶
func (e ErrResourceInvalidRequest) Error() string
type ErrResourceNotAvailable ¶
type ErrResourceNotAvailable struct {
ErrResource
}
ErrResourceNotAvailable resource not available error
func ResourceNotAvailableError ¶
func ResourceNotAvailableError(resource, name string) ErrResourceNotAvailable
ResourceNotAvailableError creates a ResourceNotAvailable error
func (ErrResourceNotAvailable) Error ¶
func (e ErrResourceNotAvailable) Error() string
type ErrResourceNotFound ¶
type ErrResourceNotFound struct {
ErrResource
}
ErrResourceNotFound resource not found error
func ResourceNotFoundError ¶
func ResourceNotFoundError(resource string, name string) ErrResourceNotFound
ResourceNotFoundError creates a ResourceNotFound error
func (ErrResourceNotFound) Error ¶
func (e ErrResourceNotFound) Error() string
type ErrTimeout ¶
type ErrTimeout struct {
Message string
}
ErrTimeout defines a Timeout error
func (*ErrTimeout) Error ¶
func (e *ErrTimeout) Error() string
type Extensions ¶
type Extensions struct {
// contains filtered or unexported fields
}
Extensions ...
func NewExtensions ¶
func NewExtensions() *Extensions
NewExtensions creates a new Extensions instance
func (*Extensions) Get ¶
func (x *Extensions) Get(key string, value interface{}) error
Get returns the value of extension identified by key if returns (nil, nil), key not found
func (*Extensions) Lookup ¶
func (x *Extensions) Lookup(key string) bool
Lookup tells if a key is present in Extensions
func (*Extensions) MarshalJSON ¶
func (x *Extensions) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaller
func (*Extensions) Set ¶
func (x *Extensions) Set(key string, value interface{}) error
Set adds/replaces the content of key 'key' with 'value'
func (*Extensions) UnmarshalJSON ¶
func (x *Extensions) UnmarshalJSON(b []byte) error
UnmarshalJSON implement json.Unmarshaller
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"`
Properties *Extensions `json:"properties,omitempty"`
}
Host contains the information about a host
func (*Host) Deserialize ¶
Deserialize reads json code and reinstanciates an Host
func (*Host) GetAccessIP ¶
GetAccessIP returns the IP to reach the host
func (*Host) GetPublicIP ¶
GetPublicIP computes public IP of the host
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
// 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
}
HostRequest represents requirements to create host
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 gateway for the network
IPVersion IPVersion.Enum `json:"ip_version,omitempty"` // IPVersion is IPv4 or IPv6 (see IPVersion)
Properties *Extensions `json:"properties,omitempty"` // contains optional supplemental information
}
Network representes a virtual network
func (*Network) Deserialize ¶
Deserialize reads json code and reinstanciates 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
}
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 Serializable ¶
Serializable is the interface allowing the conversion of satisfying struct to []byte (Serialize()) and reverse operation (Unserialize())
type SizingRequirements ¶
type SizingRequirements struct {
MinCores int `json:"min_cores,omitempty"`
MinRAMSize float32 `json:"min_ram_size,omitempty"`
MinDiskSize int `json:"min_disk_size,omitempty"`
MinGPU int `json:"min_gpu,omitempty"`
MinFreq float32 `json:"min_freq,omitempty"`
}
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"`
}
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 contains optional supplemental information
Properties *Extensions `json:"extensions,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 |
|
properties
|
|