use of com.emc.storageos.model.event.EventDetailsRestRep in project coprhd-controller by CoprHD.
the class EventService method eventDetails.
/**
* Event approval/decline details
*
* @param id
* @brief Show approve/decline details for an event
* @return
* @throws DatabaseException
*/
@GET
@Path("/{id}/details")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public EventDetailsRestRep eventDetails(@PathParam("id") URI id) throws DatabaseException {
ActionableEvent event = queryObject(ActionableEvent.class, id, false);
verifyAuthorizedInTenantOrg(event.getTenant(), getUserFromContext());
EventDetailsRestRep eventDetails = new EventDetailsRestRep();
eventDetails.setApproveDetails(getEventDetails(event, true));
eventDetails.setDeclineDetails(getEventDetails(event, false));
return eventDetails;
}
use of com.emc.storageos.model.event.EventDetailsRestRep in project coprhd-controller by CoprHD.
the class Events method details.
public static void details(String eventId) {
if (StringUtils.isBlank(eventId)) {
listAll();
}
EventRestRep event = EventUtils.getEvent(uri(eventId));
if (event == null) {
flash.error(MessagesUtils.get(UNKNOWN, eventId));
listAll();
}
Common.angularRenderArgs().put("event", getEventSummary(event));
List<String> approveDetails = Lists.newArrayList();
List<String> declineDetails = Lists.newArrayList();
if (event.getEventStatus().equalsIgnoreCase(ActionableEvent.Status.pending.name().toString()) || event.getEventStatus().equalsIgnoreCase(ActionableEvent.Status.failed.name().toString())) {
EventDetailsRestRep details = getViprClient().events().getDetails(uri(eventId));
approveDetails = details.getApproveDetails();
declineDetails = details.getDeclineDetails();
} else {
approveDetails = event.getApproveDetails();
declineDetails = event.getDeclineDetails();
}
Common.angularRenderArgs().put("approveDetails", approveDetails);
Common.angularRenderArgs().put("declineDetails", declineDetails);
List<TaskResourceRep> tasks = Lists.newArrayList();
if (event != null && event.getTaskIds() != null) {
tasks = getViprClient().tasks().getByRefs(event.getTaskIds());
}
render(event, approveDetails, declineDetails, tasks);
}
use of com.emc.storageos.model.event.EventDetailsRestRep in project coprhd-controller by CoprHD.
the class Events method itemDetails.
public static void itemDetails(String id) {
EventRestRep event = getViprClient().events().get(uri(id));
List<String> approveDetails = Lists.newArrayList();
List<String> declineDetails = Lists.newArrayList();
if (event.getEventStatus().equalsIgnoreCase(ActionableEvent.Status.pending.name().toString()) || event.getEventStatus().equalsIgnoreCase(ActionableEvent.Status.failed.name().toString())) {
EventDetailsRestRep details = getViprClient().events().getDetails(uri(id));
approveDetails = details.getApproveDetails();
declineDetails = details.getDeclineDetails();
} else {
approveDetails = event.getApproveDetails();
declineDetails = event.getDeclineDetails();
}
List<TaskResourceRep> tasks = Lists.newArrayList();
if (event != null && event.getTaskIds() != null) {
tasks = getViprClient().tasks().getByRefs(event.getTaskIds());
}
render(approveDetails, declineDetails, event, tasks);
}
Aggregations