Documentation
¶
Index ¶
- type BucketAPI
- type BucketService
- func (svc *BucketService) Create(name string) error
- func (svc *BucketService) Delete(name string) error
- func (svc *BucketService) Inspect(name string) (*model.Bucket, error)
- func (svc *BucketService) List() ([]string, error)
- func (svc *BucketService) Mount(bucketName, hostName, path string) error
- func (svc *BucketService) Unmount(bucketName, hostName string) error
- type HostAPI
- type HostService
- func (svc *HostService) Create(name string, net string, cpu int, ram float32, disk int, los string, ...) (*model.Host, error)
- func (svc *HostService) Delete(ref string) error
- func (svc *HostService) Get(ref string) (*model.Host, error)
- func (svc *HostService) List(all bool) ([]*model.Host, error)
- func (svc *HostService) Reboot(ref string) error
- func (svc *HostService) SSH(ref string) (*system.SSHConfig, error)
- func (svc *HostService) Start(ref string) error
- func (svc *HostService) Stop(ref string) error
- type ImageAPI
- type ImageService
- type NetworkAPI
- type NetworkService
- func (svc *NetworkService) Create(name string, cidr string, ipVersion IPVersion.Enum, cpu int, ram float32, ...) (*model.Network, error)
- func (svc *NetworkService) Delete(ref string) error
- func (svc *NetworkService) Get(ref string) (*model.Network, error)
- func (svc *NetworkService) List(all bool) ([]*model.Network, error)
- type SSHAPI
- type SSHService
- func (svc *SSHService) Copy(from, to string) (int, string, string, error)
- func (svc *SSHService) GetConfig(hostParam interface{}) (*system.SSHConfig, error)
- func (svc *SSHService) Run(hostName, cmd string) (int, string, string, error)
- func (svc *SSHService) WaitServerReady(hostParam interface{}, timeout time.Duration) error
- type ShareAPI
- type ShareService
- func (svc *ShareService) Create(shareName, hostName, path string) (*propsv1.HostShare, error)
- func (svc *ShareService) Delete(name string) error
- func (svc *ShareService) Inspect(shareName string) (*model.Host, *propsv1.HostShare, map[string]*propsv1.HostRemoteMount, error)
- func (svc *ShareService) List() (map[string]map[string]*propsv1.HostShare, error)
- func (svc *ShareService) Mount(shareName, hostName, path string) (*propsv1.HostRemoteMount, error)
- func (svc *ShareService) Unmount(shareName, hostName string) error
- type TemplateAPI
- type TemplateService
- type VolumeAPI
- type VolumeService
- func (svc *VolumeService) Attach(volumeName, hostName, path, format string) error
- func (svc *VolumeService) Create(name string, size int, speed VolumeSpeed.Enum) (*model.Volume, error)
- func (svc *VolumeService) Delete(ref string) error
- func (svc *VolumeService) Detach(volumeName, hostName string) error
- func (svc *VolumeService) Get(ref string) (*model.Volume, error)
- func (svc *VolumeService) Inspect(ref string) (*model.Volume, map[string]*propsv1.HostLocalMount, error)
- func (svc *VolumeService) List(all bool) ([]model.Volume, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketAPI ¶
type BucketAPI interface {
List() ([]string, error)
Create(string) error
Delete(string) error
Inspect(string) (*model.Bucket, error)
Mount(string, string, string) error
Unmount(string, string) error
}
BucketAPI defines API to manipulate buckets
func NewBucketService ¶
NewBucketService creates a Bucket service
type BucketService ¶
type BucketService struct {
// contains filtered or unexported fields
}
BucketService bucket service
func (*BucketService) Inspect ¶
func (svc *BucketService) Inspect(name string) (*model.Bucket, error)
Inspect a bucket
func (*BucketService) List ¶
func (svc *BucketService) List() ([]string, error)
List retrieves all available buckets
func (*BucketService) Mount ¶
func (svc *BucketService) Mount(bucketName, hostName, path string) error
Mount a bucket on an host on the given mount point
func (*BucketService) Unmount ¶
func (svc *BucketService) Unmount(bucketName, hostName string) error
Unmount a bucket
type HostAPI ¶
type HostAPI interface {
Create(name string, net string, cpu int, ram float32, disk int, os string, public bool, gpuNumber int, freq float32, force bool) (*model.Host, error)
List(all bool) ([]*model.Host, error)
Get(ref string) (*model.Host, error)
Delete(ref string) error
SSH(ref string) (*system.SSHConfig, error)
Reboot(ref string) error
Start(ref string) error
Stop(ref string) error
}
HostAPI defines API to manipulate hosts
type HostService ¶
type HostService struct {
// contains filtered or unexported fields
}
HostService host service
func (*HostService) Create ¶
func (svc *HostService) Create( name string, net string, cpu int, ram float32, disk int, los string, public bool, gpuNumber int, freq float32, force bool, ) (*model.Host, error)
Create creates a host
func (*HostService) Delete ¶
func (svc *HostService) Delete(ref string) error
Delete deletes host referenced by ref
func (*HostService) Get ¶
func (svc *HostService) Get(ref string) (*model.Host, error)
Get returns the host identified by ref, ref can be the name or the id
func (*HostService) List ¶
func (svc *HostService) List(all bool) ([]*model.Host, error)
List returns the host list
type ImageAPI ¶
type ImageAPI interface {
List(all bool) ([]model.Image, error)
Select(osfilter string) (*model.Image, error)
Filter(osfilter string) ([]model.Image, error)
}
ImageAPI defines API to manipulate hosts
func NewImageService ¶
NewImageService creates an host service
type ImageService ¶
type ImageService struct {
// contains filtered or unexported fields
}
ImageService image service
func (*ImageService) Filter ¶
func (srv *ImageService) Filter(osname string) ([]model.Image, error)
Filter filters the images that do not fit osname
type NetworkAPI ¶
type NetworkAPI interface {
Create(net string, cidr string, ipVersion IPVersion.Enum, cpu int, ram float32, disk int, os string, gwname string) (*model.Network, error)
List(all bool) ([]*model.Network, error)
Get(ref string) (*model.Network, error)
Delete(ref string) error
}
NetworkAPI defines API to manage networks
func NewNetworkService ¶
func NewNetworkService(api *providers.Service) NetworkAPI
NewNetworkService Creates new Network service
type NetworkService ¶
type NetworkService struct {
// contains filtered or unexported fields
}
NetworkService an implementation of NetworkAPI
func (*NetworkService) Create ¶
func (svc *NetworkService) Create( name string, cidr string, ipVersion IPVersion.Enum, cpu int, ram float32, disk int, os string, gwname string, ) (*model.Network, error)
Create creates a network
func (*NetworkService) Delete ¶
func (svc *NetworkService) Delete(ref string) error
Delete deletes network referenced by ref
type SSHAPI ¶
type SSHAPI interface {
// Connect(name string) error
Run(hostname, cmd string) (int, string, string, error)
Copy(from string, to string) (int, string, string, error)
GetConfig(interface{}) (*system.SSHConfig, error)
}
SSHAPI defines ssh management API
type SSHService ¶
type SSHService struct {
// contains filtered or unexported fields
}
SSHService SSH service
func (*SSHService) GetConfig ¶
func (svc *SSHService) GetConfig(hostParam interface{}) (*system.SSHConfig, error)
GetConfig creates SSHConfig to connect to an host
func (*SSHService) WaitServerReady ¶
func (svc *SSHService) WaitServerReady(hostParam interface{}, timeout time.Duration) 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 NewShareService ¶
NewShareService creates a ShareService
type ShareService ¶
type ShareService struct {
// contains filtered or unexported fields
}
ShareService nas service
func (*ShareService) Create ¶
func (svc *ShareService) Create(shareName, hostName, path string) (*propsv1.HostShare, error)
Create a share on host
func (*ShareService) Delete ¶
func (svc *ShareService) Delete(name string) error
Delete a share from host
func (*ShareService) Inspect ¶
func (svc *ShareService) Inspect(shareName string) (*model.Host, *propsv1.HostShare, map[string]*propsv1.HostRemoteMount, error)
Inspect returns the host and share corresponding to 'shareName'
func (*ShareService) Mount ¶
func (svc *ShareService) Mount(shareName, hostName, path string) (*propsv1.HostRemoteMount, error)
Mount a share on a local directory of an host
func (*ShareService) Unmount ¶
func (svc *ShareService) Unmount(shareName, hostName string) error
Unmount a share from local directory of an host
type TemplateAPI ¶
type TemplateAPI interface {
List(all bool) ([]model.HostTemplate, error)
}
TemplateAPI defines API to manipulate hosts
func NewTemplateService ¶
func NewTemplateService(api *providers.Service) TemplateAPI
NewTemplateService creates a template service
type TemplateService ¶
type TemplateService struct {
// contains filtered or unexported fields
}
TemplateService template service
func (*TemplateService) List ¶
func (srv *TemplateService) List(all bool) ([]model.HostTemplate, error)
List returns the template list
type VolumeAPI ¶
type VolumeAPI interface {
Delete(ref string) error
Get(ref string) (*model.Volume, error)
Inspect(ref string) (*model.Volume, map[string]*propsv1.HostLocalMount, error)
List(all bool) ([]model.Volume, error)
Create(name string, size int, speed VolumeSpeed.Enum) (*model.Volume, error)
Attach(volume string, host string, path string, format string) error
Detach(volume string, host string) error
}
VolumeAPI defines API to manipulate hosts
func NewVolumeService ¶
NewVolumeService creates a Volume service
type VolumeService ¶
type VolumeService struct {
// contains filtered or unexported fields
}
VolumeService volume service
func (*VolumeService) Attach ¶
func (svc *VolumeService) Attach(volumeName, hostName, path, format string) error
Attach a volume to an host
func (*VolumeService) Create ¶
func (svc *VolumeService) Create(name string, size int, speed VolumeSpeed.Enum) (*model.Volume, error)
Create a volume
func (*VolumeService) Delete ¶
func (svc *VolumeService) Delete(ref string) error
Delete deletes volume referenced by ref
func (*VolumeService) Detach ¶
func (svc *VolumeService) Detach(volumeName, hostName string) error
Detach detach the volume identified by ref, ref can be the name or the id
func (*VolumeService) Get ¶
func (svc *VolumeService) Get(ref string) (*model.Volume, error)
Get returns the volume identified by ref, ref can be the name or the id
func (*VolumeService) Inspect ¶
func (svc *VolumeService) Inspect(ref string) (*model.Volume, map[string]*propsv1.HostLocalMount, error)
Inspect returns the volume identified by ref and its attachment (if any)