Search in sources :

Example 1 with EventDetailsRestRep

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;
}
Also used : EventDetailsRestRep(com.emc.storageos.model.event.EventDetailsRestRep) ActionableEvent(com.emc.storageos.db.client.model.ActionableEvent) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with EventDetailsRestRep

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);
}
Also used : EventDetailsRestRep(com.emc.storageos.model.event.EventDetailsRestRep) EventRestRep(com.emc.storageos.model.event.EventRestRep) TaskResourceRep(com.emc.storageos.model.TaskResourceRep)

Example 3 with EventDetailsRestRep

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);
}
Also used : EventDetailsRestRep(com.emc.storageos.model.event.EventDetailsRestRep) EventRestRep(com.emc.storageos.model.event.EventRestRep) TaskResourceRep(com.emc.storageos.model.TaskResourceRep)

Aggregations

EventDetailsRestRep (com.emc.storageos.model.event.EventDetailsRestRep)3 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)2 EventRestRep (com.emc.storageos.model.event.EventRestRep)2 ActionableEvent (com.emc.storageos.db.client.model.ActionableEvent)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1