245
|
1 set -ex
|
|
2
|
|
3 CURL="curl -s -u alice:orthanctest"
|
|
4
|
|
5 # CARDIAC
|
|
6 job=`${CURL} http://localhost:8042/dicom-web/servers/sample/stow -d '{"Resources":["6e2c0ec2-5d99c8ca-c1c21cee-79a09605-68391d12"],"Synchronous":false,"Debug":true}' | jq -r .ID`
|
|
7
|
|
8 sleep 1
|
|
9
|
|
10 ${CURL} http://localhost:8042/jobs/${job} | jq .
|
|
11 ${CURL} http://localhost:8042/jobs/${job}/cancel -d '{}'
|
|
12
|
|
13 sleep 1
|
|
14
|
|
15 ${CURL} http://localhost:8042/jobs/${job} | jq .
|
|
16
|
|
17 sleep 2
|
|
18
|
|
19 ${CURL} http://localhost:8042/jobs/${job}/resubmit -d '{}'
|
|
20 sleep 1
|
|
21
|
|
22 set +x
|
|
23
|
|
24 while true
|
|
25 do
|
|
26 info=`${CURL} http://localhost:8042/jobs/${job}`
|
|
27 state=`echo $info | jq -r .State`
|
|
28
|
|
29 echo $info | jq .
|
|
30 echo $state
|
|
31 if [ $state != "Running" ]; then
|
|
32 break
|
|
33 else
|
|
34 sleep 1
|
|
35 fi
|
|
36 done
|
|
37
|