Mercurial > hg > orthanc
comparison OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 4403:ad646ff506d0
cont openapi
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Dec 2020 18:32:13 +0100 |
parents | 354ea95b294a |
children | f34634916d8c |
comparison
equal
deleted
inserted
replaced
4402:b651989194d3 | 4403:ad646ff506d0 |
---|---|
166 const std::string resources = GetResourceTypeText(resourceType, true /* plural */, false /* lower case */); | 166 const std::string resources = GetResourceTypeText(resourceType, true /* plural */, false /* lower case */); |
167 call.GetDocumentation() | 167 call.GetDocumentation() |
168 .SetTag(GetResourceTypeText(resourceType, true /* plural */, true /* upper case */)) | 168 .SetTag(GetResourceTypeText(resourceType, true /* plural */, true /* upper case */)) |
169 .SetSummary("List the available " + resources) | 169 .SetSummary("List the available " + resources) |
170 .SetDescription("List the Orthanc identifiers of all the available DICOM " + resources) | 170 .SetDescription("List the Orthanc identifiers of all the available DICOM " + resources) |
171 .SetHttpGetArgument("limit", RestApiCallDocumentation::Type_Number, "Limit the number of results") | 171 .SetHttpGetArgument("limit", RestApiCallDocumentation::Type_Number, "Limit the number of results", false) |
172 .SetHttpGetArgument("since", RestApiCallDocumentation::Type_Number, "Show only the resources since the provided index") | 172 .SetHttpGetArgument("since", RestApiCallDocumentation::Type_Number, "Show only the resources since the provided index", false) |
173 .SetHttpGetArgument("expand", RestApiCallDocumentation::Type_String, | 173 .SetHttpGetArgument("expand", RestApiCallDocumentation::Type_String, |
174 "If present, retrieve detailed information about the individual " + resources) | 174 "If present, retrieve detailed information about the individual " + resources, false) |
175 .SetHttpGetSample("https://demo.orthanc-server.com/" + resources + "?since=0&limit=2", true); | 175 .SetHttpGetSample("https://demo.orthanc-server.com/" + resources + "?since=0&limit=2", true); |
176 return; | 176 return; |
177 } | 177 } |
178 | 178 |
179 ServerIndex& index = OrthancRestApi::GetIndex(call); | 179 ServerIndex& index = OrthancRestApi::GetIndex(call); |
281 { | 281 { |
282 call.GetDocumentation() | 282 call.GetDocumentation() |
283 .SetTag("Patients") | 283 .SetTag("Patients") |
284 .SetSummary("Is the patient protected against recycling?") | 284 .SetSummary("Is the patient protected against recycling?") |
285 .SetUriArgument("id", RestApiCallDocumentation::Type_String, "Orthanc identifier of the patient of interest") | 285 .SetUriArgument("id", RestApiCallDocumentation::Type_String, "Orthanc identifier of the patient of interest") |
286 .AddAnswerType(MimeType_PlainText, "\"1\" if protected, \"0\" if not protected"); | 286 .AddAnswerType(MimeType_PlainText, "`1` if protected, `0` if not protected"); |
287 return; | 287 return; |
288 } | 288 } |
289 | 289 |
290 std::string publicId = call.GetUriComponent("id", ""); | 290 std::string publicId = call.GetUriComponent("id", ""); |
291 bool isProtected = OrthancRestApi::GetIndex(call).IsProtectedPatient(publicId); | 291 bool isProtected = OrthancRestApi::GetIndex(call).IsProtectedPatient(publicId); |
298 if (call.IsDocumentation()) | 298 if (call.IsDocumentation()) |
299 { | 299 { |
300 call.GetDocumentation() | 300 call.GetDocumentation() |
301 .SetTag("Patients") | 301 .SetTag("Patients") |
302 .SetSummary("Protect one patient against recycling") | 302 .SetSummary("Protect one patient against recycling") |
303 .SetDescription("Check out configuration options \"MaximumStorageSize\" and \"MaximumPatientCount\"") | 303 .SetDescription("Check out configuration options `MaximumStorageSize` and `MaximumPatientCount`") |
304 .SetUriArgument("id", RestApiCallDocumentation::Type_String, "Orthanc identifier of the patient of interest"); | 304 .SetUriArgument("id", RestApiCallDocumentation::Type_String, "Orthanc identifier of the patient of interest"); |
305 return; | 305 return; |
306 } | 306 } |
307 | 307 |
308 ServerContext& context = OrthancRestApi::GetContext(call); | 308 ServerContext& context = OrthancRestApi::GetContext(call); |