Mercurial > hg > orthanc-book
comparison Sphinx/source/users/advanced-rest.rst @ 933:a5e7e7001316 Orthanc-1.12.0
Orthanc 1.12.0
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 15 Apr 2023 10:44:42 +0200 |
parents | dfe96daba4f8 |
children | 0b89127439b1 |
comparison
equal
deleted
inserted
replaced
932:53bb4d4f8e56 | 933:a5e7e7001316 |
---|---|
86 too long. | 86 too long. |
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.11.3, this value is ``1`` by default ! | 92 1.12.0, 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.11.3, this feature is not | 142 re-submission after a delay. As of Orthanc 1.12.0, 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://hg.orthanc-server.com/orthanc-tests/file/Orthanc-1.11.3/Tests/Toolbox.py>`__ | 151 <https://hg.orthanc-server.com/orthanc-tests/file/Orthanc-1.12.0/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://hg.orthanc-server.com/orthanc/file/Orthanc-1.11.3/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__ | 224 <https://hg.orthanc-server.com/orthanc/file/Orthanc-1.12.0/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.11.3, only the creation of a ZIP or a DICOMDIR archive | 233 As of Orthanc 1.12.0, 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 |