use of com.emc.vipr.model.catalog.ExecutionWindowUpdateParam in project coprhd-controller by CoprHD.
the class ExecutionWindowsApi method update.
public static void update(String executionWindowId, ExecutionWindowInfo info) {
ExecutionWindowRestRep window = ExecutionWindowUtils.getExecutionWindow(uri(executionWindowId));
if (window != null) {
copyExecutionWindowInfoToExecutionWindow(info, window);
window.setId(URI.create(executionWindowId));
createForm(window).validate("executionWindowForm");
if (validation.hasErrors()) {
response.status = HttpStatus.SC_BAD_REQUEST;
ValidationError validationError = null;
renderApi(getValidationErrors());
} else {
ExecutionWindowUpdateParam updateParam = new ExecutionWindowUpdateParam();
map(updateParam, info);
ExecutionWindowUtils.updateExecutionWindow(uri(executionWindowId), updateParam);
info.setId(window.getId().toString());
renderApi(info);
}
} else {
notFound(Messages.get("ExecutionWindowsApi.windowWithId", executionWindowId));
}
}
Aggregations