use of com.thinkbiganalytics.kylo.catalog.CatalogException in project kylo by Teradata.
the class DataSetController method createDataSet.
@POST
@ApiOperation("Creates a new data set")
@ApiResponses({ @ApiResponse(code = 200, message = "Data set created", response = DataSet.class), @ApiResponse(code = 400, message = "Invalid data source", response = RestResponseStatus.class), @ApiResponse(code = 500, message = "Internal server error", response = RestResponseStatus.class) })
@Consumes(MediaType.APPLICATION_JSON)
public Response createDataSet(@Nonnull final DataSet source) {
log.entry(source);
final boolean encryptCredentials = true;
DataSet dataSet;
try {
dataSet = dataSetService.findOrCreateDataSet(source, encryptCredentials);
} catch (final CatalogException e) {
log.debug("Cannot create data set from request: {}", source, e);
throw new BadRequestException(getMessage(e));
}
return Response.ok(log.exit(dataSet)).build();
}
Aggregations