use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyActionResource method validateTopology.
@POST
@Path("/topologies/{topologyId}/actions/validate")
@Timed
public Response validateTopology(@PathParam("topologyId") Long topologyId, @Context SecurityContext securityContext) {
SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_TOPOLOGY_SUPER_ADMIN, NAMESPACE, topologyId, READ, EXECUTE);
Topology result = catalogService.getTopology(topologyId);
if (result != null) {
// catalogService.validateTopology(SCHEMA, topologyId);
return WSUtils.respondEntity(result, OK);
}
throw EntityNotFoundException.byId(topologyId.toString());
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyActionResource method deployTopologyVersion.
@POST
@Path("/topologies/{topologyId}/versions/{versionId}/actions/deploy")
@Timed
public Response deployTopologyVersion(@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 topology = catalogService.getTopology(topologyId, versionId);
if (topology != null) {
return deploy(topology, securityContext);
}
throw EntityNotFoundException.byVersion(topologyId.toString(), versionId.toString());
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyActionResource method resumeTopology.
@POST
@Path("/topologies/{topologyId}/actions/resume")
@Timed
public Response resumeTopology(@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) {
actionsService.resumeTopology(result, WSUtils.getUserFromSecurityContext(securityContext));
return WSUtils.respondEntity(result, OK);
}
throw EntityNotFoundException.byId(topologyId.toString());
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyActionResource method deployTopology.
@POST
@Path("/topologies/{topologyId}/actions/deploy")
@Timed
public Response deployTopology(@PathParam("topologyId") Long topologyId, @Context SecurityContext securityContext) throws Exception {
SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_TOPOLOGY_SUPER_ADMIN, NAMESPACE, topologyId, READ, EXECUTE);
Topology topology = catalogService.getTopology(topologyId);
if (topology != null) {
return deploy(topology, securityContext);
}
throw EntityNotFoundException.byId(topologyId.toString());
}
use of com.hortonworks.streamline.streams.catalog.Topology in project streamline by hortonworks.
the class TopologyActionResource method suspendTopologyVersion.
@POST
@Path("/topologies/{topologyId}/versions/{versionId}/actions/suspend")
@Timed
public Response suspendTopologyVersion(@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) {
actionsService.suspendTopology(result, WSUtils.getUserFromSecurityContext(securityContext));
return WSUtils.respondEntity(result, OK);
}
throw EntityNotFoundException.byVersion(topologyId.toString(), versionId.toString());
}
Aggregations