@GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public NodeInfo get() { return getNodeInfo(); }
@GET @Path("/info") @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) public NodeInfo getNodeInfo() { init(); return new NodeInfo(this.nmContext, this.rview); }
@GET @Path("/containers") @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) public ContainersInfo getNodeContainers(@javax.ws.rs.core.Context HttpServletRequest hsr) { init(); ContainersInfo allContainers = new ContainersInfo(); for (Entry<ContainerId, Container> entry : this.nmContext.getContainers() .entrySet()) { if (entry.getValue() == null) { // just skip it continue; } ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue(), uriInfo.getBaseUri().toString(), webapp.name(), hsr.getRemoteUser()); ApplicationId appId = entry.getKey().getApplicationAttemptId() .getApplicationId(); // Allow only application-owner/admin for any type of access on the // application. if (filterAppsByUser && !hasAccess(entry.getValue().getUser(), appId, hsr)) { continue; } allContainers.add(info); } return allContainers; }
@PathParam(YarnWebServiceParams.CONTAINER_ID) String containerIdStr) { ContainerId containerId = null; init(); try { containerId = ContainerId.fromString(containerIdStr); return createRedirectResponse(hsr, redirectWSUrl, redirectURI);
return createRedirectResponse(request, redirectWSUrl, redirectURI); } catch (YarnException ex) { return Response.serverError().entity(ex.getMessage()).build(); final long bytes = parseLongParam(size); final String lastModifiedTime = Times.format(logFile.lastModified()); final String outputFileName = filename;
protected Boolean hasAccess(String user, ApplicationId appId, HttpServletRequest hsr) { // Check for the authorization. UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true); if (callerUGI != null && !(this.nmContext.getApplicationACLsManager() .checkAccess(callerUGI, ApplicationAccessType.VIEW_APP, user, appId))) { return false; } return true; }
@QueryParam(YarnWebServiceParams.RESPONSE_CONTENT_SIZE) String size) { return getLogs(containerIdStr, filename, format, size);
@GET @Path("/info") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public NodeInfo getNodeInfo() { init(); return new NodeInfo(this.nmContext, this.rview); }
@GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public NodeInfo get() { return getNodeInfo(); }
@GET @Path("/info") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public NodeInfo getNodeInfo() { init(); return new NodeInfo(this.nmContext, this.rview); }
@GET @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) public NodeInfo get() { return getNodeInfo(); }
@GET @Path("/info") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public NodeInfo getNodeInfo() { init(); return new NodeInfo(this.nmContext, this.rview); }
@GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public NodeInfo get() { return getNodeInfo(); }
@GET @Path("/apps/{appid}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AppInfo getNodeApp(@PathParam("appid") String appId) { init(); ApplicationId id = WebAppUtils.parseApplicationId(recordFactory, appId); Application app = this.nmContext.getApplications().get(id); if (app == null) { throw new NotFoundException("app with id " + appId + " not found"); } return new AppInfo(app); }
@GET @Path("/apps/{appid}") @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) public AppInfo getNodeApp(@PathParam("appid") String appId) { init(); ApplicationId id = WebAppUtils.parseApplicationId(recordFactory, appId); Application app = this.nmContext.getApplications().get(id); if (app == null) { throw new NotFoundException("app with id " + appId + " not found"); } return new AppInfo(app); }
@GET @Path("/apps/{appid}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AppInfo getNodeApp(@PathParam("appid") String appId) { init(); ApplicationId id = ConverterUtils.toApplicationId(recordFactory, appId); if (id == null) { throw new NotFoundException("app with id " + appId + " not found"); } Application app = this.nmContext.getApplications().get(id); if (app == null) { throw new NotFoundException("app with id " + appId + " not found"); } return new AppInfo(app); }
@GET @Path("/containers") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public ContainersInfo getNodeContainers(@javax.ws.rs.core.Context HttpServletRequest hsr) { init(); ContainersInfo allContainers = new ContainersInfo(); for (Entry<ContainerId, Container> entry : this.nmContext.getContainers() .entrySet()) { if (entry.getValue() == null) { // just skip it continue; } ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue(), uriInfo.getBaseUri().toString(), webapp.name(), hsr.getRemoteUser()); allContainers.add(info); } return allContainers; }
@GET @Path("/apps/{appid}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AppInfo getNodeApp(@PathParam("appid") String appId) { init(); ApplicationId id = ConverterUtils.toApplicationId(recordFactory, appId); if (id == null) { throw new NotFoundException("app with id " + appId + " not found"); } Application app = this.nmContext.getApplications().get(id); if (app == null) { throw new NotFoundException("app with id " + appId + " not found"); } return new AppInfo(app); }
@GET @Path("/containers") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public ContainersInfo getNodeContainers() { init(); ContainersInfo allContainers = new ContainersInfo(); for (Entry<ContainerId, Container> entry : this.nmContext.getContainers() .entrySet()) { if (entry.getValue() == null) { // just skip it continue; } ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue(), uriInfo.getBaseUri().toString(), webapp.name()); allContainers.add(info); } return allContainers; }