changeset 2444:d9e3781d2023

"/system" URI returns the version of the Orthanc REST API
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 08 Dec 2017 10:21:24 +0100
parents c149cee81250
children 6e5bc5c6d1a4
files NEWS OrthancServer/OrthancRestApi/OrthancRestSystem.cpp Resources/CMake/OrthancFrameworkConfiguration.cmake Resources/CMake/OrthancFrameworkParameters.cmake
diffstat 4 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Dec 06 14:44:12 2017 +0100
+++ b/NEWS	Fri Dec 08 10:21:24 2017 +0100
@@ -4,6 +4,7 @@
 REST API
 --------
 
+* "/system" URI returns the version of the Orthanc REST API
 * added ?expand argument to /peers and /modalities routes
 
 
--- a/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Wed Dec 06 14:44:12 2017 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Fri Dec 08 10:21:24 2017 +0100
@@ -54,6 +54,7 @@
   {
     Json::Value result = Json::objectValue;
 
+    result["ApiVersion"] = ORTHANC_API_VERSION;
     result["DatabaseVersion"] = OrthancRestApi::GetIndex(call).GetDatabaseVersion();
     result["DicomAet"] = Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC");
     result["DicomPort"] = Configuration::GetGlobalUnsignedIntegerParameter("DicomPort", 4242);
--- a/Resources/CMake/OrthancFrameworkConfiguration.cmake	Wed Dec 06 14:44:12 2017 +0100
+++ b/Resources/CMake/OrthancFrameworkConfiguration.cmake	Fri Dec 08 10:21:24 2017 +0100
@@ -406,6 +406,7 @@
 #####################################################################
 
 add_definitions(
+  -DORTHANC_API_VERSION="${ORTHANC_API_VERSION}"
   -DORTHANC_DATABASE_VERSION=${ORTHANC_DATABASE_VERSION}
   -DORTHANC_DEFAULT_DICOM_ENCODING=Encoding_Latin1
   -DORTHANC_ENABLE_BASE64=1
--- a/Resources/CMake/OrthancFrameworkParameters.cmake	Wed Dec 06 14:44:12 2017 +0100
+++ b/Resources/CMake/OrthancFrameworkParameters.cmake	Fri Dec 08 10:21:24 2017 +0100
@@ -14,6 +14,11 @@
 #   * Orthanc 0.9.5 -> mainline      = version 6
 set(ORTHANC_DATABASE_VERSION 6)
 
+# Version of the Orthanc API, can be retrieved from "/system" URI in
+# order to check whether new URI endpoints are available even if using
+# the mainline version of Orthanc
+set(ORTHANC_API_VERSION "1.0")
+
 
 #####################################################################
 ## CMake parameters tunable by the user