mirror of https://github.com/apache/nifi.git
NIFI-2252: Fixed issue where POST to Controller Resource createControllerService and also ensure that URI is set on the entity. This closes #641
This commit is contained in:
parent
252bfb5c31
commit
6b87e1ea84
|
@ -416,7 +416,7 @@ public class ControllerResource extends ApplicationResource {
|
|||
}
|
||||
|
||||
if (isReplicateRequest()) {
|
||||
return replicate(HttpMethod.GET);
|
||||
return replicate(HttpMethod.POST, controllerServiceEntity);
|
||||
}
|
||||
|
||||
// handle expects request (usually from the cluster manager)
|
||||
|
@ -437,7 +437,7 @@ public class ControllerResource extends ApplicationResource {
|
|||
// create the controller service and generate the json
|
||||
final Revision revision = getRevision(controllerServiceEntity, controllerServiceEntity.getComponent().getId());
|
||||
final ControllerServiceEntity entity = serviceFacade.createControllerService(revision, null, controllerServiceEntity.getComponent());
|
||||
controllerServiceResource.populateRemainingControllerServiceContent(entity.getComponent());
|
||||
controllerServiceResource.populateRemainingControllerServiceEntityContent(entity);
|
||||
|
||||
// build the response
|
||||
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
|
||||
|
|
|
@ -616,7 +616,7 @@ public class ControllerServiceResource extends ApplicationResource {
|
|||
() -> {
|
||||
// update the controller service
|
||||
final ControllerServiceEntity entity = serviceFacade.updateControllerService(revision, requestControllerServiceDTO);
|
||||
populateRemainingControllerServiceContent(entity.getComponent());
|
||||
populateRemainingControllerServiceEntityContent(entity);
|
||||
|
||||
return clusterContext(generateOkResponse(entity)).build();
|
||||
}
|
||||
|
|
|
@ -2125,7 +2125,7 @@ public class ProcessGroupResource extends ApplicationResource {
|
|||
// create the controller service and generate the json
|
||||
final Revision revision = getRevision(controllerServiceEntity, controllerServiceEntity.getComponent().getId());
|
||||
final ControllerServiceEntity entity = serviceFacade.createControllerService(revision, groupId, controllerServiceEntity.getComponent());
|
||||
controllerServiceResource.populateRemainingControllerServiceContent(entity.getComponent());
|
||||
controllerServiceResource.populateRemainingControllerServiceEntityContent(entity);
|
||||
|
||||
// build the response
|
||||
return clusterContext(generateCreatedResponse(URI.create(entity.getUri()), entity)).build();
|
||||
|
|
Loading…
Reference in New Issue