Adding version.Info in apiserver.go

pull/6/head
Peeyush Gupta 2016-06-06 14:15:24 +05:30
parent a57fd9adfb
commit 1a9f7e9a0c
2 changed files with 48 additions and 3 deletions

View File

@ -9,7 +9,7 @@
"description": "git code version from which this is built", "description": "git code version from which this is built",
"operations": [ "operations": [
{ {
"type": "void", "type": "version.Info",
"method": "GET", "method": "GET",
"summary": "get the code version", "summary": "get the code version",
"nickname": "getCodeVersion", "nickname": "getCodeVersion",
@ -24,5 +24,49 @@
] ]
} }
], ],
"models": {} "models": {
"version.Info": {
"id": "version.Info",
"required": [
"major",
"minor",
"gitVersion",
"gitCommit",
"gitTreeState",
"buildDate",
"goVersion",
"compiler",
"platform"
],
"properties": {
"major": {
"type": "string"
},
"minor": {
"type": "string"
},
"gitVersion": {
"type": "string"
},
"gitCommit": {
"type": "string"
},
"gitTreeState": {
"type": "string"
},
"buildDate": {
"type": "string"
},
"goVersion": {
"type": "string"
},
"compiler": {
"type": "string"
},
"platform": {
"type": "string"
}
}
}
}
} }

View File

@ -174,7 +174,8 @@ func InstallVersionHandler(mux Mux, container *restful.Container) {
Doc("get the code version"). Doc("get the code version").
Operation("getCodeVersion"). Operation("getCodeVersion").
Produces(restful.MIME_JSON). Produces(restful.MIME_JSON).
Consumes(restful.MIME_JSON)) Consumes(restful.MIME_JSON).
Writes(version.Info{}))
container.Add(versionWS) container.Add(versionWS)
} }