Search in sources :

Example 21 with TopologyProcessor

use of com.hortonworks.streamline.streams.catalog.TopologyProcessor in project streamline by hortonworks.

the class TopologyProcessorCatalogResource method getTopologyProcessorById.

/**
 * <p>
 * Gets the 'CURRENT' version of specific topology processor by Id. For example,
 * </p>
 * <b>GET /api/v1/catalog/topologies/:TOPOLOGY_ID/processors/:PROCESSOR_ID</b>
 * <pre>
 * {
 *   "responseCode": 1000,
 *   "responseMessage": "Success",
 *   "entity": {
 *     "id": 1,
 *     "topologyId": 1,
 *     "name": "ParserProcessor",
 *     "config": {
 *       "properties": {
 *         "parallelism": 1
 *       }
 *     },
 *     "type": "PARSER",
 *     "outputStreams": [{stream1 data..}, {stream2 data..}]
 *   }
 * }
 * </pre>
 */
@GET
@Path("/topologies/{topologyId}/processors/{id}")
@Timed
public Response getTopologyProcessorById(@PathParam("topologyId") Long topologyId, @PathParam("id") Long processorId, @Context SecurityContext securityContext) {
    SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_TOPOLOGY_USER, Topology.NAMESPACE, topologyId, READ);
    TopologyProcessor source = catalogService.getTopologyProcessor(topologyId, processorId);
    if (source != null) {
        return WSUtils.respondEntity(source, OK);
    }
    throw EntityNotFoundException.byId(buildMessageForCompositeId(topologyId, processorId));
}
Also used : TopologyProcessor(com.hortonworks.streamline.streams.catalog.TopologyProcessor) Path(javax.ws.rs.Path) Timed(com.codahale.metrics.annotation.Timed) GET(javax.ws.rs.GET)

Aggregations

TopologyProcessor (com.hortonworks.streamline.streams.catalog.TopologyProcessor)21 TopologySink (com.hortonworks.streamline.streams.catalog.TopologySink)6 Timed (com.codahale.metrics.annotation.Timed)5 QueryParam (com.hortonworks.registries.common.QueryParam)5 WSUtils.buildEdgesFromQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesFromQueryParam)5 WSUtils.buildEdgesToQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesToQueryParam)5 WSUtils.currentVersionQueryParam (com.hortonworks.streamline.common.util.WSUtils.currentVersionQueryParam)5 WSUtils.versionIdQueryParam (com.hortonworks.streamline.common.util.WSUtils.versionIdQueryParam)5 BaseTopologyRule (com.hortonworks.streamline.streams.catalog.BaseTopologyRule)5 TopologySource (com.hortonworks.streamline.streams.catalog.TopologySource)5 TopologyComponentBundle (com.hortonworks.streamline.streams.catalog.topology.TopologyComponentBundle)5 StorableKey (com.hortonworks.registries.storage.StorableKey)4 TopologyBranchRule (com.hortonworks.streamline.streams.catalog.TopologyBranchRule)4 TopologyRule (com.hortonworks.streamline.streams.catalog.TopologyRule)4 TopologyStream (com.hortonworks.streamline.streams.catalog.TopologyStream)4 Path (javax.ws.rs.Path)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ImmutableList (com.google.common.collect.ImmutableList)3 Sets (com.google.common.collect.Sets)3 TopologyEdge (com.hortonworks.streamline.streams.catalog.TopologyEdge)3