[ 
https://issues.apache.org/jira/browse/NIFI-4895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16405160#comment-16405160
 ] 

ASF GitHub Bot commented on NIFI-4895:
--------------------------------------

Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2555#discussion_r175519356
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
 ---
    @@ -209,6 +211,50 @@ public Response getProcessor(
             return generateOkResponse(entity).build();
         }
     
    +    @DELETE
    +    @Consumes(MediaType.WILDCARD)
    +    @Produces(MediaType.APPLICATION_JSON)
    +    @Path("/{id}/threads")
    +    @ApiOperation(value = "Terminates a processor, essentially 
\"deleting\" its threads and any active tasks", response = 
ProcessorEntity.class, authorizations = {
    +        @Authorization(value = "Write - /processors/{uuid}")
    +    })
    +    @ApiResponses(value = {
    +        @ApiResponse(code = 400, message = "NiFi was unable to complete 
the request because it was invalid. The request should not be retried without 
modification."),
    +        @ApiResponse(code = 401, message = "Client could not be 
authenticated."),
    +        @ApiResponse(code = 403, message = "Client is not authorized to 
make this request."),
    +        @ApiResponse(code = 404, message = "The specified resource could 
not be found."),
    +        @ApiResponse(code = 409, message = "The request was valid but NiFi 
was not in the appropriate state to process it. Retrying the same request later 
may be successful.")
    +    })
    +    public Response terminateProcessor(
    +        @QueryParam(VERSION) final LongParameter version,
    +        @ApiParam(value = "If the client id is not specified, new one will 
be generated. This value (whether specified or generated) is included in the 
response.", required = false) @QueryParam(CLIENT_ID) 
@DefaultValue(StringUtils.EMPTY) final ClientIdParameter clientId,
    +        @ApiParam(value = "The processor id.", required = true) 
@PathParam("id") final String id) throws InterruptedException {
    +
    +        if (isReplicateRequest()) {
    +            return replicate(HttpMethod.POST);
    +        }
    +
    +        final Revision requestRevision = new Revision(version == null ? 
null : version.getLong(), clientId.getClientId(), id);
    --- End diff --
    
    Good call.


> Implement back-end for terminating a Processor
> ----------------------------------------------
>
>                 Key: NIFI-4895
>                 URL: https://issues.apache.org/jira/browse/NIFI-4895
>             Project: Apache NiFi
>          Issue Type: Sub-task
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to