summaryrefslogtreecommitdiffstats
path: root/lib/agent/apiv1.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-21 15:07:04 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-23 00:43:11 +0100
commit45f6472d1e8ecad428da314a6d762143f033865d (patch)
tree3d4f3f413ab752fcb0d5c661fd3fec63ba5f5c24 /lib/agent/apiv1.go
parenta85f3ef5017e7e1406476194cd5f3e848a3718f9 (diff)
Added new SDKs management supportv1.0.0-rc2
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/apiv1.go')
-rw-r--r--lib/agent/apiv1.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/agent/apiv1.go b/lib/agent/apiv1.go
index 8ec26d2..d0e5a1c 100644
--- a/lib/agent/apiv1.go
+++ b/lib/agent/apiv1.go
@@ -23,6 +23,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/iotbzh/xds-agent/lib/xdsconfig"
+ "github.com/iotbzh/xds-server/lib/xsapiv1"
)
const apiBaseURL = "/api/v1"
@@ -129,11 +130,21 @@ func (s *APIService) AddXdsServer(cfg xdsconfig.XDSServerConf) (*XdsServer, erro
// Add to map
s.xdsServers[svr.ID] = svr
+ // Register event forwarder
+ s.sdksEventsForwardInit(svr)
+
// Load projects
if err == nil && svr.Connected {
err = s.projects.Init(svr)
}
+ // Registered to all events
+ if err == nil && svr.Connected {
+ if err = svr.EventRegister(xsapiv1.EVTAll, ""); err != nil {
+ s.Log.Errorf("XDS Server %v - register all events error: %v", svr.ID, err)
+ }
+ }
+
return svr, err
}