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);
}
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));
}
Aggregations