Search in sources :

Example 1 with ActivateControllerServicesEntity

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

the class FlowResource method activateControllerServices.

@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("process-groups/{id}/controller-services")
@ApiOperation(value = "Enable or disable Controller Services in the specified Process Group.", response = ActivateControllerServicesEntity.class, authorizations = { @Authorization(value = "Read - /flow"), @Authorization(value = "Write - /{component-type}/{uuid} - For every service being enabled/disabled") })
@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 activateControllerServices(@Context HttpServletRequest httpServletRequest, @ApiParam(value = "The process group id.", required = true) @PathParam("id") String id, @ApiParam(value = "The request to schedule or unschedule. If the comopnents in the request are not specified, all authorized components will be considered.", required = true) final ActivateControllerServicesEntity requestEntity) {
    // ensure the same id is being used
    if (!id.equals(requestEntity.getId())) {
        throw new IllegalArgumentException(String.format("The process group id (%s) in the request body does " + "not equal the process group id of the requested resource (%s).", requestEntity.getId(), id));
    }
    final ControllerServiceState state;
    if (requestEntity.getState() == null) {
        throw new IllegalArgumentException("The controller service state must be specified.");
    } else {
        try {
            state = ControllerServiceState.valueOf(requestEntity.getState());
        } catch (final IllegalArgumentException iae) {
            throw new IllegalArgumentException(String.format("The controller service state must be one of [%s].", StringUtils.join(EnumSet.of(ControllerServiceState.ENABLED, ControllerServiceState.DISABLED), ", ")));
        }
    }
    // ensure its a supported scheduled state
    if (ControllerServiceState.DISABLING.equals(state) || ControllerServiceState.ENABLING.equals(state)) {
        throw new IllegalArgumentException(String.format("The scheduled must be one of [%s].", StringUtils.join(EnumSet.of(ControllerServiceState.ENABLED, ControllerServiceState.DISABLED), ", ")));
    }
    // if the components are not specified, gather all components and their current revision
    if (requestEntity.getComponents() == null) {
        // get the current revisions for the components being updated
        final Set<Revision> revisions = serviceFacade.getRevisionsFromGroup(id, group -> {
            final Set<String> componentIds = new HashSet<>();
            final Predicate<ControllerServiceNode> filter;
            if (ControllerServiceState.ENABLED.equals(state)) {
                filter = service -> !service.isActive() && service.isValid();
            } else {
                filter = service -> service.isActive();
            }
            group.findAllControllerServices().stream().filter(filter).filter(service -> service.isAuthorized(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser())).forEach(service -> componentIds.add(service.getIdentifier()));
            return componentIds;
        });
        // build the component mapping
        final Map<String, RevisionDTO> componentsToSchedule = new HashMap<>();
        revisions.forEach(revision -> {
            final RevisionDTO dto = new RevisionDTO();
            dto.setClientId(revision.getClientId());
            dto.setVersion(revision.getVersion());
            componentsToSchedule.put(revision.getComponentId(), dto);
        });
        // set the components and their current revision
        requestEntity.setComponents(componentsToSchedule);
    }
    if (isReplicateRequest()) {
        return replicate(HttpMethod.PUT, requestEntity);
    }
    final Map<String, RevisionDTO> requestComponentsToSchedule = requestEntity.getComponents();
    final Map<String, Revision> requestComponentRevisions = requestComponentsToSchedule.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> getRevision(e.getValue(), e.getKey())));
    final Set<Revision> requestRevisions = new HashSet<>(requestComponentRevisions.values());
    return withWriteLock(serviceFacade, requestEntity, requestRevisions, lookup -> {
        // ensure access to the flow
        authorizeFlow();
        // ensure access to every component being scheduled
        requestComponentsToSchedule.keySet().forEach(componentId -> {
            final Authorizable authorizable = lookup.getControllerService(componentId).getAuthorizable();
            authorizable.authorize(authorizer, RequestAction.WRITE, NiFiUserUtils.getNiFiUser());
        });
    }, () -> serviceFacade.verifyActivateControllerServices(id, state, requestComponentRevisions.keySet()), (revisions, scheduleComponentsEntity) -> {
        final ControllerServiceState serviceState = ControllerServiceState.valueOf(scheduleComponentsEntity.getState());
        final Map<String, RevisionDTO> componentsToSchedule = scheduleComponentsEntity.getComponents();
        final Map<String, Revision> componentRevisions = componentsToSchedule.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> getRevision(e.getValue(), e.getKey())));
        // update the controller services
        final ActivateControllerServicesEntity entity = serviceFacade.activateControllerServices(id, serviceState, componentRevisions);
        return generateOkResponse(entity).build();
    });
}
Also used : Bundle(org.apache.nifi.bundle.Bundle) DateTimeParameter(org.apache.nifi.web.api.request.DateTimeParameter) StatusHistoryEntity(org.apache.nifi.web.api.entity.StatusHistoryEntity) Produces(javax.ws.rs.Produces) BulletinBoardPatternParameter(org.apache.nifi.web.api.request.BulletinBoardPatternParameter) ApiParam(io.swagger.annotations.ApiParam) StringUtils(org.apache.commons.lang3.StringUtils) BucketsEntity(org.apache.nifi.web.api.entity.BucketsEntity) MediaType(javax.ws.rs.core.MediaType) ProcessGroupDTO(org.apache.nifi.web.api.dto.ProcessGroupDTO) NiFiRegistryException(org.apache.nifi.registry.client.NiFiRegistryException) AboutDTO(org.apache.nifi.web.api.dto.AboutDTO) Map(java.util.Map) ResourceNotFoundException(org.apache.nifi.web.ResourceNotFoundException) RegistriesEntity(org.apache.nifi.web.api.entity.RegistriesEntity) CurrentUserEntity(org.apache.nifi.web.api.entity.CurrentUserEntity) ProcessGroupFlowEntity(org.apache.nifi.web.api.entity.ProcessGroupFlowEntity) EnumSet(java.util.EnumSet) HistoryQueryDTO(org.apache.nifi.web.api.dto.action.HistoryQueryDTO) NarClassLoaders(org.apache.nifi.nar.NarClassLoaders) ControllerServicesEntity(org.apache.nifi.web.api.entity.ControllerServicesEntity) Set(java.util.Set) BulletinBoardDTO(org.apache.nifi.web.api.dto.BulletinBoardDTO) ScheduledState(org.apache.nifi.controller.ScheduledState) WebApplicationException(javax.ws.rs.WebApplicationException) ActionEntity(org.apache.nifi.web.api.entity.ActionEntity) ControllerBulletinsEntity(org.apache.nifi.web.api.entity.ControllerBulletinsEntity) RemoteProcessGroupStatusEntity(org.apache.nifi.web.api.entity.RemoteProcessGroupStatusEntity) GET(javax.ws.rs.GET) ControllerServiceEntity(org.apache.nifi.web.api.entity.ControllerServiceEntity) TemplateEntity(org.apache.nifi.web.api.entity.TemplateEntity) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO) BulletinBoardEntity(org.apache.nifi.web.api.entity.BulletinBoardEntity) HttpMethod(javax.ws.rs.HttpMethod) ArrayList(java.util.ArrayList) HttpServletRequest(javax.servlet.http.HttpServletRequest) ReportingTaskTypesEntity(org.apache.nifi.web.api.entity.ReportingTaskTypesEntity) NiFiUser(org.apache.nifi.authorization.user.NiFiUser) NodeConnectionState(org.apache.nifi.cluster.coordination.node.NodeConnectionState) Api(io.swagger.annotations.Api) ProcessGroupFlowDTO(org.apache.nifi.web.api.dto.flow.ProcessGroupFlowDTO) FlowDTO(org.apache.nifi.web.api.dto.flow.FlowDTO) FlowConfigurationEntity(org.apache.nifi.web.api.entity.FlowConfigurationEntity) NiFiServiceFacade(org.apache.nifi.web.NiFiServiceFacade) RequestAction(org.apache.nifi.authorization.RequestAction) BannerEntity(org.apache.nifi.web.api.entity.BannerEntity) HistoryDTO(org.apache.nifi.web.api.dto.action.HistoryDTO) ClusteSummaryEntity(org.apache.nifi.web.api.entity.ClusteSummaryEntity) Authorizer(org.apache.nifi.authorization.Authorizer) NiFiProperties(org.apache.nifi.util.NiFiProperties) VersionedFlowSnapshotMetadataEntity(org.apache.nifi.web.api.entity.VersionedFlowSnapshotMetadataEntity) VersionedFlowSnapshotMetadataSetEntity(org.apache.nifi.web.api.entity.VersionedFlowSnapshotMetadataSetEntity) ProcessorStatusEntity(org.apache.nifi.web.api.entity.ProcessorStatusEntity) ApiResponse(io.swagger.annotations.ApiResponse) BucketEntity(org.apache.nifi.web.api.entity.BucketEntity) ScheduleComponentsEntity(org.apache.nifi.web.api.entity.ScheduleComponentsEntity) VersionedFlowEntity(org.apache.nifi.web.api.entity.VersionedFlowEntity) NodeIdentifier(org.apache.nifi.cluster.protocol.NodeIdentifier) ProcessGroup(org.apache.nifi.groups.ProcessGroup) BulletinQueryDTO(org.apache.nifi.web.api.dto.BulletinQueryDTO) Date(java.util.Date) Path(javax.ws.rs.Path) ClusterSummaryDTO(org.apache.nifi.web.api.dto.ClusterSummaryDTO) ProcessGroupStatusEntity(org.apache.nifi.web.api.entity.ProcessGroupStatusEntity) ApiOperation(io.swagger.annotations.ApiOperation) QueryParam(javax.ws.rs.QueryParam) Consumes(javax.ws.rs.Consumes) ControllerStatusDTO(org.apache.nifi.web.api.dto.status.ControllerStatusDTO) ActivateControllerServicesEntity(org.apache.nifi.web.api.entity.ActivateControllerServicesEntity) ConnectionStatusEntity(org.apache.nifi.web.api.entity.ConnectionStatusEntity) ControllerStatusEntity(org.apache.nifi.web.api.entity.ControllerStatusEntity) DefaultValue(javax.ws.rs.DefaultValue) IntegerParameter(org.apache.nifi.web.api.request.IntegerParameter) NodeResponse(org.apache.nifi.cluster.manager.NodeResponse) HistoryEntity(org.apache.nifi.web.api.entity.HistoryEntity) Context(javax.ws.rs.core.Context) Authorizable(org.apache.nifi.authorization.resource.Authorizable) ReportingTaskEntity(org.apache.nifi.web.api.entity.ReportingTaskEntity) Predicate(java.util.function.Predicate) NodeSearchResultDTO(org.apache.nifi.web.api.dto.search.NodeSearchResultDTO) ClusterSearchResultsEntity(org.apache.nifi.web.api.entity.ClusterSearchResultsEntity) LongParameter(org.apache.nifi.web.api.request.LongParameter) Collectors(java.util.stream.Collectors) List(java.util.List) Response(javax.ws.rs.core.Response) BannerDTO(org.apache.nifi.web.api.dto.BannerDTO) ProcessGroupEntity(org.apache.nifi.web.api.entity.ProcessGroupEntity) ControllerServiceState(org.apache.nifi.controller.service.ControllerServiceState) SearchResultsEntity(org.apache.nifi.web.api.entity.SearchResultsEntity) PathParam(javax.ws.rs.PathParam) Revision(org.apache.nifi.web.Revision) TemplatesEntity(org.apache.nifi.web.api.entity.TemplatesEntity) ClusterDTO(org.apache.nifi.web.api.dto.ClusterDTO) ControllerServiceNode(org.apache.nifi.controller.service.ControllerServiceNode) HashMap(java.util.HashMap) ApiResponses(io.swagger.annotations.ApiResponses) BundleDetails(org.apache.nifi.bundle.BundleDetails) HashSet(java.util.HashSet) ClusterCoordinator(org.apache.nifi.cluster.coordination.ClusterCoordinator) ControllerServiceTypesEntity(org.apache.nifi.web.api.entity.ControllerServiceTypesEntity) PrioritizerTypesEntity(org.apache.nifi.web.api.entity.PrioritizerTypesEntity) ProcessorTypesEntity(org.apache.nifi.web.api.entity.ProcessorTypesEntity) RegistryClientsEntity(org.apache.nifi.web.api.entity.RegistryClientsEntity) PortStatusEntity(org.apache.nifi.web.api.entity.PortStatusEntity) ComponentHistoryEntity(org.apache.nifi.web.api.entity.ComponentHistoryEntity) NiFiUserUtils(org.apache.nifi.authorization.user.NiFiUserUtils) SearchResultsDTO(org.apache.nifi.web.api.dto.search.SearchResultsDTO) AboutEntity(org.apache.nifi.web.api.entity.AboutEntity) RegistryEntity(org.apache.nifi.web.api.entity.RegistryEntity) NodeDTO(org.apache.nifi.web.api.dto.NodeDTO) PUT(javax.ws.rs.PUT) IllegalClusterResourceRequestException(org.apache.nifi.web.IllegalClusterResourceRequestException) Authorization(io.swagger.annotations.Authorization) VersionedFlowsEntity(org.apache.nifi.web.api.entity.VersionedFlowsEntity) ReportingTasksEntity(org.apache.nifi.web.api.entity.ReportingTasksEntity) ControllerServiceState(org.apache.nifi.controller.service.ControllerServiceState) HashMap(java.util.HashMap) ActivateControllerServicesEntity(org.apache.nifi.web.api.entity.ActivateControllerServicesEntity) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO) Revision(org.apache.nifi.web.Revision) ControllerServiceNode(org.apache.nifi.controller.service.ControllerServiceNode) Authorizable(org.apache.nifi.authorization.resource.Authorizable) Map(java.util.Map) HashMap(java.util.HashMap) HashSet(java.util.HashSet) Path(javax.ws.rs.Path) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces) ApiOperation(io.swagger.annotations.ApiOperation) PUT(javax.ws.rs.PUT) ApiResponses(io.swagger.annotations.ApiResponses)

Example 2 with ActivateControllerServicesEntity

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

the class ClusterReplicationComponentLifecycle method activateControllerServices.

@Override
public Set<AffectedComponentEntity> activateControllerServices(final URI originalUri, final NiFiUser user, final String groupId, final Set<AffectedComponentEntity> affectedServices, final ControllerServiceState desiredState, final Pause pause) throws LifecycleManagementException {
    final Set<String> affectedServiceIds = affectedServices.stream().map(component -> component.getId()).collect(Collectors.toSet());
    final Map<String, Revision> serviceRevisionMap = getRevisions(groupId, affectedServiceIds);
    final Map<String, RevisionDTO> serviceRevisionDtoMap = serviceRevisionMap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> dtoFactory.createRevisionDTO(entry.getValue())));
    final ActivateControllerServicesEntity activateServicesEntity = new ActivateControllerServicesEntity();
    activateServicesEntity.setComponents(serviceRevisionDtoMap);
    activateServicesEntity.setId(groupId);
    activateServicesEntity.setState(desiredState.name());
    URI controllerServicesUri;
    try {
        controllerServicesUri = new URI(originalUri.getScheme(), originalUri.getUserInfo(), originalUri.getHost(), originalUri.getPort(), "/nifi-api/flow/process-groups/" + groupId + "/controller-services", null, originalUri.getFragment());
    } catch (URISyntaxException e) {
        throw new RuntimeException(e);
    }
    final Map<String, String> headers = new HashMap<>();
    headers.put("content-type", MediaType.APPLICATION_JSON);
    // Determine whether we should replicate only to the cluster coordinator, or if we should replicate directly to the cluster nodes themselves.
    try {
        final NodeResponse clusterResponse;
        if (getReplicationTarget() == ReplicationTarget.CLUSTER_NODES) {
            clusterResponse = getRequestReplicator().replicate(user, HttpMethod.PUT, controllerServicesUri, activateServicesEntity, headers).awaitMergedResponse();
        } else {
            clusterResponse = getRequestReplicator().forwardToCoordinator(getClusterCoordinatorNode(), user, HttpMethod.PUT, controllerServicesUri, activateServicesEntity, headers).awaitMergedResponse();
        }
        final int disableServicesStatus = clusterResponse.getStatus();
        if (disableServicesStatus != Status.OK.getStatusCode()) {
            final String explanation = getResponseEntity(clusterResponse, String.class);
            throw new LifecycleManagementException("Failed to update Controller Services to a state of " + desiredState + " due to " + explanation);
        }
        final boolean serviceTransitioned = waitForControllerServiceStatus(user, originalUri, groupId, affectedServiceIds, desiredState, pause);
        if (!serviceTransitioned) {
            throw new LifecycleManagementException("Failed while waiting for Controller Services to finish transitioning to a state of " + desiredState);
        }
    } catch (final InterruptedException ie) {
        Thread.currentThread().interrupt();
        throw new LifecycleManagementException("Interrupted while transitioning Controller Services to a state of " + desiredState);
    }
    return affectedServices.stream().map(componentEntity -> serviceFacade.getControllerService(componentEntity.getId(), user)).map(dtoFactory::createAffectedComponentEntity).collect(Collectors.toSet());
}
Also used : NodeIdentifier(org.apache.nifi.cluster.protocol.NodeIdentifier) Revision(org.apache.nifi.web.Revision) ProcessorStatusDTO(org.apache.nifi.web.api.dto.status.ProcessorStatusDTO) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) ControllerServiceEntity(org.apache.nifi.web.api.entity.ControllerServiceEntity) HashMap(java.util.HashMap) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO) Function(java.util.function.Function) AffectedComponentDTO(org.apache.nifi.web.api.dto.AffectedComponentDTO) HttpMethod(javax.ws.rs.HttpMethod) ProcessorEntity(org.apache.nifi.web.api.entity.ProcessorEntity) MediaType(javax.ws.rs.core.MediaType) NiFiUser(org.apache.nifi.authorization.user.NiFiUser) ActivateControllerServicesEntity(org.apache.nifi.web.api.entity.ActivateControllerServicesEntity) Map(java.util.Map) ClusterCoordinator(org.apache.nifi.cluster.coordination.ClusterCoordinator) RequestReplicator(org.apache.nifi.cluster.coordination.http.replication.RequestReplicator) URI(java.net.URI) Status(javax.ws.rs.core.Response.Status) NodeResponse(org.apache.nifi.cluster.manager.NodeResponse) NiFiServiceFacade(org.apache.nifi.web.NiFiServiceFacade) NoClusterCoordinatorException(org.apache.nifi.cluster.exception.NoClusterCoordinatorException) Logger(org.slf4j.Logger) ControllerServicesEntity(org.apache.nifi.web.api.entity.ControllerServicesEntity) Set(java.util.Set) ProcessorsEntity(org.apache.nifi.web.api.entity.ProcessorsEntity) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) Collectors(java.util.stream.Collectors) ReplicationTarget(org.apache.nifi.web.api.ApplicationResource.ReplicationTarget) MultivaluedMap(javax.ws.rs.core.MultivaluedMap) ScheduledState(org.apache.nifi.controller.ScheduledState) ControllerServiceState(org.apache.nifi.controller.service.ControllerServiceState) AffectedComponentEntity(org.apache.nifi.web.api.entity.AffectedComponentEntity) DtoFactory(org.apache.nifi.web.api.dto.DtoFactory) ScheduleComponentsEntity(org.apache.nifi.web.api.entity.ScheduleComponentsEntity) ActivateControllerServicesEntity(org.apache.nifi.web.api.entity.ActivateControllerServicesEntity) HashMap(java.util.HashMap) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) NodeResponse(org.apache.nifi.cluster.manager.NodeResponse) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO) Revision(org.apache.nifi.web.Revision) HashMap(java.util.HashMap) Map(java.util.Map) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) MultivaluedMap(javax.ws.rs.core.MultivaluedMap)

Example 3 with ActivateControllerServicesEntity

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

the class ProcessGroupResource method activateControllerServices.

private void activateControllerServices(final String groupId, final URI originalUri, final VariableRegistryUpdateRequest updateRequest, final Pause pause, final Collection<AffectedComponentDTO> affectedServices, final ControllerServiceState desiredState, final VariableRegistryUpdateStep updateStep) throws InterruptedException {
    final Set<String> affectedServiceIds = affectedServices.stream().map(component -> component.getId()).collect(Collectors.toSet());
    final Map<String, Revision> serviceRevisionMap = getRevisions(groupId, affectedServiceIds);
    final Map<String, RevisionDTO> serviceRevisionDtoMap = serviceRevisionMap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> dtoFactory.createRevisionDTO(entry.getValue())));
    final ActivateControllerServicesEntity activateServicesEntity = new ActivateControllerServicesEntity();
    activateServicesEntity.setComponents(serviceRevisionDtoMap);
    activateServicesEntity.setId(groupId);
    activateServicesEntity.setState(desiredState.name());
    URI controllerServicesUri;
    try {
        controllerServicesUri = new URI(originalUri.getScheme(), originalUri.getUserInfo(), originalUri.getHost(), originalUri.getPort(), "/nifi-api/flow/process-groups/" + groupId + "/controller-services", null, originalUri.getFragment());
    } catch (URISyntaxException e) {
        throw new RuntimeException(e);
    }
    final Map<String, String> headers = new HashMap<>();
    headers.put("content-type", MediaType.APPLICATION_JSON);
    // Determine whether we should replicate only to the cluster coordinator, or if we should replicate directly to the cluster nodes themselves.
    final NodeResponse clusterResponse;
    if (getReplicationTarget() == ReplicationTarget.CLUSTER_NODES) {
        clusterResponse = getRequestReplicator().replicate(HttpMethod.PUT, controllerServicesUri, activateServicesEntity, headers).awaitMergedResponse();
    } else {
        clusterResponse = getRequestReplicator().forwardToCoordinator(getClusterCoordinatorNode(), HttpMethod.PUT, controllerServicesUri, activateServicesEntity, headers).awaitMergedResponse();
    }
    final int disableServicesStatus = clusterResponse.getStatus();
    if (disableServicesStatus != Status.OK.getStatusCode()) {
        updateStep.setFailureReason("Failed while " + updateStep.getDescription());
        updateStep.setComplete(true);
        updateRequest.setFailureReason("Failed while " + updateStep.getDescription());
        return;
    }
    updateRequest.setLastUpdated(new Date());
    final boolean serviceTransitioned = waitForControllerServiceStatus(originalUri, groupId, affectedServiceIds, desiredState, updateRequest, pause);
    updateStep.setComplete(true);
    if (!serviceTransitioned) {
        updateStep.setFailureReason("Failed while " + updateStep.getDescription());
        updateRequest.setComplete(true);
        updateRequest.setFailureReason("Failed while " + updateStep.getDescription());
    }
}
Also used : FunnelsEntity(org.apache.nifi.web.api.entity.FunnelsEntity) Produces(javax.ws.rs.Produces) InstantiateTemplateRequestEntity(org.apache.nifi.web.api.entity.InstantiateTemplateRequestEntity) ApiParam(io.swagger.annotations.ApiParam) SiteToSiteRestApiClient(org.apache.nifi.remote.util.SiteToSiteRestApiClient) ConnectionDTO(org.apache.nifi.web.api.dto.ConnectionDTO) ComponentAuthorizable(org.apache.nifi.authorization.ComponentAuthorizable) StringUtils(org.apache.commons.lang3.StringUtils) ClientIdParameter(org.apache.nifi.web.api.request.ClientIdParameter) ProcessorEntity(org.apache.nifi.web.api.entity.ProcessorEntity) AuthorizeAccess(org.apache.nifi.authorization.AuthorizeAccess) VariableRegistryUpdateStep(org.apache.nifi.registry.variable.VariableRegistryUpdateStep) PositionDTO(org.apache.nifi.web.api.dto.PositionDTO) MediaType(javax.ws.rs.core.MediaType) ProcessGroupDTO(org.apache.nifi.web.api.dto.ProcessGroupDTO) NiFiRegistryException(org.apache.nifi.registry.client.NiFiRegistryException) Map(java.util.Map) ResourceNotFoundException(org.apache.nifi.web.ResourceNotFoundException) UriBuilder(javax.ws.rs.core.UriBuilder) SecurityContextHolder(org.springframework.security.core.context.SecurityContextHolder) ConnectionsEntity(org.apache.nifi.web.api.entity.ConnectionsEntity) FunnelEntity(org.apache.nifi.web.api.entity.FunnelEntity) VariableRegistryUpdateRequest(org.apache.nifi.registry.variable.VariableRegistryUpdateRequest) ControllerServicesEntity(org.apache.nifi.web.api.entity.ControllerServicesEntity) Set(java.util.Set) InputPortsEntity(org.apache.nifi.web.api.entity.InputPortsEntity) Executors(java.util.concurrent.Executors) ArrayBlockingQueue(java.util.concurrent.ArrayBlockingQueue) FormDataParam(org.glassfish.jersey.media.multipart.FormDataParam) ProcessGroupsEntity(org.apache.nifi.web.api.entity.ProcessGroupsEntity) FlowComparisonEntity(org.apache.nifi.web.api.entity.FlowComparisonEntity) ScheduledState(org.apache.nifi.controller.ScheduledState) LabelsEntity(org.apache.nifi.web.api.entity.LabelsEntity) UriInfo(javax.ws.rs.core.UriInfo) ApiImplicitParams(io.swagger.annotations.ApiImplicitParams) DtoFactory(org.apache.nifi.web.api.dto.DtoFactory) Entity(org.apache.nifi.web.api.entity.Entity) GET(javax.ws.rs.GET) ControllerServiceEntity(org.apache.nifi.web.api.entity.ControllerServiceEntity) ConfigurableComponent(org.apache.nifi.components.ConfigurableComponent) TemplateEntity(org.apache.nifi.web.api.entity.TemplateEntity) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO) HttpMethod(javax.ws.rs.HttpMethod) HttpServletRequest(javax.servlet.http.HttpServletRequest) NiFiUser(org.apache.nifi.authorization.user.NiFiUser) NiFiUserDetails(org.apache.nifi.authorization.user.NiFiUserDetails) Api(io.swagger.annotations.Api) VariableRegistryDTO(org.apache.nifi.web.api.dto.VariableRegistryDTO) FlowDTO(org.apache.nifi.web.api.dto.flow.FlowDTO) VersionedFlowState(org.apache.nifi.registry.flow.VersionedFlowState) NiFiServiceFacade(org.apache.nifi.web.NiFiServiceFacade) AuthorizableLookup(org.apache.nifi.authorization.AuthorizableLookup) RequestAction(org.apache.nifi.authorization.RequestAction) FlowEncodingVersion(org.apache.nifi.controller.serialization.FlowEncodingVersion) JAXBElement(javax.xml.bind.JAXBElement) RemoteProcessGroupsEntity(org.apache.nifi.web.api.entity.RemoteProcessGroupsEntity) IOException(java.io.IOException) VersionedFlowSnapshot(org.apache.nifi.registry.flow.VersionedFlowSnapshot) Authorizer(org.apache.nifi.authorization.Authorizer) ApiResponse(io.swagger.annotations.ApiResponse) FlowEntity(org.apache.nifi.web.api.entity.FlowEntity) AffectedComponentEntity(org.apache.nifi.web.api.entity.AffectedComponentEntity) OutputPortsEntity(org.apache.nifi.web.api.entity.OutputPortsEntity) ScheduleComponentsEntity(org.apache.nifi.web.api.entity.ScheduleComponentsEntity) XmlUtils(org.apache.nifi.security.xml.XmlUtils) BundleCoordinate(org.apache.nifi.bundle.BundleCoordinate) ProcessorConfigDTO(org.apache.nifi.web.api.dto.ProcessorConfigDTO) Date(java.util.Date) ConnectableType(org.apache.nifi.connectable.ConnectableType) ProcessorStatusDTO(org.apache.nifi.web.api.dto.status.ProcessorStatusDTO) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) Path(javax.ws.rs.Path) BundleDTO(org.apache.nifi.web.api.dto.BundleDTO) ApiOperation(io.swagger.annotations.ApiOperation) AuthorizeControllerServiceReference(org.apache.nifi.authorization.AuthorizeControllerServiceReference) QueryParam(javax.ws.rs.QueryParam) Consumes(javax.ws.rs.Consumes) TemplateDTO(org.apache.nifi.web.api.dto.TemplateDTO) ActivateControllerServicesEntity(org.apache.nifi.web.api.entity.ActivateControllerServicesEntity) XMLStreamReader(javax.xml.stream.XMLStreamReader) DefaultValue(javax.ws.rs.DefaultValue) URI(java.net.URI) ThreadFactory(java.util.concurrent.ThreadFactory) NodeResponse(org.apache.nifi.cluster.manager.NodeResponse) DELETE(javax.ws.rs.DELETE) Context(javax.ws.rs.core.Context) Authorizable(org.apache.nifi.authorization.resource.Authorizable) ControllerServiceDTO(org.apache.nifi.web.api.dto.ControllerServiceDTO) ApiImplicitParam(io.swagger.annotations.ApiImplicitParam) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) SnippetAuthorizable(org.apache.nifi.authorization.SnippetAuthorizable) UUID(java.util.UUID) BundleUtils(org.apache.nifi.util.BundleUtils) PortEntity(org.apache.nifi.web.api.entity.PortEntity) LongParameter(org.apache.nifi.web.api.request.LongParameter) JAXBException(javax.xml.bind.JAXBException) Collectors(java.util.stream.Collectors) List(java.util.List) Response(javax.ws.rs.core.Response) ProcessGroupEntity(org.apache.nifi.web.api.entity.ProcessGroupEntity) ProcessorDTO(org.apache.nifi.web.api.dto.ProcessorDTO) ControllerServiceState(org.apache.nifi.controller.service.ControllerServiceState) CopySnippetRequestEntity(org.apache.nifi.web.api.entity.CopySnippetRequestEntity) Authentication(org.springframework.security.core.Authentication) Pause(org.apache.nifi.web.util.Pause) FlowSnippetDTO(org.apache.nifi.web.api.dto.FlowSnippetDTO) RemoteProcessGroupDTO(org.apache.nifi.web.api.dto.RemoteProcessGroupDTO) PathParam(javax.ws.rs.PathParam) Bucket(org.apache.nifi.registry.bucket.Bucket) Revision(org.apache.nifi.web.Revision) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) HashMap(java.util.HashMap) ApiResponses(io.swagger.annotations.ApiResponses) Function(java.util.function.Function) AffectedComponentDTO(org.apache.nifi.web.api.dto.AffectedComponentDTO) ConcurrentMap(java.util.concurrent.ConcurrentMap) FlowRegistryUtils(org.apache.nifi.registry.flow.FlowRegistryUtils) CreateTemplateRequestEntity(org.apache.nifi.web.api.entity.CreateTemplateRequestEntity) VersionControlInformationDTO(org.apache.nifi.web.api.dto.VersionControlInformationDTO) VariableRegistryUpdateRequestEntity(org.apache.nifi.web.api.entity.VariableRegistryUpdateRequestEntity) NiFiAuthenticationToken(org.apache.nifi.web.security.token.NiFiAuthenticationToken) Status(javax.ws.rs.core.Response.Status) JAXBContext(javax.xml.bind.JAXBContext) ExecutorService(java.util.concurrent.ExecutorService) Unmarshaller(javax.xml.bind.Unmarshaller) TemplateContentsAuthorizable(org.apache.nifi.authorization.TemplateContentsAuthorizable) Logger(org.slf4j.Logger) POST(javax.ws.rs.POST) ProcessorsEntity(org.apache.nifi.web.api.entity.ProcessorsEntity) VariableRegistryEntity(org.apache.nifi.web.api.entity.VariableRegistryEntity) VersionedFlow(org.apache.nifi.registry.flow.VersionedFlow) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) MultivaluedMap(javax.ws.rs.core.MultivaluedMap) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) LabelEntity(org.apache.nifi.web.api.entity.LabelEntity) ConnectionEntity(org.apache.nifi.web.api.entity.ConnectionEntity) ProcessGroupAuthorizable(org.apache.nifi.authorization.ProcessGroupAuthorizable) RemoteProcessGroupEntity(org.apache.nifi.web.api.entity.RemoteProcessGroupEntity) NiFiUserUtils(org.apache.nifi.authorization.user.NiFiUserUtils) PUT(javax.ws.rs.PUT) Authorization(io.swagger.annotations.Authorization) Collections(java.util.Collections) InputStream(java.io.InputStream) ActivateControllerServicesEntity(org.apache.nifi.web.api.entity.ActivateControllerServicesEntity) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) NodeResponse(org.apache.nifi.cluster.manager.NodeResponse) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) RevisionDTO(org.apache.nifi.web.api.dto.RevisionDTO) Date(java.util.Date) Revision(org.apache.nifi.web.Revision) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) MultivaluedMap(javax.ws.rs.core.MultivaluedMap)

Aggregations

HashMap (java.util.HashMap)3 Map (java.util.Map)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3 HttpMethod (javax.ws.rs.HttpMethod)3 Api (io.swagger.annotations.Api)2 ApiOperation (io.swagger.annotations.ApiOperation)2 ApiParam (io.swagger.annotations.ApiParam)2 ApiResponse (io.swagger.annotations.ApiResponse)2 ApiResponses (io.swagger.annotations.ApiResponses)2 Authorization (io.swagger.annotations.Authorization)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 Date (java.util.Date)2 List (java.util.List)2 Function (java.util.function.Function)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 Consumes (javax.ws.rs.Consumes)2 DefaultValue (javax.ws.rs.DefaultValue)2 GET (javax.ws.rs.GET)2