Endian banner

endian.job.status package

Module contents

get_jobs(**params)

Returns the status of the jobs

Returns:a dict with a ‘jobs’ item - the key is the job name, the value is the job status
Return type:dict

Each job status has the following keys:

name - job’s name status - start, stop sub - ok, err schedule - waiting, waiting_depends, executing t0 - start time of the last action t1 - end time of the last action

If the job is in the executing state, the following optional keys are present:

running_action - name of the running action pid - job’s pid

Example:

{
    "jobs": {
        "snort": {
            "status": "stop",
            "sub": "ok",
            "schedule": "waiting",
            "t0": 0.0,
            "t1": 0.0,
            "name": "snort"
         },
         "ssh": {
             "status": "start",
             "sub": "ok",
             "schedule": "waiting",
             "t0": 1304060114.73,
             "t1": 1304060124.97,
             "name": "ssh"}
}
get_messages(**params)

Returns the last jobsengine messages

Example:

{
    "messages": [
        {"sub": "ok", "timestamp": 1306938591.55, "startup_percentage": "33%", "forked_counter": 6, "msg": "ULOGD-I-Start", "job": "ulogd", "err_counter": 0, "action": "start", "ok_counter": 17}, 
        {"sub": "ok", "timestamp": 1306938591.79, "startup_percentage": "35%", "forked_counter": 6, "msg": "INSTALLIFMISSING-I-Start", "job": "installifmissing", "err_counter": 0, "action": "start", "ok_counter": 18},
        {"sub": "ok", "timestamp": 1306938592.32, "startup_percentage": "37%", "forked_counter": 7, "msg": "LOGROTATE-I-Start", "job": "logrotate", "err_counter": 0, "action": "start", "ok_counter": 19}
     ]
     "time": 1306939315
 }
get_updates(**params)

Returns the last job updates messages

param timeout:timeout (in seconds) before a message expires (default: 30s)
type timeout:float
return:a dict with a ‘updates’ item - a sorted list of job updates
rtype:dict

Each update messages has the following keys:

name - job’s name status - start, stop, executing, waiting_depends time - timestamp of the message msg - textual message

Example:

{ 
    "updates": [
            {"status": "start", "msg": "Job startup_done started", "name": "startup_done", "time": 1304078937.9},
            {"status": "start", "msg": "Job firewall started", "name": "firewall", "time": 1304078932.5},
            {"status": "start", "msg": "Job ipac started", "name": "ipac", "time": 1304078932.2},
            {"status": "start", "msg": "Job collectd started", "name": "collectd", "time": 1304790429.9},
    ],
    "time" : 1304078940
}
init(root=None)

Table Of Contents

Previous topic

endian.job.start package

Next topic

endian.job.test package