update gateway instance api
This commit is contained in:
parent
aa680c2796
commit
949c781562
|
@ -214,14 +214,24 @@ func (h *GatewayAPI) getInstanceStatus(w http.ResponseWriter, req *http.Request,
|
||||||
password = ""
|
password = ""
|
||||||
}
|
}
|
||||||
gid, _ := instance.GetValue("id")
|
gid, _ := instance.GetValue("id")
|
||||||
connRes, err := h.doConnect(endpoint.(string), gateway.BasicAuth{
|
res, err := doGatewayRequest(&ProxyRequest{
|
||||||
Username: username.(string),
|
Endpoint: endpoint.(string),
|
||||||
Password: password.(string),
|
Method: http.MethodGet,
|
||||||
|
Path: "/stats",
|
||||||
|
BasicAuth: gateway.BasicAuth{
|
||||||
|
Username: username.(string),
|
||||||
|
Password: password.(string),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
|
result[gid.(string)] = util.MapStr{}
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
result[gid.(string)] = connRes
|
var resMap = util.MapStr{}
|
||||||
|
util.MustFromJSONBytes(res.Body, &resMap)
|
||||||
|
|
||||||
|
result[gid.(string)] = resMap
|
||||||
}
|
}
|
||||||
h.WriteJSON(w, result, http.StatusOK)
|
h.WriteJSON(w, result, http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue