Search in sources :

Example 6 with StatusHistoryEntity

use of org.apache.nifi.web.api.entity.StatusHistoryEntity in project nifi by apache.

the class FlowResource method getConnectionStatusHistory.

/**
 * Retrieves the specified connection status history.
 *
 * @param id The id of the connection to retrieve.
 * @return A statusHistoryEntity.
 * @throws InterruptedException if interrupted
 */
@GET
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@Path("connections/{id}/status/history")
@ApiOperation(value = "Gets the status history for a connection", response = StatusHistoryEntity.class, authorizations = { @Authorization(value = "Read - /flow") })
@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 getConnectionStatusHistory(@ApiParam(value = "The connection id.", required = true) @PathParam("id") String id) throws InterruptedException {
    authorizeFlow();
    // replicate if cluster manager
    if (isReplicateRequest()) {
        return replicate(HttpMethod.GET);
    }
    // get the specified processor status history
    final StatusHistoryEntity entity = serviceFacade.getConnectionStatusHistory(id);
    return generateOkResponse(entity).build();
}
Also used : StatusHistoryEntity(org.apache.nifi.web.api.entity.StatusHistoryEntity) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

StatusHistoryEntity (org.apache.nifi.web.api.entity.StatusHistoryEntity)6 ApiOperation (io.swagger.annotations.ApiOperation)4 ApiResponses (io.swagger.annotations.ApiResponses)4 Consumes (javax.ws.rs.Consumes)4 GET (javax.ws.rs.GET)4 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 TreeMap (java.util.TreeMap)1 Pattern (java.util.regex.Pattern)1 EndpointResponseMerger (org.apache.nifi.cluster.coordination.http.EndpointResponseMerger)1 NodeResponse (org.apache.nifi.cluster.manager.NodeResponse)1