comparison Sphinx/source/users/advanced-rest.rst @ 735:e6386c012438 Orthanc-1.9.5

Orthanc 1.9.5
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 08 Jul 2021 11:34:06 +0200
parents 8a247c645ac6
children 97e6a0431c5e
comparison
equal deleted inserted replaced
734:ec7b42de3f6f 735:e6386c012438
130 * ``Success``: The job has finished with success. 130 * ``Success``: The job has finished with success.
131 * ``Failure``: The job has finished with failure. Check out the 131 * ``Failure``: The job has finished with failure. Check out the
132 ``ErrorCode`` and ``ErrorDescription`` fields for more information. 132 ``ErrorCode`` and ``ErrorDescription`` fields for more information.
133 * ``Paused``: The job has been paused. 133 * ``Paused``: The job has been paused.
134 * ``Retry``: The job has failed internally, and has been scheduled for 134 * ``Retry``: The job has failed internally, and has been scheduled for
135 re-submission after a delay. As of Orthanc 1.9.4, this feature is not 135 re-submission after a delay. As of Orthanc 1.9.5, this feature is not
136 used by any type of job. 136 used by any type of job.
137 137
138 In order to wait for the end of an asynchronous call, the caller will 138 In order to wait for the end of an asynchronous call, the caller will
139 typically have to poll the ``/jobs/...` URI (i.e. make periodic 139 typically have to poll the ``/jobs/...` URI (i.e. make periodic
140 calls), waiting for the ``State`` field to become ``Success`` or 140 calls), waiting for the ``State`` field to become ``Success`` or
141 ``Failure``. 141 ``Failure``.
142 142
143 Note that the `integration tests of Orthanc 143 Note that the `integration tests of Orthanc
144 <https://hg.orthanc-server.com/orthanc-tests/file/Orthanc-1.9.4/Tests/Toolbox.py>`__ 144 <https://hg.orthanc-server.com/orthanc-tests/file/Orthanc-1.9.5/Tests/Toolbox.py>`__
145 give an example about how to monitor a job in Python using the REST 145 give an example about how to monitor a job in Python using the REST
146 API (cf. function ``MonitorJob()``). 146 API (cf. function ``MonitorJob()``).
147 147
148 148
149 .. _jobs-controlling: 149 .. _jobs-controlling:
200 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip 200 $ curl http://localhost:8042/jobs/82cc02d1-03fe-41f9-be46-a308d16ea94a/archive > a.zip
201 201
202 Note how we retrieve the content of the archive by accessing the 202 Note how we retrieve the content of the archive by accessing the
203 ``archive`` output of the job (check out the virtual method 203 ``archive`` output of the job (check out the virtual method
204 ``IJob::GetOutput()`` from the `source code 204 ``IJob::GetOutput()`` from the `source code
205 <https://hg.orthanc-server.com/orthanc/file/Orthanc-1.9.4/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__ 205 <https://hg.orthanc-server.com/orthanc/file/Orthanc-1.9.5/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp>`__
206 of Orthanc). 206 of Orthanc).
207 207
208 Here is the corresponding sequence of commands to generate a DICOMDIR 208 Here is the corresponding sequence of commands to generate a DICOMDIR
209 media:: 209 media::
210 210
211 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}' 211 $ curl http://localhost:8042/studies/27f7126f-4f66fb14-03f4081b-f9341db2-53925988/media -d '{"Asynchronous":true}'
212 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip 212 $ curl http://localhost:8042/jobs/6332be8a-0052-44fb-8cc2-ac959aeccad9/archive > a.zip
213 213
214 As of Orthanc 1.9.4, only the creation of a ZIP or a DICOMDIR archive 214 As of Orthanc 1.9.5, only the creation of a ZIP or a DICOMDIR archive
215 produces such "outputs". 215 produces such "outputs".
216 216
217 217
218 .. _pdf: 218 .. _pdf:
219 219