java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.webapp.NMWebServices

@Singleton @Path("/ws/v1/node") public class NMWebServices extends Object
  • Constructor Details

    • NMWebServices

      @Inject public NMWebServices(@Named("nm") Context nm, @Named("view") ResourceView view, @Named("webapp") org.apache.hadoop.yarn.webapp.WebApp webapp)
    • NMWebServices

      public NMWebServices(Context nm, ResourceView view, org.apache.hadoop.yarn.webapp.WebApp webapp, javax.servlet.http.HttpServletResponse response)
  • Method Details

    • get

      @GET @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodeInfo get()
    • getNodeInfo

      @GET @Path("/info") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodeInfo getNodeInfo()
    • getNodeApps

      @GET @Path("/apps") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppsInfo getNodeApps(@Context javax.servlet.http.HttpServletRequest hsr, @QueryParam("state") String stateQuery, @QueryParam("user") String userQuery)
    • getNodeApp

      @GET @Path("/apps/{appid}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppInfo getNodeApp(@PathParam("appid") String appId)
    • getNodeContainers

      @GET @Path("/containers") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ContainersInfo getNodeContainers(@Context javax.servlet.http.HttpServletRequest hsr)
    • getNodeContainer

      @GET @Path("/containers/{containerid}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ContainerInfo getNodeContainer(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("containerid") String id)
    • getContainerLogsInfo

      @GET @Path("/containers/{containerid}/logs") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response getContainerLogsInfo(@Context javax.servlet.http.HttpServletRequest hsr, @Context javax.servlet.http.HttpServletResponse res, @PathParam("containerid") String containerIdStr)
      Returns log file's name as well as current file size for a container.
      Parameters:
      hsr - HttpServletRequest
      res - HttpServletResponse
      containerIdStr - The container ID
      Returns:
      The log file's name and current file size
    • getContainerLogFile

      @GET @Path("/containers/{containerid}/logs/{filename}") @Produces("text/plain; charset=utf-8") @Public @Unstable public javax.ws.rs.core.Response getContainerLogFile(@PathParam("containerid") String containerIdStr, @PathParam("filename") String filename, @QueryParam("format") String format, @QueryParam("size") String size)
      Returns the contents of a container's log file in plain text. Only works for containers that are still in the NodeManager's memory, so logs are no longer available after the corresponding application is no longer running.
      Parameters:
      containerIdStr - The container ID
      filename - The name of the log file
      format - The content type
      size - the size of the log file
      Returns:
      The contents of the container's log file
    • getLogs

      @GET @Path("/containerlogs/{containerid}/{filename}") @Produces("text/plain; charset=utf-8") @Public @Unstable public javax.ws.rs.core.Response getLogs(@PathParam("containerid") String containerIdStr, @PathParam("filename") String filename, @QueryParam("format") String format, @QueryParam("size") String size)
      Returns the contents of a container's log file in plain text. Only works for containers that are still in the NodeManager's memory, so logs are no longer available after the corresponding application is no longer running.
      Parameters:
      containerIdStr - The container ID
      filename - The name of the log file
      format - The content type
      size - the size of the log file
      Returns:
      The contents of the container's log file
    • getNMResourceInfo

      @GET @Path("/resources/{resourcename}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NMResourceInfo getNMResourceInfo(@PathParam("resourcename") String resourceName) throws org.apache.hadoop.yarn.exceptions.YarnException
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • getAuxiliaryServices

      @GET @Path("/auxiliaryservices") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AuxiliaryServicesInfo getAuxiliaryServices(@Context javax.servlet.http.HttpServletRequest hsr)
    • putAuxiliaryServices

      @PUT @Path("/auxiliaryservices") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response putAuxiliaryServices(@Context javax.servlet.http.HttpServletRequest req, AuxServiceRecords services)
    • syncYarnSysFS

      @PUT @Path("/yarn/sysfs/{user}/{appId}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response syncYarnSysFS(@Context javax.servlet.http.HttpServletRequest req, @PathParam("user") String user, @PathParam("appId") String appId, String spec)
    • hasAccess

      protected Boolean hasAccess(String user, org.apache.hadoop.yarn.api.records.ApplicationId appId, javax.servlet.http.HttpServletRequest hsr)
    • hasAdminAccess

      protected Boolean hasAdminAccess(javax.servlet.http.HttpServletRequest hsr)