# HG changeset patch # User Sebastien Jodogne # Date 1512724884 -3600 # Node ID d9e3781d20238dfdf817cec8230d5f521e256e64 # Parent c149cee8125025b02a589548c1fba81af129b1f2 "/system" URI returns the version of the Orthanc REST API diff -r c149cee81250 -r d9e3781d2023 NEWS --- 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 diff -r c149cee81250 -r d9e3781d2023 OrthancServer/OrthancRestApi/OrthancRestSystem.cpp --- 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); diff -r c149cee81250 -r d9e3781d2023 Resources/CMake/OrthancFrameworkConfiguration.cmake --- 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 diff -r c149cee81250 -r d9e3781d2023 Resources/CMake/OrthancFrameworkParameters.cmake --- 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