Search in sources :

Example 1 with PreparationUpdate

use of org.talend.dataprep.command.preparation.PreparationUpdate in project data-prep by Talend.

the class PreparationAPI method updatePreparation.

@RequestMapping(value = "/api/preparations/{id}", method = PUT, consumes = APPLICATION_JSON_VALUE, produces = TEXT_PLAIN_VALUE)
@ApiOperation(value = "Update a preparation with content in body.", notes = "Returns the updated preparation id.")
@Timed
public String updatePreparation(@ApiParam(name = "id", value = "The id of the preparation to update.") @PathVariable("id") String id, @ApiParam(name = "body", value = "The updated preparation. Null values are ignored during update. You may set all values, service will override values you can't write to.") @RequestBody Preparation preparation) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("Updating preparation (pool: {} )...", getConnectionStats());
    }
    PreparationUpdate preparationUpdate = getCommand(PreparationUpdate.class, id, preparation);
    final String preparationId = preparationUpdate.execute();
    if (LOG.isDebugEnabled()) {
        LOG.debug("Updated preparation (pool: {} )...", getConnectionStats());
    }
    return preparationId;
}
Also used : PreparationUpdate(org.talend.dataprep.command.preparation.PreparationUpdate) Timed(org.talend.dataprep.metrics.Timed) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)1 PreparationUpdate (org.talend.dataprep.command.preparation.PreparationUpdate)1 Timed (org.talend.dataprep.metrics.Timed)1