2022-10-19 18:18:52 +03:00
|
|
|
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"></span><span class="comment"># Create a new job</span>
|
|
|
|
<span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/jobs</span></span>
|
|
|
|
</span><span class="response"><span class="line"></span>
|
2022-11-11 16:25:00 +03:00
|
|
|
<span class="line"><span class="version">HTTP</span> <span class="number">201</span></span>
|
2023-04-11 18:28:28 +03:00
|
|
|
<span class="line"><span class="section-header">[Captures]</span></span>
|
2023-04-17 14:05:34 +03:00
|
|
|
<span class="line"><span class="name">job_id</span>: <span class="query-type">jsonpath</span> <span class="string">"$.id"</span></span>
|
2023-04-11 18:28:28 +03:00
|
|
|
<span class="line"><span class="section-header">[Asserts]</span></span>
|
2022-10-19 18:18:52 +03:00
|
|
|
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.state"</span> <span class="predicate-type">==</span> <span class="string">"RUNNING"</span></span>
|
|
|
|
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
|
|
|
<span class="line"></span>
|
|
|
|
<span class="line"></span><span class="comment"># Pull job status until it is completed</span>
|
|
|
|
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/jobs/{{job_id}}</span></span>
|
2023-04-11 18:28:28 +03:00
|
|
|
<span class="line"><span class="section-header">[Options]</span></span>
|
2023-05-26 16:53:53 +03:00
|
|
|
<span class="line"><span class="string">retry</span>: <span class="number">10</span></span>
|
2023-04-17 14:05:34 +03:00
|
|
|
<span class="line"><span class="string">retry-interval</span>: <span class="number">100</span></span>
|
2022-10-19 18:18:52 +03:00
|
|
|
</span><span class="response"><span class="line"></span>
|
2022-11-11 16:25:00 +03:00
|
|
|
<span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
2023-04-11 18:28:28 +03:00
|
|
|
<span class="line"><span class="section-header">[Asserts]</span></span>
|
2022-10-19 18:18:52 +03:00
|
|
|
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.state"</span> <span class="predicate-type">==</span> <span class="string">"COMPLETED"</span></span>
|
|
|
|
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
|
|
|
<span class="line"></span>
|
|
|
|
<span class="line"></span><span class="comment"># Delete the job</span>
|
|
|
|
<span class="line"><span class="method">DELETE</span> <span class="url">http://localhost:8000/jobs/{{job_id}}</span></span>
|
2022-11-11 16:25:00 +03:00
|
|
|
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
|
2022-10-19 18:18:52 +03:00
|
|
|
</span></span><span class="hurl-entry"><span class="request"><span class="line"></span>
|
|
|
|
<span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/jobs/{{job_id}}</span></span>
|
2022-11-11 16:25:00 +03:00
|
|
|
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">404</span></span>
|
2022-10-24 12:37:11 +03:00
|
|
|
</span></span></code></pre>
|