-
Notifications
You must be signed in to change notification settings - Fork 33
pman command: reference
Rudolph Pienaar edited this page Mar 21, 2017
·
17 revisions
This page provides a simple set of copy/paste friendly commands for all the pman
commands.
- 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 --rawmode 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
}
}
Start the purl
command with
purl --verb POST --raw --http 172.17.0.2:5010/api/v1/cmd --jsonwrapper 'payload' --msg \
simple copy/paste the above line into a terminal. Do not press enter!
Now, copy paste one of the following into the same line (and press enter!)
'{ "action": "get",
"meta": {
"path": "/"
}
}
' --quiet --jsonpprintindent 4
'{ "action": "run",
"meta": {
"cmd": "cal 7 1970",
"auid": "rudolphpienaar",
"jid": "cal-job-1234",
"threaded": true
}
}'
'{ "action": "search",
"meta": {
"key": "jid",
"value": "cal-job-1234",
"job": "0",
"when": "end",
"field": "stdout"
}
}' --quiet --jsonpprintindent 4
'{ "action": "status",
"meta": {
"key": "jid",
"value": "cal-job-1234"
}
}' --quiet --jsonpprintindent 4
'{ "action": "done",
"meta": {
"key": "jid",
"value": "cal-job-1234"
}
}' --quiet --jsonpprintindent 4
'{ "action": "info",
"meta": {
"key": "jid",
"value": "cal-job-1234",
"path": "/"
}
}' --quiet --jsonpprintindent 4
'{ "action": "quit",
"meta": {
"when": "now",
"saveDB": true
}
}' --quiet --jsonpprintindent 4
Compound statements are a string of statements executed in series, joined via ;
. In the context of pman
the entire compound statement is considered a single entity; however the status of individual components is captured and returned in the end.returncode
.
'{ "action": "run",
"meta": {
"cmd": "cal 7 1970; sleep 10; cal 7 2070",
"auid": "rudolphpienaar",
"jid": "compound-cal",
"threaded": true
}
}' --quiet --jsonpprintindent 4
'{ "action": "status",
"meta": {
"key": "jid",
"value": "compound-cal"
}
}' --quiet --jsonpprintindent 4
'{ "action": "run",
"meta": {
"cmd": "cal 7 1970; ls /home ; sleep 10 ; ls /tmpp; sleep 5; cal 7 2070",
"auid": "rudolphpienaar",
"jid": "compound-cal2",
"threaded": true
}
}' --quiet --jsonpprintindent 4
'{ "action": "status",
"meta": {
"key": "jid",
"value": "compound-cal2"
}
}' --quiet --jsonpprintindent 4
'{ "action": "run",
"meta": {
"cmd": "cal 7 1970 && ls /home && sleep 10 && ls /tmpp && sleep 5; cal 7 2070",
"auid": "rudolphpienaar",
"jid": "compound-cal3",
"threaded": true
}
}' --quiet --jsonpprintindent 4
'{ "action": "status",
"meta": {
"key": "jid",
"value": "compound-cal3"
}
}' --quiet --jsonpprintindent 4
--30--