use of org.kohsuke.stapler.verb.PUT in project blueocean-plugin by jenkinsci.
the class BluePipeline method update.
/**
* Updates this pipeline using {@link BluePipelineUpdateRequest}
* @param staplerRequest stapler request
* @return Updated BluePipeline instance
* @throws IOException throws IOException in certain cases
*/
@PUT
@WebMethod(name = "")
@TreeResponse
public BluePipeline update(StaplerRequest staplerRequest) throws IOException {
JSONObject body = JSONObject.fromObject(IOUtils.toString(staplerRequest.getReader()));
if (body.get("$class") == null) {
throw new ServiceException.BadRequestExpception("$class is required element");
}
BluePipelineUpdateRequest request = staplerRequest.bindJSON(BluePipelineUpdateRequest.class, body);
return update(request);
}
Aggregations