def show(self, req, id): """Return data about the given mon.""" context = req.environ['vsm.context'] try: mon = db.monitor_get(context, id) error = self.conductor_api.ceph_error(context) if error: mon['health'] = error except exception.NotFound: raise exc.HTTPNotFound() return self._view_builder.show(context, mon)
def delete(self, req, id): """delete a mon in db.""" context = req.environ['vsm.context'] mon = db.monitor_get(context, id) db.monitor_destroy(context, mon.get('name'))