From ea171b3243e46d8fc3c81d9f015a670d42fc82d1 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 6 Jan 2015 00:27:46 +0000 Subject: [PATCH] add more fields to /version Signed-off-by: Victor Vieux --- api/api.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/api/api.go b/api/api.go index 00f1b73a8d..73ffd3ec73 100644 --- a/api/api.go +++ b/api/api.go @@ -17,6 +17,8 @@ import ( "github.com/samalba/dockerclient" ) +const APIVERSION = "1.16" + type context struct { cluster *cluster.Cluster scheduler *scheduler.Scheduler @@ -53,13 +55,19 @@ func getInfo(c *context, w http.ResponseWriter, r *http.Request) { // GET /version func getVersion(c *context, w http.ResponseWriter, r *http.Request) { version := struct { - Version string - GoVersion string - GitCommit string + Version string + ApiVersion string + GoVersion string + GitCommit string + Os string + Arch string }{ - Version: "swarm/" + c.version, - GoVersion: runtime.Version(), - GitCommit: "n/a", + Version: "swarm/" + c.version, + ApiVersion: APIVERSION, + GoVersion: runtime.Version(), + GitCommit: "n/a", + Os: runtime.GOOS, + Arch: runtime.GOARCH, } json.NewEncoder(w).Encode(version)