Search in sources :

Example 1 with ControllerConfigurationEntity

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

the class EntityFactory method createControllerConfigurationEntity.

public ControllerConfigurationEntity createControllerConfigurationEntity(final ControllerConfigurationDTO dto, final RevisionDTO revision, final PermissionsDTO permissions) {
    final ControllerConfigurationEntity entity = new ControllerConfigurationEntity();
    entity.setRevision(revision);
    if (dto != null) {
        entity.setPermissions(permissions);
        if (permissions != null && permissions.getCanRead()) {
            entity.setComponent(dto);
        }
    }
    return entity;
}
Also used : ControllerConfigurationEntity(org.apache.nifi.web.api.entity.ControllerConfigurationEntity)

Example 2 with ControllerConfigurationEntity

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

the class ControllerResource method getControllerConfig.

/**
 * Retrieves the configuration for this NiFi.
 *
 * @return A controllerConfigurationEntity.
 */
@GET
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.APPLICATION_JSON)
@Path("config")
@ApiOperation(value = "Retrieves the configuration for this NiFi Controller", response = ControllerConfigurationEntity.class, authorizations = { @Authorization(value = "Read - /controller") })
@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 = 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 getControllerConfig() {
    authorizeController(RequestAction.READ);
    if (isReplicateRequest()) {
        return replicate(HttpMethod.GET);
    }
    final ControllerConfigurationEntity entity = serviceFacade.getControllerConfiguration();
    return generateOkResponse(entity).build();
}
Also used : ControllerConfigurationEntity(org.apache.nifi.web.api.entity.ControllerConfigurationEntity) 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

ControllerConfigurationEntity (org.apache.nifi.web.api.entity.ControllerConfigurationEntity)2 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 Consumes (javax.ws.rs.Consumes)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1