Search in sources :

Example 6 with EventRestRep

use of com.emc.storageos.model.event.EventRestRep 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)

Example 7 with EventRestRep

use of com.emc.storageos.model.event.EventRestRep in project coprhd-controller by CoprHD.

the class Events method listAllJson.

public static void listAllJson(Long lastUpdated) {
    ViPRCoreClient client = getViprClient();
    List<EventRestRep> eventResourceReps = client.events().getByRefs(client.events().listByTenant(uri(Models.currentAdminTenant())));
    Collections.sort(eventResourceReps, orderedEventComparator);
    List<EventsDataTable.Event> events = Lists.newArrayList();
    if (eventResourceReps != null) {
        for (EventRestRep eventRestRep : eventResourceReps) {
            EventsDataTable.Event event = new EventsDataTable.Event(eventRestRep);
            events.add(event);
        }
    }
    renderJSON(DataTablesSupport.createJSON(events, params));
}
Also used : EventsDataTable(models.datatable.EventsDataTable) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) EventRestRep(com.emc.storageos.model.event.EventRestRep) ActionableEvent(com.emc.storageos.db.client.model.ActionableEvent)

Aggregations

EventRestRep (com.emc.storageos.model.event.EventRestRep)7 ActionableEvent (com.emc.storageos.db.client.model.ActionableEvent)2 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)2 EventDetailsRestRep (com.emc.storageos.model.event.EventDetailsRestRep)2 EventsDataTable (models.datatable.EventsDataTable)2 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)1 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)1 ArrayList (java.util.ArrayList)1