Mercurial > hg > orthanc-book
comparison Sphinx/source/users/advanced-rest.rst @ 1000:2e103fb1fa11
Orthanc 1.12.2
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 19 Dec 2023 17:54:15 +0100 |
parents | 1316bc62b5d5 |
children | a3436ae3709c |
comparison
equal
deleted
inserted
replaced
998:bd7fbe3042f7 | 1000:2e103fb1fa11 |
---|---|
87 | 87 |
88 When generating archives asynchronously, you should take care of | 88 When generating archives asynchronously, you should take care of |
89 the ``MediaArchiveSize`` configuration that defines the maximum | 89 the ``MediaArchiveSize`` configuration that defines the maximum |
90 number of ZIP/media archives that are maintained by Orthanc, as a | 90 number of ZIP/media archives that are maintained by Orthanc, as a |
91 response to the asynchronous creation of archive. As of Orthanc | 91 response to the asynchronous creation of archive. As of Orthanc |
92 1.12.1, this value is ``1`` by default. | 92 1.12.2, this value is ``1`` by default. |
93 | 93 |
94 .. _jobs-monitoring: | 94 .. _jobs-monitoring: |
95 | 95 |
96 Monitoring jobs | 96 Monitoring jobs |
97 ^^^^^^^^^^^^^^^ | 97 ^^^^^^^^^^^^^^^ |
137 * ``Success``: The job has finished with success. | 137 * ``Success``: The job has finished with success. |
138 * ``Failure``: The job has finished with failure. Check out the | 138 * ``Failure``: The job has finished with failure. Check out the |
139 ``ErrorCode`` and ``ErrorDescription`` fields for more information. | 139 ``ErrorCode`` and ``ErrorDescription`` fields for more information. |
140 * ``Paused``: The job has been paused. | 140 * ``Paused``: The job has been paused. |
141 * ``Retry``: The job has failed internally, and has been scheduled for | 141 * ``Retry``: The job has failed internally, and has been scheduled for |
142 re-submission after a delay. As of Orthanc 1.12.1, this feature is not | 142 re-submission after a delay. As of Orthanc 1.12.2, this feature is not |
143 used by any type of job. | 143 used by any type of job. |
144 | 144 |
145 In order to wait for the end of an asynchronous call, the caller will | 145 In order to wait for the end of an asynchronous call, the caller will |
146 typically have to poll the ``/jobs/...`` URI (i.e. make periodic | 146 typically have to poll the ``/jobs/...`` URI (i.e. make periodic |
147 calls), waiting for the ``State`` field to become ``Success`` or | 147 calls), waiting for the ``State`` field to become ``Success`` or |
148 ``Failure``. | 148 ``Failure``. |
149 | 149 |
150 Note that the `integration tests of Orthanc | 150 Note that the `integration tests of Orthanc |
151 <https://orthanc.uclouvain.be/hg/orthanc-tests/file/Orthanc-1.12.1/Tests/Toolbox.py>`__ | 151 <https://orthanc.uclouvain.be/hg/orthanc-tests/file/Orthanc-1.12.2/Tests/Toolbox.py>`__ |
152 give an example about how to monitor a job in Python using the REST | 152 give an example about how to monitor a job in Python using the REST |
153 API (cf. function ``MonitorJob()``). | 153 API (cf. function ``MonitorJob()``). |
154 | 154 |
155 | 155 |
156 .. _jobs-priority: | 156 .. _jobs-priority: |
219 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip | 219 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip |
220 | 220 |
221 Note how we retrieve the content of the archive by accessing the | 221 Note how we retrieve the content of the archive by accessing the |
222 ``archive`` output of the job (check out the virtual method | 222 ``archive`` output of the job (check out the virtual method |
223 ``IJob::GetOutput()`` from the `source code | 223 ``IJob::GetOutput()`` from the `source code |
224 <https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.1/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__ | 224 <https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.2/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__ |
225 of Orthanc). | 225 of Orthanc). |
226 | 226 |
227 Here is the corresponding sequence of commands to generate a DICOMDIR | 227 Here is the corresponding sequence of commands to generate a DICOMDIR |
228 media:: | 228 media:: |
229 | 229 |
230 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}' | 230 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}' |
231 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip | 231 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip |
232 | 232 |
233 As of Orthanc 1.12.1, only the creation of a ZIP or a DICOMDIR archive | 233 As of Orthanc 1.12.2, only the creation of a ZIP or a DICOMDIR archive |
234 produces such "outputs". | 234 produces such "outputs". |
235 | 235 |
236 | 236 |
237 .. _pdf: | 237 .. _pdf: |
238 | 238 |