comparison OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp @ 4403:ad646ff506d0

cont openapi
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Dec 2020 18:32:13 +0100
parents 80fd140b12ba
children f34634916d8c
comparison
equal deleted inserted replaced
4402:b651989194d3 4403:ad646ff506d0
97 } 97 }
98 98
99 99
100 void OrthancRestApi::ResetOrthanc(RestApiPostCall& call) 100 void OrthancRestApi::ResetOrthanc(RestApiPostCall& call)
101 { 101 {
102 if (call.IsDocumentation())
103 {
104 call.GetDocumentation()
105 .SetTag("System")
106 .SetSummary("Restart Orthanc");
107 return;
108 }
109
102 OrthancRestApi::GetApi(call).leaveBarrier_ = true; 110 OrthancRestApi::GetApi(call).leaveBarrier_ = true;
103 OrthancRestApi::GetApi(call).resetRequestReceived_ = true; 111 OrthancRestApi::GetApi(call).resetRequestReceived_ = true;
104 call.GetOutput().AnswerBuffer("{}", MimeType_Json); 112 call.GetOutput().AnswerBuffer("{}", MimeType_Json);
105 } 113 }
106 114
107 115
108 void OrthancRestApi::ShutdownOrthanc(RestApiPostCall& call) 116 void OrthancRestApi::ShutdownOrthanc(RestApiPostCall& call)
109 { 117 {
118 if (call.IsDocumentation())
119 {
120 call.GetDocumentation()
121 .SetTag("System")
122 .SetSummary("Shutdown Orthanc");
123 return;
124 }
125
110 OrthancRestApi::GetApi(call).leaveBarrier_ = true; 126 OrthancRestApi::GetApi(call).leaveBarrier_ = true;
111 call.GetOutput().AnswerBuffer("{}", MimeType_Json); 127 call.GetOutput().AnswerBuffer("{}", MimeType_Json);
112 LOG(WARNING) << "Shutdown request received"; 128 LOG(WARNING) << "Shutdown request received";
113 } 129 }
114 130
130 sample["Path"] = "/instances/19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5"; 146 sample["Path"] = "/instances/19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5";
131 sample["Status"] = "Success"; 147 sample["Status"] = "Success";
132 148
133 call.GetDocumentation() 149 call.GetDocumentation()
134 .SetTag("Instances") 150 .SetTag("Instances")
135 .SetSummary("Upload DICOM files") 151 .SetSummary("Upload DICOM instances")
136 .AddRequestType(MimeType_Dicom, "DICOM file to be uploaded") 152 .AddRequestType(MimeType_Dicom, "DICOM file to be uploaded")
137 .AddRequestType(MimeType_Zip, "ZIP archive containing DICOM files (new in Orthanc 1.8.2)") 153 .AddRequestType(MimeType_Zip, "ZIP archive containing DICOM files (new in Orthanc 1.8.2)")
138 .AddAnswerType(MimeType_Json, "Information about the uploaded instance, " 154 .AddAnswerType(MimeType_Json, "Information about the uploaded instance, "
139 "or list of information for each uploaded instance in the case of ZIP archive") 155 "or list of information for each uploaded instance in the case of ZIP archive")
140 .SetSample(sample); 156 .SetSample(sample);