/** * Remove service downtimes */ public function removeServiceDowntimeAction() { $filter = $this->getFilterOrExitIfEmpty(); $downtimes = $this->backend->select()->from('downtime', array('host_name', 'service_description', 'id' => 'downtime_internal_id', 'name' => 'downtime_name'))->where('object_type', 'service')->applyFilter($this->getRestriction('monitoring/filter/objects'))->applyFilter($filter); if (!$downtimes->count()) { $this->getResponse()->json()->setFailData(array('filter' => 'No downtimes found matching the filter'))->sendResponse(); } $form = new DeleteDowntimesCommandForm(); $form->setIsApiTarget(true)->setDowntimes($downtimes->fetchAll())->handleRequest($this->getRequest()); // @TODO(el): Respond w/ the downtimes deleted instead of the notifiaction added by // DeleteDowntimesCommandForm::onSuccess(). }