comparison Sphinx/source/users/advanced-rest.rst @ 678:17c1ff4e6ae4 Orthanc-1.9.3

Orthanc 1.9.3
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 May 2021 12:25:36 +0200
parents 8bda16db46cf
children 650100457193
comparison
equal deleted inserted replaced
677:25e44dba9dba 678:17c1ff4e6ae4
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.9.2, this feature is not 133 re-submission after a delay. As of Orthanc 1.9.3, 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.9.2/Tests/Toolbox.py>`__ 142 <https://hg.orthanc-server.com/orthanc-tests/file/Orthanc-1.9.3/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-controlling: 147 .. _jobs-controlling:
198 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip 198 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip
199 199
200 Note how we retrieve the content of the archive by accessing the 200 Note how we retrieve the content of the archive by accessing the
201 ``archive`` output of the job (check out the virtual method 201 ``archive`` output of the job (check out the virtual method
202 ``IJob::GetOutput()`` from the `source code 202 ``IJob::GetOutput()`` from the `source code
203 <https://hg.orthanc-server.com/orthanc/file/Orthanc-1.9.2/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__ 203 <https://hg.orthanc-server.com/orthanc/file/Orthanc-1.9.3/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__
204 of Orthanc). 204 of Orthanc).
205 205
206 Here is the corresponding sequence of commands to generate a DICOMDIR 206 Here is the corresponding sequence of commands to generate a DICOMDIR
207 media:: 207 media::
208 208
209 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}' 209 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}'
210 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip 210 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip
211 211
212 As of Orthanc 1.9.2, only the creation of a ZIP or a DICOMDIR archive 212 As of Orthanc 1.9.3, only the creation of a ZIP or a DICOMDIR archive
213 produces such "outputs". 213 produces such "outputs".
214 214
215 215
216 .. _pdf: 216 .. _pdf:
217 217