-
Notifications
You must be signed in to change notification settings - Fork 33
pman command: status
Rudolph Pienaar edited this page Mar 8, 2017
·
12 revisions
This page describes the status
command to pman
. It is used to return a list field, l_status
, describing the end status of the job.
- This page assumes that
pman
is listening on:172.17.0.2:5010
. - Make sure that
pman
has been started (see here for more info):
pman --raw 1 --http --port 5010 --listeners 12
- This page assumes that a previous run has been managed with parameters
{ "action": "run",
"meta": {
"cmd": "cal 7 1970",
"auid": "rudolphpienaar",
"jid": "cal-job-1234",
"threaded": true
}
}
The msg
payload of the REST interaction with pman
is:
'{ "action": "status",
"meta": {
"key": "jid",
"value": "cal-job-1234"
}
}'
Assuming satisfied preconditions, let's search for the status information about a process. For example, let's ask for the status
of the app with jid
of cal-job-1234
:
purl --content-type application/vnd.collection+json \
--content-type application/vnd.collection+json \
--verb POST \
--raw \
--http 172.17.0.2:5010/api/v1/cmd \
--jsonwrapper 'payload' \
--msg \
'{ "action": "status",
"meta": {
"key": "jid",
"value": "cal-job-1234"
}
}' --quiet --jsonpprintindent 4
The above call returns the JSON string:
{
"RESTverb": "POST",
"d_ret": {
"0.start": {
"startTrigger": [
true
],
"jobRoot": "20170303164938.122651_6e09943c-6fc0-45c8-b088-2394e5886b69"
},
"l_status": [
"finishedSuccessfully"
],
"0.end": {
"jobRoot": "20170303164938.122651_6e09943c-6fc0-45c8-b088-2394e5886b69",
"returncode": [
0
]
}
},
"meta": {
"value": "cal-job-1234",
"key": "jid"
},
"RESTheader": "POST /api/v1/cmd HTTP/1.1\r",
"status": true,
"path": "/api/v1/cmd",
"receivedByServer": [
"POST /api/v1/cmd HTTP/1.1\r",
"Host: 172.17.0.2:5010\r",
"User-Agent: PycURL/7.43.0 libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3\r",
"Accept: */*\r",
"Content-type: application/vnd.collection+json\r",
"Content-Length: 82\r",
"\r",
"{\"payload\": {\"action\": \"status\", \"meta\": {\"value\": \"cal-job-1234\", \"key\": \"jid\"}}}"
],
"payloadsize": 82,
"action": "status"
}
with the end job status in l_status
.
This job probably had already finished by the time purl
had written the above to the terminal.
--30--