Search in sources :

Example 1 with NiFiClusterSummary

use of com.thinkbiganalytics.nifi.rest.model.NiFiClusterSummary in project kylo by Teradata.

the class NifiIntegrationRestController method getAbout.

@GET
@Path("/status")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation("Retrieves details about NiFi.")
@ApiResponses({ @ApiResponse(code = 200, message = "Returns details about NiFi.", response = AboutDTO.class), @ApiResponse(code = 500, message = "NiFi is unavailable.", response = RestResponseStatus.class) })
public Response getAbout() {
    final AboutDTO about = nifiRestClient.about();
    final NiFiClusterSummary clusterSummary = nifiRestClient.clusterSummary();
    return Response.ok(ImmutableMap.of("version", about.getVersion(), "clustered", clusterSummary.getClustered())).build();
}
Also used : NiFiClusterSummary(com.thinkbiganalytics.nifi.rest.model.NiFiClusterSummary) AboutDTO(org.apache.nifi.web.api.dto.AboutDTO) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) ApiOperation(io.swagger.annotations.ApiOperation) ApiResponses(io.swagger.annotations.ApiResponses)

Example 2 with NiFiClusterSummary

use of com.thinkbiganalytics.nifi.rest.model.NiFiClusterSummary in project kylo by Teradata.

the class NiFiRestClientV1 method clusterSummary.

@Nonnull
@Override
public NiFiClusterSummary clusterSummary() {
    final ClusterSummaryDTO dto = get("/flow/cluster/summary", null, ClusteSummaryEntity.class).getClusterSummary();
    final NiFiClusterSummary clusterSummary = new NiFiClusterSummary();
    clusterSummary.setClustered(dto.getClustered());
    clusterSummary.setConnectedNodeCount(dto.getConnectedNodeCount());
    clusterSummary.setConnectedNodes(dto.getConnectedNodes());
    clusterSummary.setConnectedToCluster(dto.getConnectedToCluster());
    clusterSummary.setTotalNodeCount(dto.getTotalNodeCount());
    return clusterSummary;
}
Also used : NiFiClusterSummary(com.thinkbiganalytics.nifi.rest.model.NiFiClusterSummary) ClusteSummaryEntity(org.apache.nifi.web.api.entity.ClusteSummaryEntity) ClusterSummaryDTO(org.apache.nifi.web.api.dto.ClusterSummaryDTO) Nonnull(javax.annotation.Nonnull)

Example 3 with NiFiClusterSummary

use of com.thinkbiganalytics.nifi.rest.model.NiFiClusterSummary in project kylo by Teradata.

the class ImportReusableTemplate method isClustered.

private boolean isClustered() {
    if (clustered == null) {
        NiFiClusterSummary clusterSummary = nifiRestClient.getNiFiRestClient().clusterSummary();
        clustered = clusterSummary.getClustered();
    }
    return clustered != null ? clustered : false;
}
Also used : NiFiClusterSummary(com.thinkbiganalytics.nifi.rest.model.NiFiClusterSummary)

Aggregations

NiFiClusterSummary (com.thinkbiganalytics.nifi.rest.model.NiFiClusterSummary)3 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 Nonnull (javax.annotation.Nonnull)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 AboutDTO (org.apache.nifi.web.api.dto.AboutDTO)1 ClusterSummaryDTO (org.apache.nifi.web.api.dto.ClusterSummaryDTO)1 ClusteSummaryEntity (org.apache.nifi.web.api.entity.ClusteSummaryEntity)1