Dictionary::Ptr ApiActions::RemoveAllDowntimes(const ConfigObject::Ptr& object, const Dictionary::Ptr& params) { Checkable::Ptr checkable = static_pointer_cast<Checkable>(object); if (!checkable) return ApiActions::CreateResult(404, "Cannot remove downtime for non-existent object."); checkable->RemoveAllDowntimes(); return ApiActions::CreateResult(200, "Successfully removed downtimes for object '" + checkable->GetName() + "'."); }