Results

ActionResult

class slaveapi.actions.results.ActionResult(slave, action, state=0, request_timestamp=0, start_timestamp=0, finish_timestamp=0)

Contains basic information about the result of a specific Action.

to_dict(include_requestid=False)

Returns the state and text of this ActionResult in a dict. If include_requestid is True, “requestid” will also be present. Example:

{
    "state": 2,
    "text": "Great success!",
    "request_timestamp": 1392414314,
    "start_timestamp": 1392414315,
    "finish_timestamp": 1392414316,
    "requestid": "234567832"
}

dictify_results

results.dictify_results(results)

Returns a dict of ActionResults broken down by slave, action, and requestid. Specific results are processed by slaveapi.actions.results.ActionResults.to_dict(). Example:

{
    "linux-ix-slave04": {
        "reboot": {
            "1235543252": {
                "state": 2,
                "text": "Great success!",
                "request_timestamp": 1392414314,
                "start_timestamp": 1392414315,
                "finish_timestamp": 1392414316
            }
        }
    },
    "w64-ix-slave05": {
        "reboot": {
            "5748263211": {
                "state": 3,
                "text": "Failure :(",
                "request_timestamp": 1392414317,
                "start_timestamp": 1392414318,
                "finish_timestamp": 1392414319
            }
        }
    }
}