use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyStates method invokeKill.
private static void invokeKill(TopologyContext context) throws Exception {
Topology topology = context.getTopology();
TopologyActions topologyActions = context.getTopologyActions();
topologyActions.kill(CatalogToLayoutConverter.getTopologyLayout(topology), context.getAsUser());
LOG.debug("Killed topology '{}'", topology.getName());
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class RestIntegrationTest method storeTestTopology.
private Topology storeTestTopology(Client client, Long topologyId, String topologyName, Long namespaceId) {
Topology topology = createTopology(topologyId, topologyName, namespaceId);
String topologyBaseUrl = rootUrl + String.format("topologies");
client.target(topologyBaseUrl).request().post(Entity.json(topology));
return topology;
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class RestIntegrationTest method createTopology.
private Topology createTopology(Long id, String name, Long namespaceId) {
Topology topology = new Topology();
topology.setId(id);
topology.setVersionId(1L);
topology.setName(name);
topology.setNamespaceId(namespaceId);
topology.setConfig("{}");
topology.setVersionTimestamp(System.currentTimeMillis());
return topology;
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyActionResource method topologyStatus.
@GET
@Path("/topologies/{topologyId}/actions/status")
@Timed
public Response topologyStatus(@PathParam("topologyId") Long topologyId, @Context SecurityContext securityContext) throws Exception {
SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_TOPOLOGY_SUPER_ADMIN, NAMESPACE, topologyId, READ, EXECUTE);
Topology result = catalogService.getTopology(topologyId);
if (result != null) {
String asUser = WSUtils.getUserFromSecurityContext(securityContext);
TopologyActions.Status status = actionsService.topologyStatus(result, asUser);
return WSUtils.respondEntity(status, OK);
}
throw EntityNotFoundException.byId(topologyId.toString());
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyActionResource method topologyStatusVersion.
@GET
@Path("/topologies/{topologyId}/versions/{versionId}/actions/status")
@Timed
public Response topologyStatusVersion(@PathParam("topologyId") Long topologyId, @PathParam("versionId") Long versionId, @Context SecurityContext securityContext) throws Exception {
SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_TOPOLOGY_SUPER_ADMIN, NAMESPACE, topologyId, READ, EXECUTE);
Topology result = catalogService.getTopology(topologyId, versionId);
if (result != null) {
String asUser = WSUtils.getUserFromSecurityContext(securityContext);
TopologyActions.Status status = actionsService.topologyStatus(result, asUser);
return WSUtils.respondEntity(status, OK);
}
throw EntityNotFoundException.byVersion(topologyId.toString(), versionId.toString());
}
Aggregations