Skip to content

pman command: info

Rudolph Pienaar edited this page Mar 21, 2017 · 8 revisions

pman command: info

Abstract

This page describes the info command to pman. It is used to return the contents of the startInfo and endInfo fields of the underlying crunner process.

Preconditions

  • 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
        }
}

msg summary

The msg payload of the REST interaction with pman is:

{  "action": "info",
        "meta": {
                "key":          "jid",
                "value":        "cal-job-1234",
                "path":         "/"
        }
}

info

purl prefix

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!

msg suffix

Assuming satisfied preconditions, let's search for the info information about a process. For example, let's ask for the info of the app with jid of cal-job-1234:

Append (copy/paste) the following to the purl prefix command above and hit enter:

'{  "action": "info",
        "meta": {
                "key":          "jid",
                "value":        "cal-job-1234",
                "path":         "/"
        }
}' --quiet --jsonpprintindent 4  

return payload

The above call returns the JSON string:

{
    "action": "info",
    "d_ret": {
        "0.1": {
            "20170303164938.122651_6e09943c-6fc0-45c8-b088-2394e5886b69": {
                "endInfo": {
                    "allJobsDone": true
                }
            }
        },
        "0.0": {
            "20170303164938.122651_6e09943c-6fc0-45c8-b088-2394e5886b69": {
                "startInfo": {
                    "allJobsStarted": true
                }
            }
        }
    },
    "path": "/api/v1/cmd",
    "RESTverb": "POST",
    "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: 93\r",
        "\r",
        "{\"payload\": {\"action\": \"info\", \"meta\": {\"key\": \"jid\", \"value\": \"cal-job-1234\", \"path\": \"/\"}}}"
    ],
    "status": true,
    "RESTheader": "POST /api/v1/cmd HTTP/1.1\r",
    "meta": {
        "key": "jid",
        "value": "cal-job-1234",
        "path": "/"
    },
    "payloadsize": 93
}

with the endInfo and startInfo values as shown.

--30--

Clone this wiki locally