use of org.opennms.netmgt.model.minion.OnmsMinion in project opennms by OpenNMS.
the class MinionRestService method delete.
@DELETE
@Path("{id}")
@Override
public Response delete(@PathParam("id") final String id) {
final OnmsMinion minion = getDao().get(id);
final String location = minion.getLocation();
Response response = super.delete(id);
final EventBuilder eventBuilder = new EventBuilder(EventConstants.MONITORING_SYSTEM_DELETED_UEI, "OpenNMS.WebUI");
eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_TYPE, OnmsMonitoringSystem.TYPE_MINION);
eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_ID, id);
eventBuilder.addParam(EventConstants.PARAM_MONITORING_SYSTEM_LOCATION, location);
try {
m_eventProxy.send(eventBuilder.getEvent());
} catch (final EventProxyException e) {
LOG.warn(" Failed to send Event on Minion deletion " + e.getMessage(), e);
}
return response;
}
Aggregations