openmainframeproject / feilong

Feilong is a open source z/VM cloud connector project under the Open Mainframe Project umbrella that will accelerate the z/VM adoption, extending its ecosystem and its user experience. It provides a set of APIs to operate z/VM including guest, image, network, volume etc.
https://www.openmainframeproject.org/projects/feilong
Apache License 2.0
36 stars 70 forks source link

SMAPI health #813

Closed Bischoff closed 8 months ago

Bischoff commented 8 months ago

This PR adds the missing fields to the output of "Report health of SMAPI" (see issue #774).

It preserves ascending compatibility by introducing a new API call with a slightly different URL: GET /smapi_health instead of GET /smapi-healthy. The old call still exists with the old behaviour, but is documented as "deprecated".

Before

{
    "SMAPI": {
        "totalSuccess": 0,
        "totalFail": 0,
        "lastSuccess": "",
        "lastFail": "",
        "continuousFail": 0,
        "healthy": True
    }
}

After

{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": {
        "totalSuccess": 0,
        "totalFail": 0,
        "lastSuccess": "",
        "lastFail": "",
        "continuousFail": 0,
        "healthy": True
    }
}