Mercurial > hg > orthanc-book
comparison Sphinx/source/users/advanced-rest.rst @ 839:c29ac12e3160
Orthanc-1.11.0
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 09 May 2022 13:11:36 +0200 |
parents | 24a2ce71a161 |
children | 5ba44d8db9bc |
comparison
equal
deleted
inserted
replaced
838:6afc236cd60a | 839:c29ac12e3160 |
---|---|
128 * ``Success``: The job has finished with success. | 128 * ``Success``: The job has finished with success. |
129 * ``Failure``: The job has finished with failure. Check out the | 129 * ``Failure``: The job has finished with failure. Check out the |
130 ``ErrorCode`` and ``ErrorDescription`` fields for more information. | 130 ``ErrorCode`` and ``ErrorDescription`` fields for more information. |
131 * ``Paused``: The job has been paused. | 131 * ``Paused``: The job has been paused. |
132 * ``Retry``: The job has failed internally, and has been scheduled for | 132 * ``Retry``: The job has failed internally, and has been scheduled for |
133 re-submission after a delay. As of Orthanc 1.10.1, this feature is not | 133 re-submission after a delay. As of Orthanc 1.11.0, this feature is not |
134 used by any type of job. | 134 used by any type of job. |
135 | 135 |
136 In order to wait for the end of an asynchronous call, the caller will | 136 In order to wait for the end of an asynchronous call, the caller will |
137 typically have to poll the ``/jobs/...` URI (i.e. make periodic | 137 typically have to poll the ``/jobs/...` URI (i.e. make periodic |
138 calls), waiting for the ``State`` field to become ``Success`` or | 138 calls), waiting for the ``State`` field to become ``Success`` or |
139 ``Failure``. | 139 ``Failure``. |
140 | 140 |
141 Note that the `integration tests of Orthanc | 141 Note that the `integration tests of Orthanc |
142 <https://hg.orthanc-server.com/orthanc-tests/file/Orthanc-1.10.1/Tests/Toolbox.py>`__ | 142 <https://hg.orthanc-server.com/orthanc-tests/file/Orthanc-1.11.0/Tests/Toolbox.py>`__ |
143 give an example about how to monitor a job in Python using the REST | 143 give an example about how to monitor a job in Python using the REST |
144 API (cf. function ``MonitorJob()``). | 144 API (cf. function ``MonitorJob()``). |
145 | 145 |
146 | 146 |
147 .. _jobs-priority: | 147 .. _jobs-priority: |
210 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip | 210 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip |
211 | 211 |
212 Note how we retrieve the content of the archive by accessing the | 212 Note how we retrieve the content of the archive by accessing the |
213 ``archive`` output of the job (check out the virtual method | 213 ``archive`` output of the job (check out the virtual method |
214 ``IJob::GetOutput()`` from the `source code | 214 ``IJob::GetOutput()`` from the `source code |
215 <https://hg.orthanc-server.com/orthanc/file/Orthanc-1.10.1/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__ | 215 <https://hg.orthanc-server.com/orthanc/file/Orthanc-1.11.0/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__ |
216 of Orthanc). | 216 of Orthanc). |
217 | 217 |
218 Here is the corresponding sequence of commands to generate a DICOMDIR | 218 Here is the corresponding sequence of commands to generate a DICOMDIR |
219 media:: | 219 media:: |
220 | 220 |
221 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}' | 221 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}' |
222 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip | 222 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip |
223 | 223 |
224 As of Orthanc 1.10.1, only the creation of a ZIP or a DICOMDIR archive | 224 As of Orthanc 1.11.0, only the creation of a ZIP or a DICOMDIR archive |
225 produces such "outputs". | 225 produces such "outputs". |
226 | 226 |
227 | 227 |
228 .. _pdf: | 228 .. _pdf: |
229 | 229 |