[icinga-checkins] icinga.org: icinga2/master: Add version info in /v1

git at icinga.org git at icinga.org
Tue Aug 9 08:45:49 CEST 2016


Module: icinga2
Branch: master
Commit: cb21ee3a0469622a748b74e53753b244214ac8e1
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=cb21ee3a0469622a748b74e53753b244214ac8e1

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue Aug  9 08:44:53 2016 +0200

Add version info in /v1

fixes #12327

---

 lib/remote/infohandler.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/remote/infohandler.cpp b/lib/remote/infohandler.cpp
index 04c0c90..0d21927 100644
--- a/lib/remote/infohandler.cpp
+++ b/lib/remote/infohandler.cpp
@@ -70,6 +70,7 @@ bool InfoHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& request,
 
 		result1->Set("user", user->GetName());
 		result1->Set("permissions", Array::FromVector(permInfo));
+		result1->Set("version", Application::GetAppVersion());
 		result1->Set("info", "More information about API requests is available in the documentation at http://docs.icinga.org/icinga2/latest.");
 
 		Array::Ptr results = new Array();
@@ -82,7 +83,7 @@ bool InfoHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& request,
 	} else {
 		response.AddHeader("Content-Type", "text/html");
 
-		String body = "<html><head><title>Icinga 2</title></head><h1>Hello from Icinga 2!</h1>";
+		String body = "<html><head><title>Icinga 2</title></head><h1>Hello from Icinga 2 (Version: " + Application::GetAppVersion + ")!</h1>";
 		body += "<p>You are authenticated as <b>" + user->GetName() + "</b>. ";
 
 		if (!permInfo.empty()) {



More information about the icinga-checkins mailing list