summaryrefslogtreecommitdiff
path: root/sampleData.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-22 03:50:01 -0500
committerJeff Carr <[email protected]>2024-10-22 03:50:01 -0500
commit8cab0857fda04a5e9b06860aec15d05342b747f1 (patch)
tree6789fdafd3a336696ef3b285d7fd728f90268e38 /sampleData.go
parentc9c0abc440e15bb23f7569f7691232f9ab3baf0e (diff)
next step, write out yaml or json
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'sampleData.go')
-rw-r--r--sampleData.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/sampleData.go b/sampleData.go
index d0932d4..eaf4cb7 100644
--- a/sampleData.go
+++ b/sampleData.go
@@ -25,6 +25,19 @@ func CreateSampleDroplet(hostname string) *Droplet {
return d
}
+func CreateSampleHypervisor(hostname string) *Hypervisor {
+ // Generate a new UUID
+ id := uuid.New()
+ h := &Hypervisor{
+ Uuid: id.String(),
+ Hostname: hostname,
+ Cpus: 16,
+ Memory: 256,
+ Comment: "this is a fake hypervisor",
+ }
+ return h
+}
+
func CreateSampleCluster(total int) *Cluster {
var c *Cluster
c = new(Cluster)
@@ -33,9 +46,18 @@ func CreateSampleCluster(total int) *Cluster {
hostname := fmt.Sprintf("bmath%d.wit.com", i)
d := CreateSampleDroplet(hostname)
d.Comment = fmt.Sprintf("Sample Droplet %d", i)
+ d.PreferredHypervisor = fmt.Sprintf("farm%d", i)
c.Droplets = append(c.Droplets, d)
}
+ for i := 0; i < 3; i++ {
+ hostname := fmt.Sprintf("farm%d", i)
+ h := CreateSampleHypervisor(hostname)
+ h.Comment = fmt.Sprintf("Sample hypervisor %d", i)
+
+ c.Hypervisors = append(c.Hypervisors, h)
+ }
+
return c
}