DodoApp: Output access points
Change-Id: I078adfd43bd254e260bf63113a2fb3ab059c7706
diff --git a/core/installer/server/appmanager/server.go b/core/installer/server/appmanager/server.go
index e0aeab2..ffa710c 100644
--- a/core/installer/server/appmanager/server.go
+++ b/core/installer/server/appmanager/server.go
@@ -170,8 +170,9 @@
}
type dodoAppInstallResp struct {
- Id string `json:"id"`
- DeployKey string `json:"deployKey"`
+ Id string `json:"id"`
+ DeployKey string `json:"deployKey"`
+ Access []installer.Access `json:"access"`
}
type dodoAppRendered struct {
@@ -224,6 +225,7 @@
if err := json.NewEncoder(w).Encode(dodoAppInstallResp{
Id: instanceId,
DeployKey: cfg.Input.Key.Public,
+ Access: rr.Access,
}); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
@@ -285,6 +287,17 @@
s.tasks[instanceId] = &taskForward{t, fmt.Sprintf("/instance/%s", instanceId), 0}
t.OnDone(s.cleanTask(instanceId, 0))
go t.Start()
+ var rend dodoAppRendered
+ if err := json.NewDecoder(bytes.NewReader(rr.RenderedRaw)).Decode(&rend); err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ }
+ if err := json.NewEncoder(w).Encode(dodoAppInstallResp{
+ Id: instanceId,
+ DeployKey: rend.Input.Key.Public,
+ Access: rr.Access,
+ }); err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ }
}
func (s *Server) handleNetworks(w http.ResponseWriter, r *http.Request) {