summaryrefslogtreecommitdiff
path: root/send.go
diff options
context:
space:
mode:
Diffstat (limited to 'send.go')
-rw-r--r--send.go54
1 files changed, 30 insertions, 24 deletions
diff --git a/send.go b/send.go
index 727cbc9..78622a9 100644
--- a/send.go
+++ b/send.go
@@ -4,45 +4,50 @@
package main
import (
- "os"
- "strings"
-
- "go.wit.com/lib/gui/shell"
+ "go.wit.com/lib/protobuf/zoopb"
"go.wit.com/log"
)
func pingStatus() error {
- var url string
- url = me.urlbase + "/status?hostname=" + me.machine.Hostname
+ log.Info("fixme: does nothing")
/*
- msg, err := me.machine.Packages.Marshal()
+ var url string
+ url = me.urlbase + "/status?hostname=" + me.machine.Hostname
+
+ body, err := me.machine.HttpPostMachine(url)
if err != nil {
- log.Info("proto.Marshal() failed:", err)
+ log.Info("httpPost() failed:", err)
return err
}
- log.Info("proto Marshal len =", len(msg))
+
+ test := strings.TrimSpace(string(body))
+ // log.Info("virtigo returned body:", test)
+ for _, line := range strings.Split(test, "\n") {
+ switch line {
+ case "upgrade":
+ log.Info("should upgrade now")
+ default:
+ log.Info("GOT:", line)
+ }
+ }
*/
+ return nil
+}
- body, err := me.machine.HttpPostMachine(url)
+func sendMachine(pb *zoopb.Machine) error {
+ newpb, wsPB, err := pb.HttpPost(me.urlbase, "machine")
if err != nil {
- log.Info("httpPost() failed:", err)
+ log.Info("got error:", err)
return err
}
-
- test := strings.TrimSpace(string(body))
- // log.Info("virtigo returned body:", test)
- for _, line := range strings.Split(test, "\n") {
- switch line {
- case "upgrade":
- log.Info("should upgrade now")
- default:
- log.Info("GOT:", line)
- }
- }
- return nil
+ wsPB.DumpClient()
+ log.Infof("mem=%d cpus=%d\n", newpb.Memory, newpb.Cpus)
+ log.Info("got error:", err)
+ return err
}
-func sendMachine(s string) error {
+/*
+func sendMachineOld(s string) error {
var url string
url = me.urlbase + "/machine"
body, err := me.machine.HttpPostMachine(url)
@@ -94,3 +99,4 @@ func sendMachine(s string) error {
}
return nil
}
+*/