From c9c0abc440e15bb23f7569f7691232f9ab3baf0e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 22 Oct 2024 03:26:02 -0500 Subject: [PATCH] add hypervisor struct Signed-off-by: Jeff Carr --- Makefile | 8 ++++++++ cluster.proto | 2 ++ hypervisor.proto | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 hypervisor.proto diff --git a/Makefile b/Makefile index 350fd4b..e6cd85a 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ all: # Then: protoc --version make droplet.pb.go + make hypervisor.pb.go + make cluster.pb.go cd configfile && make vet: @@ -43,10 +45,16 @@ droplet.pb.go: droplet.proto --go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \ droplet.proto +hypervisor.pb.go: hypervisor.proto + cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \ + --go_opt=Mhypervisor.proto=go.wit.com/lib/protobuf/virtbuf \ + hypervisor.proto + cluster.pb.go: cluster.proto cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \ --go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \ --go_opt=Mcluster.proto=go.wit.com/lib/protobuf/virtbuf \ + --go_opt=Mhypervisor.proto=go.wit.com/lib/protobuf/virtbuf \ cluster.proto diff --git a/cluster.proto b/cluster.proto index d50af52..77ca62e 100644 --- a/cluster.proto +++ b/cluster.proto @@ -2,8 +2,10 @@ syntax = "proto3"; package virtbuf; import "droplet.proto"; +import "hypervisor.proto"; message Cluster { int64 id = 1; repeated Droplet droplets = 2; + repeated Hypervisor hypervisors = 3; } diff --git a/hypervisor.proto b/hypervisor.proto new file mode 100644 index 0000000..aa2a9da --- /dev/null +++ b/hypervisor.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package virtbuf; + +message Hypervisor { + string hostname = 1; + bool active = 2; + int64 cpus = 3; + int64 memory = 4; +}