comparison OrthancServer/OrthancRestApi/OrthancRestSystem.cpp @ 2647:73d7d95dd75e jobs

removal of internal job information
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 31 May 2018 17:45:09 +0200
parents 912a767911b0
children ae20fccdd867
comparison
equal deleted inserted replaced
2646:740983056f9e 2647:73d7d95dd75e
274 // Jobs information ------------------------------------------------------ 274 // Jobs information ------------------------------------------------------
275 275
276 static void ListJobs(RestApiGetCall& call) 276 static void ListJobs(RestApiGetCall& call)
277 { 277 {
278 bool expand = call.HasArgument("expand"); 278 bool expand = call.HasArgument("expand");
279 bool internal = call.HasArgument("internal");
280 279
281 Json::Value v = Json::arrayValue; 280 Json::Value v = Json::arrayValue;
282 281
283 std::set<std::string> jobs; 282 std::set<std::string> jobs;
284 OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().ListJobs(jobs); 283 OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().ListJobs(jobs);
290 { 289 {
291 JobInfo info; 290 JobInfo info;
292 if (OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().GetJobInfo(info, *it)) 291 if (OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().GetJobInfo(info, *it))
293 { 292 {
294 Json::Value tmp; 293 Json::Value tmp;
295 info.Serialize(tmp, internal); 294 info.Format(tmp);
296 v.append(tmp); 295 v.append(tmp);
297 } 296 }
298 } 297 }
299 else 298 else
300 { 299 {
306 } 305 }
307 306
308 static void GetJobInfo(RestApiGetCall& call) 307 static void GetJobInfo(RestApiGetCall& call)
309 { 308 {
310 std::string id = call.GetUriComponent("id", ""); 309 std::string id = call.GetUriComponent("id", "");
311 bool internal = call.HasArgument("internal");
312 310
313 JobInfo info; 311 JobInfo info;
314 if (OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().GetJobInfo(info, id)) 312 if (OrthancRestApi::GetContext(call).GetJobsEngine().GetRegistry().GetJobInfo(info, id))
315 { 313 {
316 Json::Value json; 314 Json::Value json;
317 info.Serialize(json, internal); 315 info.Format(json);
318 call.GetOutput().AnswerJson(json); 316 call.GetOutput().AnswerJson(json);
319 } 317 }
320 } 318 }
321 319
322 320