parent
9e34b3d3f4
commit
a9e89eb18f
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// import a libvirt xml file
|
// import a libvirt xml file
|
||||||
func AddDomainDroplet(cluster *pb.NewCluster, domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error) {
|
func AddDomainDroplet(cluster *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error) {
|
||||||
var alle []*pb.Event
|
var alle []*pb.Event
|
||||||
if domcfg == nil {
|
if domcfg == nil {
|
||||||
return nil, alle, errors.New("domcfg == nil")
|
return nil, alle, errors.New("domcfg == nil")
|
||||||
|
@ -46,7 +46,7 @@ func AddDomainDroplet(cluster *pb.NewCluster, domcfg *libvirtxml.Domain) (*pb.Dr
|
||||||
return d, alle, nil
|
return d, alle, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func findDomain(c *pb.NewCluster, domcfg *libvirtxml.Domain) (*pb.Droplet, error) {
|
func findDomain(c *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Droplet, error) {
|
||||||
var found *pb.Droplet
|
var found *pb.Droplet
|
||||||
if domcfg == nil {
|
if domcfg == nil {
|
||||||
return nil, errors.New("domcfg == nil")
|
return nil, errors.New("domcfg == nil")
|
||||||
|
|
10
cloud.go
10
cloud.go
|
@ -22,7 +22,7 @@ var myClient cloudAPI
|
||||||
type CloudManager struct {
|
type CloudManager struct {
|
||||||
// client represents a hypothetical API client for interacting with the cloud.
|
// client represents a hypothetical API client for interacting with the cloud.
|
||||||
client cloudAPI
|
client cloudAPI
|
||||||
cluster *virtbuf.NewCluster
|
cluster *virtbuf.Cluster
|
||||||
}
|
}
|
||||||
|
|
||||||
// cloudAPIt defines the methods required from the API client.
|
// cloudAPIt defines the methods required from the API client.
|
||||||
|
@ -62,7 +62,7 @@ func (m *CloudManager) FindDropletByName(name string) (*virtbuf.Droplet, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start initiates the startup process for the specified cluster.
|
// Start initiates the startup process for the specified cluster.
|
||||||
func (m *CloudManager) Start(cluster *virtbuf.NewCluster) error {
|
func (m *CloudManager) Start(cluster *virtbuf.Cluster) error {
|
||||||
if cluster == nil {
|
if cluster == nil {
|
||||||
return errors.New("cluster cannot be nil")
|
return errors.New("cluster cannot be nil")
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ func (m *CloudManager) Start(cluster *virtbuf.NewCluster) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop halts the specified cluster.
|
// Stop halts the specified cluster.
|
||||||
func (m *CloudManager) Stop(cluster *virtbuf.NewCluster) error {
|
func (m *CloudManager) Stop(cluster *virtbuf.Cluster) error {
|
||||||
if cluster == nil {
|
if cluster == nil {
|
||||||
return errors.New("cluster cannot be nil")
|
return errors.New("cluster cannot be nil")
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ func (m *CloudManager) Stop(cluster *virtbuf.NewCluster) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// List retrieves all available clusters.
|
// List retrieves all available clusters.
|
||||||
func (m *CloudManager) List() ([]*virtbuf.NewCluster, error) {
|
func (m *CloudManager) List() ([]*virtbuf.Cluster, error) {
|
||||||
/*
|
/*
|
||||||
clusters, err := m.client.ListClusters(ctx)
|
clusters, err := m.client.ListClusters(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -102,7 +102,7 @@ func (m *CloudManager) List() ([]*virtbuf.NewCluster, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status checks the current status of a specified cluster.
|
// Status checks the current status of a specified cluster.
|
||||||
func (m *CloudManager) Status(cluster *virtbuf.NewCluster) (string, error) {
|
func (m *CloudManager) Status(cluster *virtbuf.Cluster) (string, error) {
|
||||||
if cluster == nil {
|
if cluster == nil {
|
||||||
return "", errors.New("cluster cannot be nil")
|
return "", errors.New("cluster cannot be nil")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue