org.apache.hadoop.yarn.server.nodemanager.webapp

## Class NMWebServices

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

-     public class NMWebServices
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NMWebServices(Context nm, ResourceView view, org.apache.hadoop.yarn.webapp.WebApp webapp)`
    `NMWebServices(Context nm, ResourceView view, org.apache.hadoop.yarn.webapp.WebApp webapp, javax.servlet.http.HttpServletResponse response)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `NodeInfo` | `get()`
    `javax.ws.rs.core.Response` | `getContainerLogFile(String containerIdStr, String filename, String format, String size)` Returns the contents of a container's log file in plain text.
    `javax.ws.rs.core.Response` | `getContainerLogsInfo(javax.servlet.http.HttpServletRequest hsr, javax.servlet.http.HttpServletResponse res, String containerIdStr)` Returns log file's name as well as current file size for a container.
    `javax.ws.rs.core.Response` | `getLogs(String containerIdStr, String filename, String format, String size)` Returns the contents of a container's log file in plain text.
    `Object` | `getNMResourceInfo(String resourceName)`
    `AppInfo` | `getNodeApp(String appId)`
    `AppsInfo` | `getNodeApps(javax.servlet.http.HttpServletRequest hsr, String stateQuery, String userQuery)`
    `ContainerInfo` | `getNodeContainer(javax.servlet.http.HttpServletRequest hsr, String id)`
    `ContainersInfo` | `getNodeContainers(javax.servlet.http.HttpServletRequest hsr)`
    `NodeInfo` | `getNodeInfo()`
    `protected Boolean` | `hasAccess(String user, org.apache.hadoop.yarn.api.records.ApplicationId appId, javax.servlet.http.HttpServletRequest hsr)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NMWebServices

          @Inject
          public NMWebServices(Context nm,
                                       ResourceView view,
                                       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 Detail

    - #### get

          public NodeInfo get()

    - #### getNodeInfo

          public NodeInfo getNodeInfo()

    - #### getNodeApps

          public AppsInfo getNodeApps(@Context
                                      javax.servlet.http.HttpServletRequest hsr,
                                      String stateQuery,
                                      String userQuery)

    - #### getNodeApp

          public AppInfo getNodeApp(String appId)

    - #### getNodeContainers

          public ContainersInfo getNodeContainers(@Context
                                                  javax.servlet.http.HttpServletRequest hsr)

    - #### getNodeContainer

          public ContainerInfo getNodeContainer(@Context
                                                javax.servlet.http.HttpServletRequest hsr,
                                                String id)

    - #### getContainerLogsInfo

          public javax.ws.rs.core.Response getContainerLogsInfo(@Context
                                                                javax.servlet.http.HttpServletRequest hsr,
                                                                @Context
                                                                javax.servlet.http.HttpServletResponse res,
                                                                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

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public javax.ws.rs.core.Response getContainerLogFile(String containerIdStr,
                                                                                                                       String filename,
                                                                                                                       String format,
                                                                                                                       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

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public javax.ws.rs.core.Response getLogs(String containerIdStr,
                                                                                                           String filename,
                                                                                                           String format,
                                                                                                           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

          public Object getNMResourceInfo(String resourceName)
                                   throws org.apache.hadoop.yarn.exceptions.YarnException

      Throws:
        `org.apache.hadoop.yarn.exceptions.YarnException`

    - #### hasAccess

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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.