comparison OrthancServer/Sources/OrthancRestApi/OrthancRestSystem.cpp @ 5432:59e3b6f8c5be

migration to UCLouvain servers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 Nov 2023 18:16:31 +0100
parents 4be5f117aa0d
children 38403e13c1ca
comparison
equal deleted inserted replaced
5431:4be5f117aa0d 5432:59e3b6f8c5be
98 .SetSummary("Get system information") 98 .SetSummary("Get system information")
99 .SetDescription("Get system information about Orthanc") 99 .SetDescription("Get system information about Orthanc")
100 .SetAnswerField(API_VERSION, RestApiCallDocumentation::Type_Number, "Version of the REST API") 100 .SetAnswerField(API_VERSION, RestApiCallDocumentation::Type_Number, "Version of the REST API")
101 .SetAnswerField(VERSION, RestApiCallDocumentation::Type_String, "Version of Orthanc") 101 .SetAnswerField(VERSION, RestApiCallDocumentation::Type_String, "Version of Orthanc")
102 .SetAnswerField(DATABASE_VERSION, RestApiCallDocumentation::Type_Number, 102 .SetAnswerField(DATABASE_VERSION, RestApiCallDocumentation::Type_Number,
103 "Version of the database: https://book.orthanc-server.com/developers/db-versioning.html") 103 "Version of the database: https://orthanc.uclouvain.be/book/developers/db-versioning.html")
104 .SetAnswerField(DATABASE_SERVER_IDENTIFIER, RestApiCallDocumentation::Type_String, 104 .SetAnswerField(DATABASE_SERVER_IDENTIFIER, RestApiCallDocumentation::Type_String,
105 "ID of the server in the database (when running multiple Orthanc on the same DB)") 105 "ID of the server in the database (when running multiple Orthanc on the same DB)")
106 .SetAnswerField(IS_HTTP_SERVER_SECURE, RestApiCallDocumentation::Type_Boolean, 106 .SetAnswerField(IS_HTTP_SERVER_SECURE, RestApiCallDocumentation::Type_Boolean,
107 "Whether the REST API is properly secured (assuming no reverse proxy is in use): https://book.orthanc-server.com/faq/security.html#securing-the-http-server") 107 "Whether the REST API is properly secured (assuming no reverse proxy is in use): https://orthanc.uclouvain.be/book/faq/security.html#securing-the-http-server")
108 .SetAnswerField(STORAGE_AREA_PLUGIN, RestApiCallDocumentation::Type_String, 108 .SetAnswerField(STORAGE_AREA_PLUGIN, RestApiCallDocumentation::Type_String,
109 "Information about the installed storage area plugin (`null` if no such plugin is installed)") 109 "Information about the installed storage area plugin (`null` if no such plugin is installed)")
110 .SetAnswerField(DATABASE_BACKEND_PLUGIN, RestApiCallDocumentation::Type_String, 110 .SetAnswerField(DATABASE_BACKEND_PLUGIN, RestApiCallDocumentation::Type_String,
111 "Information about the installed database index plugin (`null` if no such plugin is installed)") 111 "Information about the installed database index plugin (`null` if no such plugin is installed)")
112 .SetAnswerField(DICOM_AET, RestApiCallDocumentation::Type_String, "The DICOM AET of Orthanc") 112 .SetAnswerField(DICOM_AET, RestApiCallDocumentation::Type_String, "The DICOM AET of Orthanc")
132 "The configured MaximumStorageMode (new in Orthanc 1.11.3)") 132 "The configured MaximumStorageMode (new in Orthanc 1.11.3)")
133 .SetAnswerField(USER_METADATA, RestApiCallDocumentation::Type_JsonObject, 133 .SetAnswerField(USER_METADATA, RestApiCallDocumentation::Type_JsonObject,
134 "The configured UserMetadata (new in Orthanc 1.12.0)") 134 "The configured UserMetadata (new in Orthanc 1.12.0)")
135 .SetAnswerField(HAS_LABELS, RestApiCallDocumentation::Type_Boolean, 135 .SetAnswerField(HAS_LABELS, RestApiCallDocumentation::Type_Boolean,
136 "Whether the database back-end supports labels (new in Orthanc 1.12.0)") 136 "Whether the database back-end supports labels (new in Orthanc 1.12.0)")
137 .SetHttpGetSample("https://demo.orthanc-server.com/system", true); 137 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/system", true);
138 return; 138 return;
139 } 139 }
140 140
141 ServerContext& context = OrthancRestApi::GetContext(call); 141 ServerContext& context = OrthancRestApi::GetContext(call);
142 142
209 .SetAnswerField("CountPatients", RestApiCallDocumentation::Type_Number, "Number of patients stored in Orthanc") 209 .SetAnswerField("CountPatients", RestApiCallDocumentation::Type_Number, "Number of patients stored in Orthanc")
210 .SetAnswerField("TotalDiskSize", RestApiCallDocumentation::Type_String, "Size of the storage area (in bytes)") 210 .SetAnswerField("TotalDiskSize", RestApiCallDocumentation::Type_String, "Size of the storage area (in bytes)")
211 .SetAnswerField("TotalDiskSizeMB", RestApiCallDocumentation::Type_Number, "Size of the storage area (in megabytes)") 211 .SetAnswerField("TotalDiskSizeMB", RestApiCallDocumentation::Type_Number, "Size of the storage area (in megabytes)")
212 .SetAnswerField("TotalUncompressedSize", RestApiCallDocumentation::Type_String, "Total size of all the files once uncompressed (in bytes). This corresponds to `TotalDiskSize` if no compression is enabled, cf. `StorageCompression` configuration option") 212 .SetAnswerField("TotalUncompressedSize", RestApiCallDocumentation::Type_String, "Total size of all the files once uncompressed (in bytes). This corresponds to `TotalDiskSize` if no compression is enabled, cf. `StorageCompression` configuration option")
213 .SetAnswerField("TotalUncompressedSizeMB", RestApiCallDocumentation::Type_Number, "Total size of all the files once uncompressed (in megabytes)") 213 .SetAnswerField("TotalUncompressedSizeMB", RestApiCallDocumentation::Type_Number, "Total size of all the files once uncompressed (in megabytes)")
214 .SetHttpGetSample("https://demo.orthanc-server.com/statistics", true); 214 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/statistics", true);
215 return; 215 return;
216 } 216 }
217 217
218 static const uint64_t MEGA_BYTES = 1024 * 1024; 218 static const uint64_t MEGA_BYTES = 1024 * 1024;
219 219
506 call.GetDocumentation() 506 call.GetDocumentation()
507 .SetTag("System") 507 .SetTag("System")
508 .SetSummary("List plugins") 508 .SetSummary("List plugins")
509 .SetDescription("List all the installed plugins") 509 .SetDescription("List all the installed plugins")
510 .AddAnswerType(MimeType_Json, "JSON array containing the identifiers of the installed plugins") 510 .AddAnswerType(MimeType_Json, "JSON array containing the identifiers of the installed plugins")
511 .SetHttpGetSample("https://demo.orthanc-server.com/plugins", true); 511 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/plugins", true);
512 return; 512 return;
513 } 513 }
514 514
515 Json::Value v = Json::arrayValue; 515 Json::Value v = Json::arrayValue;
516 516
542 .SetTag("System") 542 .SetTag("System")
543 .SetSummary("Get plugin") 543 .SetSummary("Get plugin")
544 .SetDescription("Get system information about the plugin whose identifier is provided in the URL") 544 .SetDescription("Get system information about the plugin whose identifier is provided in the URL")
545 .SetUriArgument("id", "Identifier of the job of interest") 545 .SetUriArgument("id", "Identifier of the job of interest")
546 .AddAnswerType(MimeType_Json, "JSON object containing information about the plugin") 546 .AddAnswerType(MimeType_Json, "JSON object containing information about the plugin")
547 .SetHttpGetSample("https://demo.orthanc-server.com/plugins/dicom-web", true); 547 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/plugins/dicom-web", true);
548 return; 548 return;
549 } 549 }
550 550
551 if (!OrthancRestApi::GetContext(call).HasPlugins()) 551 if (!OrthancRestApi::GetContext(call).HasPlugins())
552 { 552 {
651 .SetDescription("List all the available jobs") 651 .SetDescription("List all the available jobs")
652 .SetHttpGetArgument("expand", RestApiCallDocumentation::Type_String, 652 .SetHttpGetArgument("expand", RestApiCallDocumentation::Type_String,
653 "If present, retrieve detailed information about the individual jobs", false) 653 "If present, retrieve detailed information about the individual jobs", false)
654 .AddAnswerType(MimeType_Json, "JSON array containing either the jobs identifiers, or detailed information " 654 .AddAnswerType(MimeType_Json, "JSON array containing either the jobs identifiers, or detailed information "
655 "about the reported jobs (if `expand` argument is provided)") 655 "about the reported jobs (if `expand` argument is provided)")
656 .SetTruncatedJsonHttpGetSample("https://demo.orthanc-server.com/jobs", 3); 656 .SetTruncatedJsonHttpGetSample("https://orthanc.uclouvain.be/demo/jobs", 3);
657 return; 657 return;
658 } 658 }
659 659
660 bool expand = call.HasArgument("expand") && call.GetBooleanArgument("expand", true); 660 bool expand = call.HasArgument("expand") && call.GetBooleanArgument("expand", true);
661 661
709 709
710 call.GetDocumentation() 710 call.GetDocumentation()
711 .SetTag("Jobs") 711 .SetTag("Jobs")
712 .SetSummary("Get job") 712 .SetSummary("Get job")
713 .SetDescription("Retrieve detailed information about the job whose identifier is provided in the URL: " 713 .SetDescription("Retrieve detailed information about the job whose identifier is provided in the URL: "
714 "https://book.orthanc-server.com/users/advanced-rest.html#jobs") 714 "https://orthanc.uclouvain.be/book/users/advanced-rest.html#jobs")
715 .SetUriArgument("id", "Identifier of the job of interest") 715 .SetUriArgument("id", "Identifier of the job of interest")
716 .AddAnswerType(MimeType_Json, "JSON object detailing the job") 716 .AddAnswerType(MimeType_Json, "JSON object detailing the job")
717 .SetSample(sample); 717 .SetSample(sample);
718 return; 718 return;
719 } 719 }
867 call.GetDocumentation() 867 call.GetDocumentation()
868 .SetTag("Jobs") 868 .SetTag("Jobs")
869 .SetSummary(verb + " job") 869 .SetSummary(verb + " job")
870 .SetDescription(verb + " the job whose identifier is provided in the URL. Check out the " 870 .SetDescription(verb + " the job whose identifier is provided in the URL. Check out the "
871 "Orthanc Book for more information about the state machine applicable to jobs: " 871 "Orthanc Book for more information about the state machine applicable to jobs: "
872 "https://book.orthanc-server.com/users/advanced-rest.html#jobs") 872 "https://orthanc.uclouvain.be/book/users/advanced-rest.html#jobs")
873 .SetUriArgument("id", "Identifier of the job of interest") 873 .SetUriArgument("id", "Identifier of the job of interest")
874 .AddAnswerType(MimeType_Json, "Empty JSON object in the case of a success"); 874 .AddAnswerType(MimeType_Json, "Empty JSON object in the case of a success");
875 return; 875 return;
876 } 876 }
877 877
914 { 914 {
915 call.GetDocumentation() 915 call.GetDocumentation()
916 .SetTag("System") 916 .SetTag("System")
917 .SetSummary("Get usage metrics") 917 .SetSummary("Get usage metrics")
918 .SetDescription("Get usage metrics of Orthanc in the Prometheus file format (OpenMetrics): " 918 .SetDescription("Get usage metrics of Orthanc in the Prometheus file format (OpenMetrics): "
919 "https://book.orthanc-server.com/users/advanced-rest.html#instrumentation-with-prometheus") 919 "https://orthanc.uclouvain.be/book/users/advanced-rest.html#instrumentation-with-prometheus")
920 .SetHttpGetSample("https://demo.orthanc-server.com/tools/metrics-prometheus", false); 920 .SetHttpGetSample("https://orthanc.uclouvain.be/demo/tools/metrics-prometheus", false);
921 return; 921 return;
922 } 922 }
923 923
924 #if ORTHANC_ENABLE_PLUGINS == 1 924 #if ORTHANC_ENABLE_PLUGINS == 1
925 OrthancRestApi::GetContext(call).GetPlugins().RefreshMetrics(); 925 OrthancRestApi::GetContext(call).GetPlugins().RefreshMetrics();