diff OrthancServer/OrthancRestApi/OrthancRestApi.cpp @ 1103:bec1eccf976c

Hot restart of Orthanc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 07 Aug 2014 11:33:46 +0200
parents 0332e6e8c679
children 6e7e5ed91c2d
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestApi.cpp	Thu Aug 07 10:51:35 2014 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestApi.cpp	Thu Aug 07 11:33:46 2014 +0200
@@ -56,6 +56,15 @@
   }
 
 
+  void OrthancRestApi::ResetOrthanc(RestApiPostCall& call)
+  {
+    OrthancRestApi::GetApi(call).resetRequestReceived_ = true;
+    call.GetOutput().AnswerBuffer("{}", "application/json");
+  }
+
+
+
+
 
   // Upload of DICOM files through HTTP ---------------------------------------
 
@@ -85,7 +94,8 @@
   // Registration of the various REST handlers --------------------------------
 
   OrthancRestApi::OrthancRestApi(ServerContext& context) : 
-    context_(context)
+    context_(context),
+    resetRequestReceived_(false)
   {
     RegisterSystem();
 
@@ -99,6 +109,7 @@
 
     // Auto-generated directories
     Register("/tools", RestApi::AutoListChildren);
+    Register("/tools/reset", ResetOrthanc);
     Register("/instances/{id}/frames/{frame}", RestApi::AutoListChildren);
   }
 }