Documentation ¶
Index ¶
- type BucketAPI
- type BucketHandler
- func (handler *BucketHandler) Create(ctx context.Context, name string) (err error)
- func (handler *BucketHandler) Delete(ctx context.Context, name string) (err error)
- func (handler *BucketHandler) Inspect(ctx context.Context, name string) (mb *resources.Bucket, err error)
- func (handler *BucketHandler) List(ctx context.Context) (rv []string, err error)
- func (handler *BucketHandler) Mount(ctx context.Context, bucketName, hostName, path string) (err error)
- func (handler *BucketHandler) Unmount(ctx context.Context, bucketName, hostName string) (err error)
- type DataAPI
- type DataHandler
- func (handler *DataHandler) Delete(ctx context.Context, fileName string) (err error)
- func (handler *DataHandler) Get(ctx context.Context, fileLocalPath string, fileName string) (err error)
- func (handler *DataHandler) List(ctx context.Context) (fileNames []string, uploadDates []string, fileSizes []int64, ...)
- func (handler *DataHandler) Push(ctx context.Context, fileLocalPath string, fileName string) (err error)
- type HostAPI
- type HostHandler
- func (handler *HostHandler) Create(ctx context.Context, name string, net string, los string, public bool, ...) (newHost *resources.Host, err error)
- func (handler *HostHandler) Delete(ctx context.Context, ref string) (err error)
- func (handler *HostHandler) ForceInspect(ctx context.Context, ref string) (host *resources.Host, err error)
- func (handler *HostHandler) Inspect(ctx context.Context, ref string) (host *resources.Host, err error)
- func (handler *HostHandler) List(ctx context.Context, all bool) (hosts []*resources.Host, err error)
- func (handler *HostHandler) Reboot(ctx context.Context, ref string) (err error)
- func (handler *HostHandler) Resize(ctx context.Context, ref string, cpu int, ram float32, disk int, gpuNumber int, ...) (newHost *resources.Host, err error)
- func (handler *HostHandler) SSH(ctx context.Context, ref string) (sshConfig *system.SSHConfig, err error)
- func (handler *HostHandler) Start(ctx context.Context, ref string) (err error)
- func (handler *HostHandler) Stop(ctx context.Context, ref string) (err error)
- type ImageAPI
- type ImageHandler
- func (handler *ImageHandler) Filter(ctx context.Context, osname string) (image []resources.Image, err error)
- func (handler *ImageHandler) List(ctx context.Context, all bool) (images []resources.Image, err error)
- func (handler *ImageHandler) Select(ctx context.Context, osname string) (image *resources.Image, err error)
- type JobManagerAPI
- type JobManagerHandler
- type NetworkAPI
- type NetworkHandler
- func (handler *NetworkHandler) Create(ctx context.Context, name string, cidr string, ipVersion IPVersion.Enum, ...) (network *resources.Network, err error)
- func (handler *NetworkHandler) Delete(ctx context.Context, ref string) (err error)
- func (handler *NetworkHandler) Inspect(ctx context.Context, ref string) (network *resources.Network, err error)
- func (handler *NetworkHandler) List(ctx context.Context, all bool) (netList []*resources.Network, err error)
- type SSHAPI
- type SSHHandler
- func (handler *SSHHandler) Copy(ctx context.Context, from, to string) (retCode int, stdOut string, stdErr string, err error)
- func (handler *SSHHandler) GetConfig(ctx context.Context, hostParam interface{}) (sshConfig *system.SSHConfig, err error)
- func (handler *SSHHandler) Run(ctx context.Context, hostName, cmd string) (retCode int, stdOut string, stdErr string, err error)
- func (handler *SSHHandler) WaitServerReady(ctx context.Context, hostParam interface{}, timeout time.Duration) (err error)
- type ShareAPI
- type ShareHandler
- func (handler *ShareHandler) Create(ctx context.Context, shareName, hostName, path string, securityModes []string, ...) (share *propsv1.HostShare, err error)
- func (handler *ShareHandler) Delete(ctx context.Context, name string) (err error)
- func (handler *ShareHandler) ForceInspect(ctx context.Context, shareName string) (host *resources.Host, share *propsv1.HostShare, ...)
- func (handler *ShareHandler) Inspect(ctx context.Context, shareName string) (host *resources.Host, share *propsv1.HostShare, ...)
- func (handler *ShareHandler) List(ctx context.Context) (props map[string]map[string]*propsv1.HostShare, err error)
- func (handler *ShareHandler) Mount(ctx context.Context, shareName, hostName, path string, withCache bool) (mount *propsv1.HostRemoteMount, err error)
- func (handler *ShareHandler) Unmount(ctx context.Context, shareName, hostName string) (err error)
- type TemplateAPI
- type TemplateHandler
- type VolumeAPI
- type VolumeHandler
- func (handler *VolumeHandler) Attach(ctx context.Context, volumeName, hostName, path, format string, ...) (err error)
- func (handler *VolumeHandler) Create(ctx context.Context, name string, size int, speed VolumeSpeed.Enum) (volume *resources.Volume, err error)
- func (handler *VolumeHandler) Delete(ctx context.Context, ref string) (err error)
- func (handler *VolumeHandler) Detach(ctx context.Context, volumeName, hostName string) (err error)
- func (handler *VolumeHandler) Inspect(ctx context.Context, ref string) (volume *resources.Volume, mounts map[string]*propsv1.HostLocalMount, err error)
- func (handler *VolumeHandler) List(ctx context.Context, all bool) (volumes []resources.Volume, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketAPI ¶
type BucketAPI interface { List(context.Context) ([]string, error) Create(context.Context, string) error Delete(context.Context, string) error Inspect(context.Context, string) (*resources.Bucket, error) Mount(context.Context, string, string, string) error Unmount(context.Context, string, string) error }
BucketAPI defines API to manipulate buckets
func NewBucketHandler ¶
NewBucketHandler creates a Bucket service
type BucketHandler ¶
type BucketHandler struct {
// contains filtered or unexported fields
}
BucketHandler bucket service
func (*BucketHandler) Create ¶
func (handler *BucketHandler) Create(ctx context.Context, name string) (err error)
Create a bucket
func (*BucketHandler) Delete ¶
func (handler *BucketHandler) Delete(ctx context.Context, name string) (err error)
Delete a bucket
func (*BucketHandler) Inspect ¶
func (handler *BucketHandler) Inspect(ctx context.Context, name string) (mb *resources.Bucket, err error)
Inspect a bucket
func (*BucketHandler) List ¶
func (handler *BucketHandler) List(ctx context.Context) (rv []string, err error)
List retrieves all available buckets
type DataAPI ¶
type DataAPI interface { List(ctx context.Context) ([]string, []string, []int64, [][]string, error) Push(ctx context.Context, fileLocalPath string, fileName string) error Get(ctx context.Context, fileLocalPath string, fileName string) error Delete(ctx context.Context, fileName string) error }
DataAPI defines API to manipulate Data
func NewDataHandler ¶
func NewDataHandler(svc *iaas.StorageServices) DataAPI
NewDataHandler creates a Data service
type DataHandler ¶
type DataHandler struct {
// contains filtered or unexported fields
}
DataHandler bucket service
func (*DataHandler) Delete ¶
func (handler *DataHandler) Delete(ctx context.Context, fileName string) (err error)
Delete ...
func (*DataHandler) Get ¶
func (handler *DataHandler) Get(ctx context.Context, fileLocalPath string, fileName string) (err error)
Get ...
type HostAPI ¶
type HostAPI interface { Create(ctx context.Context, name string, net string, os string, public bool, sizingParam interface{}, force bool) (*resources.Host, error) List(ctx context.Context, all bool) ([]*resources.Host, error) ForceInspect(ctx context.Context, ref string) (*resources.Host, error) Inspect(ctx context.Context, ref string) (*resources.Host, error) Delete(ctx context.Context, ref string) error SSH(ctx context.Context, ref string) (*system.SSHConfig, error) Reboot(ctx context.Context, ref string) error Resize(ctx context.Context, name string, cpu int, ram float32, disk int, gpuNumber int, freq float32) (*resources.Host, error) Start(ctx context.Context, ref string) error Stop(ctx context.Context, ref string) error }
HostAPI defines API to manipulate hosts
type HostHandler ¶
type HostHandler struct {
// contains filtered or unexported fields
}
HostHandler host service
func (*HostHandler) Create ¶
func (handler *HostHandler) Create( ctx context.Context, name string, net string, los string, public bool, sizingParam interface{}, force bool, ) (newHost *resources.Host, err error)
Create creates a host func (handler *HostHandler) Create(
ctx context.Context, name string, net string, cpu int, ram float32, disk int, los string, public bool, gpuNumber int, freq float32, force bool,
func (*HostHandler) Delete ¶
func (handler *HostHandler) Delete(ctx context.Context, ref string) (err error)
Delete deletes host referenced by ref
func (*HostHandler) ForceInspect ¶
func (handler *HostHandler) ForceInspect(ctx context.Context, ref string) (host *resources.Host, err error)
ForceInspect ... If not found, return (nil, err)
func (*HostHandler) Inspect ¶
func (handler *HostHandler) Inspect(ctx context.Context, ref string) (host *resources.Host, err error)
Inspect returns the host identified by ref, ref can be the name or the id If not found, returns (nil, nil)
func (*HostHandler) List ¶
func (handler *HostHandler) List(ctx context.Context, all bool) (hosts []*resources.Host, err error)
List returns the host list
func (*HostHandler) Reboot ¶
func (handler *HostHandler) Reboot(ctx context.Context, ref string) (err error)
Reboot reboots a host
func (*HostHandler) Resize ¶
func (handler *HostHandler) Resize(ctx context.Context, ref string, cpu int, ram float32, disk int, gpuNumber int, freq float32) (newHost *resources.Host, err error)
Resize ...
func (*HostHandler) SSH ¶
func (handler *HostHandler) SSH(ctx context.Context, ref string) (sshConfig *system.SSHConfig, err error)
SSH returns ssh parameters to access the host referenced by ref
type ImageAPI ¶
type ImageAPI interface { List(ctx context.Context, all bool) ([]resources.Image, error) Select(ctx context.Context, osfilter string) (*resources.Image, error) Filter(ctx context.Context, osfilter string) ([]resources.Image, error) }
ImageAPI defines API to manipulate images
func NewImageHandler ¶
NewImageHandler creates an host service
type ImageHandler ¶
type ImageHandler struct {
// contains filtered or unexported fields
}
ImageHandler image service
func (*ImageHandler) Filter ¶
func (handler *ImageHandler) Filter(ctx context.Context, osname string) (image []resources.Image, err error)
Filter filters the images that do not fit osname
type JobManagerAPI ¶
type JobManagerAPI interface { List(ctx context.Context) (map[string]string, error) Stop(ctx context.Context, uuid string) }
JobManagerAPI defines API to manipulate process
func NewJobHandler ¶
func NewJobHandler(svc iaas.Service) JobManagerAPI
NewJobHandler creates a Volume service
type JobManagerHandler ¶
type JobManagerHandler struct {
// contains filtered or unexported fields
}
JobManagerHandler service
type NetworkAPI ¶
type NetworkAPI interface { Create(context.Context, string, string, IPVersion.Enum, resources.SizingRequirements, string, string, bool) (*resources.Network, error) List(context.Context, bool) ([]*resources.Network, error) Inspect(context.Context, string) (*resources.Network, error) Delete(context.Context, string) error }
NetworkAPI defines API to manage networks
func NewNetworkHandler ¶
func NewNetworkHandler(svc iaas.Service) NetworkAPI
NewNetworkHandler Creates new Network service
type NetworkHandler ¶
type NetworkHandler struct {
// contains filtered or unexported fields
}
NetworkHandler an implementation of NetworkAPI
func (*NetworkHandler) Create ¶
func (handler *NetworkHandler) Create( ctx context.Context, name string, cidr string, ipVersion IPVersion.Enum, sizing resources.SizingRequirements, theos string, gwname string, failover bool, ) (network *resources.Network, err error)
Create creates a network
func (*NetworkHandler) Delete ¶
func (handler *NetworkHandler) Delete(ctx context.Context, ref string) (err error)
Delete deletes network referenced by ref
type SSHAPI ¶
type SSHAPI interface { // Connect(name string) error Run(ctx context.Context, hostname, cmd string) (int, string, string, error) Copy(ctx context.Context, from string, to string) (int, string, string, error) GetConfig(context.Context, interface{}) (*system.SSHConfig, error) }
SSHAPI defines ssh management API
type SSHHandler ¶
type SSHHandler struct {
// contains filtered or unexported fields
}
SSHHandler SSH service
func (*SSHHandler) Copy ¶
func (handler *SSHHandler) Copy(ctx context.Context, from, to string) (retCode int, stdOut string, stdErr string, err error)
Copy copy file/directory
func (*SSHHandler) GetConfig ¶
func (handler *SSHHandler) GetConfig(ctx context.Context, hostParam interface{}) (sshConfig *system.SSHConfig, err error)
GetConfig creates SSHConfig to connect to an host
func (*SSHHandler) Run ¶
func (handler *SSHHandler) Run(ctx context.Context, hostName, cmd string) (retCode int, stdOut string, stdErr string, err error)
Run tries to execute command 'cmd' on the host
func (*SSHHandler) WaitServerReady ¶
func (handler *SSHHandler) WaitServerReady(ctx context.Context, hostParam interface{}, timeout time.Duration) (err error)
WaitServerReady waits for remote SSH server to be ready. After timeout, fails
type ShareAPI ¶
type ShareAPI interface {}
ShareAPI defines API to manipulate Shares
func NewShareHandler ¶
NewShareHandler creates a ShareHandler
type ShareHandler ¶
type ShareHandler struct {
// contains filtered or unexported fields
}
ShareHandler nas service
func (*ShareHandler) Create ¶
func (handler *ShareHandler) Create( ctx context.Context, shareName, hostName, path string, securityModes []string, readOnly, rootSquash, secure, async, noHide, crossMount, subtreeCheck bool, ) (share *propsv1.HostShare, err error)
Create a share on host
func (*ShareHandler) Delete ¶
func (handler *ShareHandler) Delete(ctx context.Context, name string) (err error)
Delete a share from host
func (*ShareHandler) ForceInspect ¶
func (handler *ShareHandler) ForceInspect( ctx context.Context, shareName string, ) (host *resources.Host, share *propsv1.HostShare, props map[string]*propsv1.HostRemoteMount, err error)
ForceInspect returns the host and share corresponding to 'shareName'
func (*ShareHandler) Inspect ¶
func (handler *ShareHandler) Inspect( ctx context.Context, shareName string, ) (host *resources.Host, share *propsv1.HostShare, props map[string]*propsv1.HostRemoteMount, err error)
Inspect returns the host and share corresponding to 'shareName' If share isn't found, return (nil, nil, nil, utils.ErrNotFound)
func (*ShareHandler) List ¶
func (handler *ShareHandler) List(ctx context.Context) (props map[string]map[string]*propsv1.HostShare, err error)
List return the list of all shares from all servers
func (*ShareHandler) Mount ¶
func (handler *ShareHandler) Mount( ctx context.Context, shareName, hostName, path string, withCache bool, ) (mount *propsv1.HostRemoteMount, err error)
Mount a share on a local directory of an host
type TemplateAPI ¶
type TemplateAPI interface {
List(ctx context.Context, all bool) ([]resources.HostTemplate, error)
}
TemplateAPI defines API to manipulate hosts
func NewTemplateHandler ¶
func NewTemplateHandler(svc iaas.Service) TemplateAPI
NewTemplateHandler creates a template service
type TemplateHandler ¶
type TemplateHandler struct {
// contains filtered or unexported fields
}
TemplateHandler template service
func (*TemplateHandler) List ¶
func (handler *TemplateHandler) List(ctx context.Context, all bool) (tlist []resources.HostTemplate, err error)
List returns the template list
type VolumeAPI ¶
type VolumeAPI interface { Delete(ctx context.Context, ref string) error List(ctx context.Context, all bool) ([]resources.Volume, error) Inspect(ctx context.Context, ref string) (*resources.Volume, map[string]*propsv1.HostLocalMount, error) Create(ctx context.Context, name string, size int, speed VolumeSpeed.Enum) (*resources.Volume, error) Attach(ctx context.Context, volume string, host string, path string, format string, doNotFormat bool) error Detach(ctx context.Context, volume string, host string) error }
VolumeAPI defines API to manipulate hosts
func NewVolumeHandler ¶
NewVolumeHandler creates a Volume service
type VolumeHandler ¶
type VolumeHandler struct {
// contains filtered or unexported fields
}
VolumeHandler volume service
func (*VolumeHandler) Attach ¶
func (handler *VolumeHandler) Attach(ctx context.Context, volumeName, hostName, path, format string, doNotFormat bool) (err error)
Attach a volume to an host
func (*VolumeHandler) Create ¶
func (handler *VolumeHandler) Create(ctx context.Context, name string, size int, speed VolumeSpeed.Enum) (volume *resources.Volume, err error)
Create a volume
func (*VolumeHandler) Delete ¶
func (handler *VolumeHandler) Delete(ctx context.Context, ref string) (err error)
Delete deletes volume referenced by ref
func (*VolumeHandler) Detach ¶
func (handler *VolumeHandler) Detach(ctx context.Context, volumeName, hostName string) (err error)
Detach detach the volume identified by ref, ref can be the name or the id