Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestModalities.cpp @ 3950:5797ca4f3b8d transcoding
"/peers/{id}/store": New option "Transcode"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 19 May 2020 20:37:00 +0200 |
parents | 8f7ad4989fec |
children |
comparison
equal
deleted
inserted
replaced
3949:ef696db8426f | 3950:5797ca4f3b8d |
---|---|
1134 | 1134 |
1135 Json::Value request; | 1135 Json::Value request; |
1136 std::unique_ptr<OrthancPeerStoreJob> job(new OrthancPeerStoreJob(context)); | 1136 std::unique_ptr<OrthancPeerStoreJob> job(new OrthancPeerStoreJob(context)); |
1137 | 1137 |
1138 GetInstancesToExport(request, *job, remote, call); | 1138 GetInstancesToExport(request, *job, remote, call); |
1139 | |
1140 static const char* TRANSCODE = "Transcode"; | |
1141 if (request.type() == Json::objectValue && | |
1142 request.isMember(TRANSCODE)) | |
1143 { | |
1144 job->SetTranscode(SerializationToolbox::ReadString(request, TRANSCODE)); | |
1145 } | |
1139 | 1146 |
1140 OrthancConfiguration::ReaderLock lock; | 1147 { |
1141 | 1148 OrthancConfiguration::ReaderLock lock; |
1142 WebServiceParameters peer; | 1149 |
1143 if (lock.GetConfiguration().LookupOrthancPeer(peer, remote)) | 1150 WebServiceParameters peer; |
1144 { | 1151 if (lock.GetConfiguration().LookupOrthancPeer(peer, remote)) |
1145 job->SetPeer(peer); | 1152 { |
1146 OrthancRestApi::GetApi(call).SubmitCommandsJob | 1153 job->SetPeer(peer); |
1147 (call, job.release(), true /* synchronous by default */, request); | 1154 } |
1148 } | 1155 else |
1149 else | 1156 { |
1150 { | 1157 throw OrthancException(ErrorCode_UnknownResource, |
1151 throw OrthancException(ErrorCode_UnknownResource, | 1158 "No peer with symbolic name: " + remote); |
1152 "No peer with symbolic name: " + remote); | 1159 } |
1153 } | 1160 } |
1161 | |
1162 OrthancRestApi::GetApi(call).SubmitCommandsJob | |
1163 (call, job.release(), true /* synchronous by default */, request); | |
1154 } | 1164 } |
1155 | 1165 |
1156 static void PeerSystem(RestApiGetCall& call) | 1166 static void PeerSystem(RestApiGetCall& call) |
1157 { | 1167 { |
1158 std::string remote = call.GetUriComponent("id", ""); | 1168 std::string remote = call.GetUriComponent("id", ""); |