Mercurial > hg > orthanc
comparison 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 |
comparison
equal
deleted
inserted
replaced
1102:ce6386b37afd | 1103:bec1eccf976c |
---|---|
54 result["Status"] = EnumerationToString(status); | 54 result["Status"] = EnumerationToString(status); |
55 call.GetOutput().AnswerJson(result); | 55 call.GetOutput().AnswerJson(result); |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 void OrthancRestApi::ResetOrthanc(RestApiPostCall& call) | |
60 { | |
61 OrthancRestApi::GetApi(call).resetRequestReceived_ = true; | |
62 call.GetOutput().AnswerBuffer("{}", "application/json"); | |
63 } | |
64 | |
65 | |
66 | |
67 | |
59 | 68 |
60 // Upload of DICOM files through HTTP --------------------------------------- | 69 // Upload of DICOM files through HTTP --------------------------------------- |
61 | 70 |
62 static void UploadDicomFile(RestApiPostCall& call) | 71 static void UploadDicomFile(RestApiPostCall& call) |
63 { | 72 { |
83 | 92 |
84 | 93 |
85 // Registration of the various REST handlers -------------------------------- | 94 // Registration of the various REST handlers -------------------------------- |
86 | 95 |
87 OrthancRestApi::OrthancRestApi(ServerContext& context) : | 96 OrthancRestApi::OrthancRestApi(ServerContext& context) : |
88 context_(context) | 97 context_(context), |
98 resetRequestReceived_(false) | |
89 { | 99 { |
90 RegisterSystem(); | 100 RegisterSystem(); |
91 | 101 |
92 RegisterChanges(); | 102 RegisterChanges(); |
93 RegisterResources(); | 103 RegisterResources(); |
97 | 107 |
98 Register("/instances", UploadDicomFile); | 108 Register("/instances", UploadDicomFile); |
99 | 109 |
100 // Auto-generated directories | 110 // Auto-generated directories |
101 Register("/tools", RestApi::AutoListChildren); | 111 Register("/tools", RestApi::AutoListChildren); |
112 Register("/tools/reset", ResetOrthanc); | |
102 Register("/instances/{id}/frames/{frame}", RestApi::AutoListChildren); | 113 Register("/instances/{id}/frames/{frame}", RestApi::AutoListChildren); |
103 } | 114 } |
104 } | 115 } |