func removeDevice(c *cli.Context) { // TODO: add validation mac := strings.Trim(c.Args().First(), " ") buffer := bytes.NewBufferString(mac) invoker.SendPacket(invoker.TYPE_REMOVE_DEVICE, *buffer) }
func registerDevice(c *cli.Context) { // TODO: add validation mac := strings.Trim(c.Args().First(), " ") ip := strings.Trim(c.Args().Get(1), " ") buffer := bytes.NewBufferString(mac + " " + ip) invoker.SendPacket(invoker.TYPE_NEW_DEVICE, *buffer) }
func stopDaemon(c *cli.Context) { if !daemon.IsDaemonized() { log.Error("No daemon is running!") return } invoker.SendPacket(invoker.TYPE_STOP_DAEMON, *bytes.NewBufferString("")) log.Info("Stopping the daemon ..") }
func installPlugin(c *cli.Context) { //TODO: handle installation of plugins on specific nodes only, examine buffer := bytes.NewBufferString(c.Args().First()) buffer.WriteString(" ") invoker.SendPacket(invoker.TYPE_INSTALL_PLUGIN, *buffer) }