pybind/mgr: add a Responder decorator type
The Responder is the decorator that future endpoint functions in the mgr can
use to automatically handle conversions of returned types to serilaized
data (JSON, YAML, etc) as well as automatically convert exceptions into
error responses.
The Responder makes use of format and return-value adapter types,
previously added to the module, to convert a returned value into a mgr
response. This change adds some exception types to return error
responses to the clients.
Simple customizations can be done by passing an alternate format adapter
type when the Responder is being constructed. Additional customization
can be done by subclassing the Responder.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit
6e234b190841204d076e1b622db543674d0c4b57)