blob: 15b941f9183ea00bc41d9613d36889ed83f8d70e [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at 2021-06-15
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Hadoop 3.3.1 &#x2013; ResourceManager REST APIs.</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20210615" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
<a href="../index.html">Apache Hadoop YARN</a>
&gt;
<a href="index.html">Apache Hadoop 3.3.1</a>
&gt;
ResourceManager REST APIs.
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://gitbox.apache.org/repos/asf/hadoop.git" class="externalLink">git</a>
|
<a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
&nbsp;| Last Published: 2021-06-15
&nbsp;| Version: 3.3.1
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../../index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CommandsManual.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/FileSystemShell.html">FileSystem Shell</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Compatibility.html">Compatibility Specification</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/DownstreamDev.html">Downstream Developer's Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/AdminCompatibilityGuide.html">Admin Compatibility Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/InterfaceClassification.html">Interface Classification</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/filesystem/index.html">FileSystem Specification</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/FairCallQueue.html">Fair Call Queue</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Superusers.html">Proxy User</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/RackAwareness.html">Rack Awareness</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CredentialProviderAPI.html">Credential Provider API</a>
</li>
<li class="none">
<a href="../../hadoop-kms/index.html">Hadoop KMS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Tracing.html">Tracing</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/UnixShellGuide.html">Unix Shell Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/registry/index.html">Registry</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">User Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html">NameNode HA With QJM</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html">NameNode HA With NFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html">Observer NameNode</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ViewFs.html">ViewFs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ViewFsOverloadScheme.html">ViewFsOverloadScheme</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">Snapshots</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">libhdfs (C API)</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS (REST API)</a>
</li>
<li class="none">
<a href="../../hadoop-hdfs-httpfs/index.html">HttpFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">NFS Gateway</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsRollingUpgrade.html">Rolling Upgrade</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html">Extended Attributes</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html">Transparent Encryption</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html">Multihoming</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html">Storage Policies</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/MemoryStorage.html">Memory Storage Support</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/SLGUserGuide.html">Synthetic Load Generator</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSErasureCoding.html">Erasure Coding</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html">Disk Balancer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUpgradeDomain.html">Upgrade Domain</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDataNodeAdminGuide.html">DataNode Admin</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html">Router Federation</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsProvidedStorage.html">Provided Storage</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html">Tutorial</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibility with 1.x</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/SharedCacheSupport.html">Support for YARN Shared Cache</a>
</li>
</ul>
<h5>MapReduce REST APIs</h5>
<ul>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html">MR History Server</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YARN.html">Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html">ResourceManager Restart</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html">ResourceManager HA</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceModel.html">Resource Model</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeLabel.html">Node Labels</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeAttributes.html">Node Attributes</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html">Timeline Server</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html">Timeline Service V.2</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnApplicationSecurity.html">YARN Application Security</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManager.html">NodeManager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/DockerContainers.html">Running Applications in Docker Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/RuncContainers.html">Running Applications in runC Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerCgroups.html">Using CGroups</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/SecureContainer.html">Secure Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ReservationSystem.html">Reservation System</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/GracefulDecommission.html">Graceful Decommission</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/OpportunisticContainers.html">Opportunistic Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/Federation.html">YARN Federation</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/SharedCache.html">Shared Cache</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/UsingGpus.html">Using GPU</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/UsingFPGA.html">Using FPGA</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html">Placement Constraints</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnUI2.html">YARN UI2</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1">Timeline Server</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html#Timeline_Service_v.2_REST_API">Timeline Service V.2</a>
</li>
</ul>
<h5>YARN Service</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Overview.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html">QuickStart</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Concepts.html">Concepts</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html">Yarn Service API</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/ServiceDiscovery.html">Service Discovery</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/SystemServices.html">System Services</a>
</li>
</ul>
<h5>Hadoop Compatible File Systems</h5>
<ul>
<li class="none">
<a href="../../hadoop-aliyun/tools/hadoop-aliyun/index.html">Aliyun OSS</a>
</li>
<li class="none">
<a href="../../hadoop-aws/tools/hadoop-aws/index.html">Amazon S3</a>
</li>
<li class="none">
<a href="../../hadoop-azure/index.html">Azure Blob Storage</a>
</li>
<li class="none">
<a href="../../hadoop-azure-datalake/index.html">Azure Data Lake Storage</a>
</li>
<li class="none">
<a href="../../hadoop-openstack/index.html">OpenStack Swift</a>
</li>
<li class="none">
<a href="../../hadoop-cos/cloud-storage/index.html">Tencent COS</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Tools</h5>
<ul>
<li class="none">
<a href="../../hadoop-streaming/HadoopStreaming.html">Hadoop Streaming</a>
</li>
<li class="none">
<a href="../../hadoop-archives/HadoopArchives.html">Hadoop Archives</a>
</li>
<li class="none">
<a href="../../hadoop-archive-logs/HadoopArchiveLogs.html">Hadoop Archive Logs</a>
</li>
<li class="none">
<a href="../../hadoop-distcp/DistCp.html">DistCp</a>
</li>
<li class="none">
<a href="../../hadoop-gridmix/GridMix.html">GridMix</a>
</li>
<li class="none">
<a href="../../hadoop-rumen/Rumen.html">Rumen</a>
</li>
<li class="none">
<a href="../../hadoop-resourceestimator/ResourceEstimator.html">Resource Estimator Service</a>
</li>
<li class="none">
<a href="../../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Benchmarking.html">Hadoop Benchmarking</a>
</li>
<li class="none">
<a href="../../hadoop-dynamometer/Dynamometer.html">Dynamometer</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/release/">Changelog and Release Notes</a>
</li>
<li class="none">
<a href="../../api/index.html">Java API docs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/UnixShellAPI.html">Unix Shell API</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Metrics.html">Metrics</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs-rbf/hdfs-rbf-default.xml">hdfs-rbf-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-kms/kms-default.html">kms-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-hdfs-httpfs/httpfs-default.html">httpfs-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!---
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<h1>ResourceManager REST API&#x2019;s.</h1>
<ul>
<li><a href="#Overview">Overview</a></li>
<li><a href="#Enabling_CORS_support">Enabling CORS support</a></li>
<li><a href="#Cluster_Information_API">Cluster Information API</a></li>
<li><a href="#Cluster_Metrics_API">Cluster Metrics API</a></li>
<li><a href="#Cluster_Scheduler_API">Cluster Scheduler API</a></li>
<li><a href="#Cluster_Applications_API">Cluster Applications API</a></li>
<li><a href="#Cluster_Application_Statistics_API">Cluster Application Statistics API</a></li>
<li><a href="#Cluster_Application_API">Cluster Application API</a></li>
<li><a href="#Cluster_Application_Attempts_API">Cluster Application Attempts API</a></li>
<li><a href="#Containers_for_an_Application_Attempt_API">Containers for an Application Attempt API</a></li>
<li><a href="#Specific_Container_for_an_Application_Attempt_API">Specific Container for an Application Attempt API</a></li>
<li><a href="#Cluster_Nodes_API">Cluster Nodes API</a></li>
<li><a href="#Cluster_Node_API">Cluster Node API</a></li>
<li><a href="#Cluster_Node_Update_Resource_API">Cluster Node Update Resource API</a></li>
<li><a href="#Cluster_Writeable_APIs">Cluster Writeable APIs</a></li>
<li><a href="#Cluster_New_Application_API">Cluster New Application API</a></li>
<li><a href="#Cluster_Applications_API.28Submit_Application.29">Cluster Applications API(Submit Application)</a></li>
<li><a href="#Cluster_Application_State_API">Cluster Application State API</a></li>
<li><a href="#Cluster_Application_Queue_API">Cluster Application Queue API</a></li>
<li><a href="#Cluster_Application_Priority_API">Cluster Application Priority API</a></li>
<li><a href="#Cluster_Delegation_Tokens_API">Cluster Delegation Tokens API</a></li>
<li><a href="#Cluster_Reservation_API_List">Cluster Reservation API List</a></li>
<li><a href="#Cluster_Reservation_API_Create">Cluster Reservation API Create</a></li>
<li><a href="#Cluster_Reservation_API_Submit">Cluster Reservation API Submit</a></li>
<li><a href="#Cluster_Reservation_API_Update">Cluster Reservation API Update</a></li>
<li><a href="#Cluster_Reservation_API_Delete">Cluster Reservation API Delete</a></li>
<li><a href="#Cluster_Application_Timeouts_API">Cluster Application Timeouts API</a></li>
<li><a href="#Cluster_Application_Timeout_API">Cluster Application Timeout API</a></li>
<li><a href="#Cluster_Application_Timeout_Update_API">Cluster Application Timeout Update API</a></li>
<li><a href="#Scheduler_Configuration_Mutation_API">Scheduler Configuration Mutation API</a></li>
<li><a href="#Cluster_Container_Signal_API">Cluster Container Signal API</a></li>
<li><a href="#Scheduler_Activities_API">Scheduler Activities API</a></li>
<li><a href="#Application_Activities_API">Application Activities API</a></li></ul>
<div class="section">
<h2><a name="Overview"></a>Overview</h2>
<p>The ResourceManager REST API&#x2019;s allow the user to get information about the cluster - status on the cluster, metrics on the cluster, scheduler information, information about nodes in the cluster, and information about applications on the cluster.</p></div>
<div class="section">
<h2><a name="Enabling_CORS_support"></a>Enabling CORS support</h2>
<p>To enable cross-origin support (CORS) for the RM only(without enabling it for the NM), please set the following configuration parameters:</p>
<p>In core-site.xml, add org.apache.hadoop.security.HttpCrossOriginFilterInitializer to hadoop.http.filter.initializers. In yarn-site.xml, set yarn.resourcemanager.webapp.cross-origin.enabled to true.</p></div>
<div class="section">
<h2><a name="Cluster_Information_API"></a>Cluster Information API</h2>
<p>The cluster information resource provides overall information about the cluster.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<p>Both of the following URI&#x2019;s give you the cluster information.</p>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster">http://rm-http-address:port/ws/v1/cluster</a>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/info">http://rm-http-address:port/ws/v1/cluster/info</a></li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_clusterInfo_object"></a>Elements of the <i>clusterInfo</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> id </td>
<td align="left"> long </td>
<td align="left"> The cluster id </td></tr>
<tr class="a">
<td align="left"> startedOn </td>
<td align="left"> long </td>
<td align="left"> The time the cluster started (in ms since epoch) </td></tr>
<tr class="b">
<td align="left"> state </td>
<td align="left"> string </td>
<td align="left"> The ResourceManager state - valid values are: NOTINITED, INITED, STARTED, STOPPED </td></tr>
<tr class="a">
<td align="left"> haState </td>
<td align="left"> string </td>
<td align="left"> The ResourceManager HA state - valid values are: INITIALIZING, ACTIVE, STANDBY, STOPPED </td></tr>
<tr class="b">
<td align="left"> rmStateStoreName </td>
<td align="left"> string </td>
<td align="left"> Fully qualified name of class that implements the storage of ResourceManager state </td></tr>
<tr class="a">
<td align="left"> resourceManagerVersion </td>
<td align="left"> string </td>
<td align="left"> Version of the ResourceManager </td></tr>
<tr class="b">
<td align="left"> resourceManagerBuildVersion </td>
<td align="left"> string </td>
<td align="left"> ResourceManager build string with build version, user, and checksum </td></tr>
<tr class="a">
<td align="left"> resourceManagerVersionBuiltOn </td>
<td align="left"> string </td>
<td align="left"> Timestamp when ResourceManager was built (in ms since epoch) </td></tr>
<tr class="b">
<td align="left"> hadoopVersion </td>
<td align="left"> string </td>
<td align="left"> Version of hadoop common </td></tr>
<tr class="a">
<td align="left"> hadoopBuildVersion </td>
<td align="left"> string </td>
<td align="left"> Hadoop common build string with build version, user, and checksum </td></tr>
<tr class="b">
<td align="left"> hadoopVersionBuiltOn </td>
<td align="left"> string </td>
<td align="left"> Timestamp when hadoop common was built(in ms since epoch) </td></tr>
<tr class="a">
<td align="left"> haZooKeeperConnectionState </td>
<td align="left"> string </td>
<td align="left"> State of ZooKeeper connection of the high availability service </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/info
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;clusterInfo&quot;:
{
&quot;id&quot;:1324053971963,
&quot;startedOn&quot;:1324053971963,
&quot;state&quot;:&quot;STARTED&quot;,
&quot;haState&quot;:&quot;ACTIVE&quot;,
&quot;rmStateStoreName&quot;:&quot;org.apache.hadoop.yarn.server.resourcemanager.recovery.NullRMStateStore&quot;,
&quot;resourceManagerVersion&quot;:&quot;3.0.0-SNAPSHOT&quot;,
&quot;resourceManagerBuildVersion&quot;:&quot;3.0.0-SNAPSHOT from unknown by user1 source checksum 11111111111111111111111111111111&quot;,
&quot;resourceManagerVersionBuiltOn&quot;:&quot;2016-01-01T01:00Z&quot;,
&quot;hadoopVersion&quot;:&quot;3.0.0-SNAPSHOT&quot;,
&quot;hadoopBuildVersion&quot;:&quot;3.0.0-SNAPSHOT from unknown by user1 source checksum 11111111111111111111111111111111&quot;,
&quot;hadoopVersionBuiltOn&quot;:&quot;2016-01-01T01:00Z&quot;,
&quot;haZooKeeperConnectionState&quot;: &quot;ResourceManager HA is not enabled.&quot; }
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
GET http://rm-http-address:port/ws/v1/cluster/info
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 712
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;clusterInfo&gt;
&lt;id&gt;1476912658570&lt;/id&gt;
&lt;startedOn&gt;1476912658570&lt;/startedOn&gt;
&lt;state&gt;STARTED&lt;/state&gt;
&lt;haState&gt;ACTIVE&lt;/haState&gt;
&lt;rmStateStoreName&gt;org.apache.hadoop.yarn.server.resourcemanager.recovery.NullRMStateStore&lt;/rmStateStoreName&gt;
&lt;resourceManagerVersion&gt;3.0.0-SNAPSHOT&lt;/resourceManagerVersion&gt;
&lt;resourceManagerBuildVersion&gt;3.0.0-SNAPSHOT from unknown by user1 source checksum 11111111111111111111111111111111&lt;/resourceManagerBuildVersion&gt;
&lt;resourceManagerVersionBuiltOn&gt;2016-01-01T01:00Z&lt;/resourceManagerVersionBuiltOn&gt;
&lt;hadoopVersion&gt;3.0.0-SNAPSHOT&lt;/hadoopVersion&gt;
&lt;hadoopBuildVersion&gt;3.0.0-SNAPSHOT from unknown by user1 source checksum 11111111111111111111111111111111&lt;/hadoopBuildVersion&gt;
&lt;hadoopVersionBuiltOn&gt;2016-01-01T01:00Z&lt;/hadoopVersionBuiltOn&gt;
&lt;haZooKeeperConnectionState&gt;ResourceManager HA is not enabled.&lt;/haZooKeeperConnectionState&gt;
&lt;/clusterInfo&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Metrics_API"></a>Cluster Metrics API</h2>
<p>The cluster metrics resource provides some overall metrics about the cluster. More detailed metrics should be retrieved from the jmx interface.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/metrics">http://rm-http-address:port/ws/v1/cluster/metrics</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_clusterMetrics_object"></a>Elements of the <i>clusterMetrics</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> appsSubmitted </td>
<td align="left"> int </td>
<td align="left"> The number of applications submitted </td></tr>
<tr class="a">
<td align="left"> appsCompleted </td>
<td align="left"> int </td>
<td align="left"> The number of applications completed </td></tr>
<tr class="b">
<td align="left"> appsPending </td>
<td align="left"> int </td>
<td align="left"> The number of applications pending </td></tr>
<tr class="a">
<td align="left"> appsRunning </td>
<td align="left"> int </td>
<td align="left"> The number of applications running </td></tr>
<tr class="b">
<td align="left"> appsFailed </td>
<td align="left"> int </td>
<td align="left"> The number of applications failed </td></tr>
<tr class="a">
<td align="left"> appsKilled </td>
<td align="left"> int </td>
<td align="left"> The number of applications killed </td></tr>
<tr class="b">
<td align="left"> reservedMB </td>
<td align="left"> long </td>
<td align="left"> The amount of memory reserved in MB </td></tr>
<tr class="a">
<td align="left"> availableMB </td>
<td align="left"> long </td>
<td align="left"> The amount of memory available in MB </td></tr>
<tr class="b">
<td align="left"> allocatedMB </td>
<td align="left"> long </td>
<td align="left"> The amount of memory allocated in MB </td></tr>
<tr class="a">
<td align="left"> totalMB </td>
<td align="left"> long </td>
<td align="left"> The amount of total memory in MB </td></tr>
<tr class="b">
<td align="left"> reservedVirtualCores </td>
<td align="left"> long </td>
<td align="left"> The number of reserved virtual cores </td></tr>
<tr class="a">
<td align="left"> availableVirtualCores </td>
<td align="left"> long </td>
<td align="left"> The number of available virtual cores </td></tr>
<tr class="b">
<td align="left"> allocatedVirtualCores </td>
<td align="left"> long </td>
<td align="left"> The number of allocated virtual cores </td></tr>
<tr class="a">
<td align="left"> totalVirtualCores </td>
<td align="left"> long </td>
<td align="left"> The total number of virtual cores </td></tr>
<tr class="b">
<td align="left"> containersAllocated </td>
<td align="left"> int </td>
<td align="left"> The number of containers allocated </td></tr>
<tr class="a">
<td align="left"> containersReserved </td>
<td align="left"> int </td>
<td align="left"> The number of containers reserved </td></tr>
<tr class="b">
<td align="left"> containersPending </td>
<td align="left"> int </td>
<td align="left"> The number of containers pending </td></tr>
<tr class="a">
<td align="left"> totalNodes </td>
<td align="left"> int </td>
<td align="left"> The total number of nodes </td></tr>
<tr class="b">
<td align="left"> activeNodes </td>
<td align="left"> int </td>
<td align="left"> The number of active nodes </td></tr>
<tr class="a">
<td align="left"> lostNodes </td>
<td align="left"> int </td>
<td align="left"> The number of lost nodes </td></tr>
<tr class="b">
<td align="left"> unhealthyNodes </td>
<td align="left"> int </td>
<td align="left"> The number of unhealthy nodes </td></tr>
<tr class="a">
<td align="left"> decommissioningNodes </td>
<td align="left"> int </td>
<td align="left"> The number of nodes being decommissioned </td></tr>
<tr class="b">
<td align="left"> decommissionedNodes </td>
<td align="left"> int </td>
<td align="left"> The number of nodes decommissioned </td></tr>
<tr class="a">
<td align="left"> rebootedNodes </td>
<td align="left"> int </td>
<td align="left"> The number of nodes rebooted </td></tr>
<tr class="b">
<td align="left"> shutdownNodes </td>
<td align="left"> int </td>
<td align="left"> The number of nodes shut down </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/metrics
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;clusterMetrics&quot;:
{
&quot;appsSubmitted&quot;:0,
&quot;appsCompleted&quot;:0,
&quot;appsPending&quot;:0,
&quot;appsRunning&quot;:0,
&quot;appsFailed&quot;:0,
&quot;appsKilled&quot;:0,
&quot;reservedMB&quot;:0,
&quot;availableMB&quot;:17408,
&quot;allocatedMB&quot;:0,
&quot;reservedVirtualCores&quot;:0,
&quot;availableVirtualCores&quot;:7,
&quot;allocatedVirtualCores&quot;:1,
&quot;containersAllocated&quot;:0,
&quot;containersReserved&quot;:0,
&quot;containersPending&quot;:0,
&quot;totalMB&quot;:17408,
&quot;totalVirtualCores&quot;:8,
&quot;totalNodes&quot;:1,
&quot;lostNodes&quot;:0,
&quot;unhealthyNodes&quot;:0,
&quot;decommissioningNodes&quot;:0,
&quot;decommissionedNodes&quot;:0,
&quot;rebootedNodes&quot;:0,
&quot;activeNodes&quot;:1,
&quot;shutdownNodes&quot;:0
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/metrics
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 432
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;clusterMetrics&gt;
&lt;appsSubmitted&gt;0&lt;/appsSubmitted&gt;
&lt;appsCompleted&gt;0&lt;/appsCompleted&gt;
&lt;appsPending&gt;0&lt;/appsPending&gt;
&lt;appsRunning&gt;0&lt;/appsRunning&gt;
&lt;appsFailed&gt;0&lt;/appsFailed&gt;
&lt;appsKilled&gt;0&lt;/appsKilled&gt;
&lt;reservedMB&gt;0&lt;/reservedMB&gt;
&lt;availableMB&gt;17408&lt;/availableMB&gt;
&lt;allocatedMB&gt;0&lt;/allocatedMB&gt;
&lt;reservedVirtualCores&gt;0&lt;/reservedVirtualCores&gt;
&lt;availableVirtualCores&gt;7&lt;/availableVirtualCores&gt;
&lt;allocatedVirtualCores&gt;1&lt;/allocatedVirtualCores&gt;
&lt;containersAllocated&gt;0&lt;/containersAllocated&gt;
&lt;containersReserved&gt;0&lt;/containersReserved&gt;
&lt;containersPending&gt;0&lt;/containersPending&gt;
&lt;totalMB&gt;17408&lt;/totalMB&gt;
&lt;totalVirtualCores&gt;8&lt;/totalVirtualCores&gt;
&lt;totalNodes&gt;1&lt;/totalNodes&gt;
&lt;lostNodes&gt;0&lt;/lostNodes&gt;
&lt;unhealthyNodes&gt;0&lt;/unhealthyNodes&gt;
&lt;decommissioningNodes&gt;0&lt;/decommissioningNodes&gt;
&lt;decommissionedNodes&gt;0&lt;/decommissionedNodes&gt;
&lt;rebootedNodes&gt;0&lt;/rebootedNodes&gt;
&lt;activeNodes&gt;1&lt;/activeNodes&gt;
&lt;shutdownNodes&gt;0&lt;/shutdownNodes&gt;
&lt;/clusterMetrics&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Scheduler_API"></a>Cluster Scheduler API</h2>
<p>A scheduler resource contains information about the current scheduler configured in a cluster. It currently supports the Fifo, Capacity and Fair Scheduler. You will get different information depending on which scheduler is configured so be sure to look at the type information.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/scheduler">http://rm-http-address:port/ws/v1/cluster/scheduler</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Capacity_Scheduler_API"></a>Capacity Scheduler API</h3>
<p>The capacity scheduler supports hierarchical queues. This one request will print information about all the queues and any subqueues they have. Queues that can actually have jobs submitted to them are referred to as leaf queues. These queues have additional data associated with them.</p></div>
<div class="section">
<h3><a name="Elements_of_the_schedulerInfo_object"></a>Elements of the <i>schedulerInfo</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> type </td>
<td align="left"> string </td>
<td align="left"> Scheduler type - capacityScheduler </td></tr>
<tr class="a">
<td align="left"> capacity </td>
<td align="left"> float </td>
<td align="left"> Configured queue capacity in percentage relative to its parent queue </td></tr>
<tr class="b">
<td align="left"> usedCapacity </td>
<td align="left"> float </td>
<td align="left"> Used queue capacity in percentage </td></tr>
<tr class="a">
<td align="left"> maxCapacity </td>
<td align="left"> float </td>
<td align="left"> Configured maximum queue capacity in percentage relative to its parent queue </td></tr>
<tr class="b">
<td align="left"> queueName </td>
<td align="left"> string </td>
<td align="left"> Name of the queue </td></tr>
<tr class="a">
<td align="left"> queues </td>
<td align="left"> array of queues(JSON)/zero or more queue objects(XML) </td>
<td align="left"> A collection of queue resources </td></tr>
<tr class="b">
<td align="left"> health </td>
<td align="left"> A single health object </td>
<td align="left"> The health metrics of capacity scheduler. This metrics existed since 2.8.0, but the output was not well formatted. Hence users can not make use of this field cleanly, this is optimized from 3.2.0 onwards. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_queues_object_for_a_Parent_queue"></a>Elements of the queues object for a Parent queue</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> capacity </td>
<td align="left"> float </td>
<td align="left"> Configured queue capacity in percentage relative to its parent queue </td></tr>
<tr class="a">
<td align="left"> usedCapacity </td>
<td align="left"> float </td>
<td align="left"> Used queue capacity in percentage </td></tr>
<tr class="b">
<td align="left"> maxCapacity </td>
<td align="left"> float </td>
<td align="left"> Configured maximum queue capacity in percentage relative to its parent queue </td></tr>
<tr class="a">
<td align="left"> absoluteCapacity </td>
<td align="left"> float </td>
<td align="left"> Absolute capacity percentage this queue can use of entire cluster </td></tr>
<tr class="b">
<td align="left"> absoluteMaxCapacity </td>
<td align="left"> float </td>
<td align="left"> Absolute maximum capacity percentage this queue can use of the entire cluster </td></tr>
<tr class="a">
<td align="left"> absoluteUsedCapacity </td>
<td align="left"> float </td>
<td align="left"> Absolute used capacity percentage this queue is using of the entire cluster </td></tr>
<tr class="b">
<td align="left"> numApplications </td>
<td align="left"> int </td>
<td align="left"> The number of applications currently in the queue </td></tr>
<tr class="a">
<td align="left"> usedResources </td>
<td align="left"> string </td>
<td align="left"> A string describing the current resources used by the queue </td></tr>
<tr class="b">
<td align="left"> queueName </td>
<td align="left"> string </td>
<td align="left"> The name of the queue </td></tr>
<tr class="a">
<td align="left"> state </td>
<td align="left"> string of QueueState </td>
<td align="left"> The state of the queue </td></tr>
<tr class="b">
<td align="left"> queues </td>
<td align="left"> array of queues(JSON)/zero or more queue objects(XML) </td>
<td align="left"> A collection of sub-queue information. Omitted if the queue has no sub-queues. </td></tr>
<tr class="a">
<td align="left"> resourcesUsed </td>
<td align="left"> A single resource object </td>
<td align="left"> The total amount of resources used by this queue </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_queues_object_for_a_Leaf_queue_-_contains_all_the_elements_in_parent_except_.E2.80.98queues.E2.80.99_plus_the_following:"></a>Elements of the queues object for a Leaf queue - contains all the elements in parent except &#x2018;queues&#x2019; plus the following:</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> type </td>
<td align="left"> String </td>
<td align="left"> type of the queue - capacitySchedulerLeafQueueInfo </td></tr>
<tr class="a">
<td align="left"> numActiveApplications </td>
<td align="left"> int </td>
<td align="left"> The number of active applications in this queue </td></tr>
<tr class="b">
<td align="left"> numPendingApplications </td>
<td align="left"> int </td>
<td align="left"> The number of pending applications in this queue </td></tr>
<tr class="a">
<td align="left"> numContainers </td>
<td align="left"> int </td>
<td align="left"> The number of containers being used </td></tr>
<tr class="b">
<td align="left"> allocatedContainers </td>
<td align="left"> int </td>
<td align="left"> The number of allocated containers in this queue </td></tr>
<tr class="a">
<td align="left"> reservedContainers </td>
<td align="left"> int </td>
<td align="left"> The number of reserved containers in this queue </td></tr>
<tr class="b">
<td align="left"> pendingContainers </td>
<td align="left"> int </td>
<td align="left"> The number of pending containers in this queue </td></tr>
<tr class="a">
<td align="left"> maxApplications </td>
<td align="left"> int </td>
<td align="left"> The maximum number of applications this queue can have </td></tr>
<tr class="b">
<td align="left"> maxApplicationsPerUser </td>
<td align="left"> int </td>
<td align="left"> The maximum number of applications per user this queue can have </td></tr>
<tr class="a">
<td align="left"> maxActiveApplications </td>
<td align="left"> int </td>
<td align="left"> The maximum number of active applications this queue can have </td></tr>
<tr class="b">
<td align="left"> maxActiveApplicationsPerUser </td>
<td align="left"> int </td>
<td align="left"> The maximum number of active applications per user this queue can have </td></tr>
<tr class="a">
<td align="left"> userLimit </td>
<td align="left"> int </td>
<td align="left"> The minimum user limit percent set in the configuration </td></tr>
<tr class="b">
<td align="left"> userLimitFactor </td>
<td align="left"> float </td>
<td align="left"> The user limit factor set in the configuration </td></tr>
<tr class="a">
<td align="left"> users </td>
<td align="left"> array of users(JSON)/zero or more user objects(XML) </td>
<td align="left"> A collection of user objects containing resources used </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_user_object_for_users:"></a>Elements of the user object for users:</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> username </td>
<td align="left"> String </td>
<td align="left"> The username of the user using the resources </td></tr>
<tr class="a">
<td align="left"> resourcesUsed </td>
<td align="left"> A single resource object </td>
<td align="left"> The amount of resources used by the user in this queue </td></tr>
<tr class="b">
<td align="left"> numActiveApplications </td>
<td align="left"> int </td>
<td align="left"> The number of active applications for this user in this queue </td></tr>
<tr class="a">
<td align="left"> numPendingApplications </td>
<td align="left"> int </td>
<td align="left"> The number of pending applications for this user in this queue </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_resource_object_for_resourcesUsed_in_user_and_queues:"></a>Elements of the resource object for resourcesUsed in user and queues:</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> The amount of memory used (in MB) </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> The number of virtual cores </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_health_object_in_schedulerInfo:"></a>Elements of the health object in schedulerInfo:</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> lastrun </td>
<td align="left"> long </td>
<td align="left"> The time in which application started (in ms since epoch) </td></tr>
<tr class="a">
<td align="left"> operationsInfo </td>
<td align="left"> array of operations(JSON)/operation objects(XML) </td>
<td align="left"> A collection of operation objects </td></tr>
<tr class="b">
<td align="left"> lastRunDetails </td>
<td align="left"> array of lastRunDetails(JSON)/lastRunDetail objects(XML) </td>
<td align="left"> A collection of lastRunDetail objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_operation_object_in_health:"></a>Elements of the operation object in health:</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> operation </td>
<td align="left"> string </td>
<td align="left"> The type of operation </td></tr>
<tr class="a">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> The id of the node to which the operation relates </td></tr>
<tr class="b">
<td align="left"> containerId </td>
<td align="left"> string </td>
<td align="left"> The id of the container to which the operation relates </td></tr>
<tr class="a">
<td align="left"> queue </td>
<td align="left"> string </td>
<td align="left"> The name of the queue to which the operation relates </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_lastRunDetail_object_in_health:"></a>Elements of the lastRunDetail object in health:</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> operation </td>
<td align="left"> string </td>
<td align="left"> The type of operation </td></tr>
<tr class="a">
<td align="left"> count </td>
<td align="left"> long </td>
<td align="left"> The id of the node to which the operation relates </td></tr>
<tr class="b">
<td align="left"> resources </td>
<td align="left"> A single resource object </td>
<td align="left"> The resources to which the operation relates </td></tr>
</tbody>
</table>
<div class="section">
<h4><a name="Response_Examples"></a>Response Examples</h4>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/scheduler
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;scheduler&quot;: {
&quot;schedulerInfo&quot;: {
&quot;capacity&quot;: 100.0,
&quot;maxCapacity&quot;: 100.0,
&quot;queueName&quot;: &quot;root&quot;,
&quot;queues&quot;: {
&quot;queue&quot;: [
{
&quot;absoluteCapacity&quot;: 10.5,
&quot;absoluteMaxCapacity&quot;: 50.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 10.5,
&quot;maxCapacity&quot;: 50.0,
&quot;numApplications&quot;: 0,
&quot;queueName&quot;: &quot;a&quot;,
&quot;queues&quot;: {
&quot;queue&quot;: [
{
&quot;absoluteCapacity&quot;: 3.15,
&quot;absoluteMaxCapacity&quot;: 25.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 30.000002,
&quot;maxCapacity&quot;: 50.0,
&quot;numApplications&quot;: 0,
&quot;queueName&quot;: &quot;a1&quot;,
&quot;queues&quot;: {
&quot;queue&quot;: [
{
&quot;absoluteCapacity&quot;: 2.6775,
&quot;absoluteMaxCapacity&quot;: 25.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 85.0,
&quot;maxActiveApplications&quot;: 1,
&quot;maxActiveApplicationsPerUser&quot;: 1,
&quot;maxApplications&quot;: 267,
&quot;maxApplicationsPerUser&quot;: 267,
&quot;maxCapacity&quot;: 100.0,
&quot;numActiveApplications&quot;: 0,
&quot;numApplications&quot;: 0,
&quot;numContainers&quot;: 0,
&quot;numPendingApplications&quot;: 0,
&quot;queueName&quot;: &quot;a1a&quot;,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;type&quot;: &quot;capacitySchedulerLeafQueueInfo&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;,
&quot;userLimit&quot;: 100,
&quot;userLimitFactor&quot;: 1.0,
&quot;users&quot;: null
},
{
&quot;absoluteCapacity&quot;: 0.47250003,
&quot;absoluteMaxCapacity&quot;: 25.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 15.000001,
&quot;maxActiveApplications&quot;: 1,
&quot;maxActiveApplicationsPerUser&quot;: 1,
&quot;maxApplications&quot;: 47,
&quot;maxApplicationsPerUser&quot;: 47,
&quot;maxCapacity&quot;: 100.0,
&quot;numActiveApplications&quot;: 0,
&quot;numApplications&quot;: 0,
&quot;numContainers&quot;: 0,
&quot;numPendingApplications&quot;: 0,
&quot;queueName&quot;: &quot;a1b&quot;,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;type&quot;: &quot;capacitySchedulerLeafQueueInfo&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;,
&quot;userLimit&quot;: 100,
&quot;userLimitFactor&quot;: 1.0,
&quot;users&quot;: null
}
]
},
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;
},
{
&quot;absoluteCapacity&quot;: 7.35,
&quot;absoluteMaxCapacity&quot;: 50.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 70.0,
&quot;maxActiveApplications&quot;: 1,
&quot;maxActiveApplicationsPerUser&quot;: 100,
&quot;maxApplications&quot;: 735,
&quot;maxApplicationsPerUser&quot;: 73500,
&quot;maxCapacity&quot;: 100.0,
&quot;numActiveApplications&quot;: 0,
&quot;numApplications&quot;: 0,
&quot;numContainers&quot;: 0,
&quot;numPendingApplications&quot;: 0,
&quot;queueName&quot;: &quot;a2&quot;,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;type&quot;: &quot;capacitySchedulerLeafQueueInfo&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;,
&quot;userLimit&quot;: 100,
&quot;userLimitFactor&quot;: 100.0,
&quot;users&quot;: null
}
]
},
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;
},
{
&quot;absoluteCapacity&quot;: 89.5,
&quot;absoluteMaxCapacity&quot;: 100.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 89.5,
&quot;maxCapacity&quot;: 100.0,
&quot;numApplications&quot;: 2,
&quot;queueName&quot;: &quot;b&quot;,
&quot;queues&quot;: {
&quot;queue&quot;: [
{
&quot;absoluteCapacity&quot;: 53.7,
&quot;absoluteMaxCapacity&quot;: 100.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 60.000004,
&quot;maxActiveApplications&quot;: 1,
&quot;maxActiveApplicationsPerUser&quot;: 100,
&quot;maxApplications&quot;: 5370,
&quot;maxApplicationsPerUser&quot;: 537000,
&quot;maxCapacity&quot;: 100.0,
&quot;numActiveApplications&quot;: 1,
&quot;numApplications&quot;: 2,
&quot;numContainers&quot;: 0,
&quot;numPendingApplications&quot;: 1,
&quot;queueName&quot;: &quot;b1&quot;,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;type&quot;: &quot;capacitySchedulerLeafQueueInfo&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;,
&quot;userLimit&quot;: 100,
&quot;userLimitFactor&quot;: 100.0,
&quot;users&quot;: {
&quot;user&quot;: [
{
&quot;numActiveApplications&quot;: 0,
&quot;numPendingApplications&quot;: 1,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;username&quot;: &quot;user2&quot;
},
{
&quot;numActiveApplications&quot;: 1,
&quot;numPendingApplications&quot;: 0,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;username&quot;: &quot;user1&quot;
}
]
}
},
{
&quot;absoluteCapacity&quot;: 35.3525,
&quot;absoluteMaxCapacity&quot;: 100.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 39.5,
&quot;maxActiveApplications&quot;: 1,
&quot;maxActiveApplicationsPerUser&quot;: 100,
&quot;maxApplications&quot;: 3535,
&quot;maxApplicationsPerUser&quot;: 353500,
&quot;maxCapacity&quot;: 100.0,
&quot;numActiveApplications&quot;: 0,
&quot;numApplications&quot;: 0,
&quot;numContainers&quot;: 0,
&quot;numPendingApplications&quot;: 0,
&quot;queueName&quot;: &quot;b2&quot;,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;type&quot;: &quot;capacitySchedulerLeafQueueInfo&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;,
&quot;userLimit&quot;: 100,
&quot;userLimitFactor&quot;: 100.0,
&quot;users&quot;: null
},
{
&quot;absoluteCapacity&quot;: 0.4475,
&quot;absoluteMaxCapacity&quot;: 100.0,
&quot;absoluteUsedCapacity&quot;: 0.0,
&quot;capacity&quot;: 0.5,
&quot;maxActiveApplications&quot;: 1,
&quot;maxActiveApplicationsPerUser&quot;: 100,
&quot;maxApplications&quot;: 44,
&quot;maxApplicationsPerUser&quot;: 4400,
&quot;maxCapacity&quot;: 100.0,
&quot;numActiveApplications&quot;: 0,
&quot;numApplications&quot;: 0,
&quot;numContainers&quot;: 0,
&quot;numPendingApplications&quot;: 0,
&quot;queueName&quot;: &quot;b3&quot;,
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;type&quot;: &quot;capacitySchedulerLeafQueueInfo&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;,
&quot;userLimit&quot;: 100,
&quot;userLimitFactor&quot;: 100.0,
&quot;users&quot;: null
}
]
},
&quot;resourcesUsed&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;state&quot;: &quot;RUNNING&quot;,
&quot;usedCapacity&quot;: 0.0,
&quot;usedResources&quot;: &quot;&lt;memory:0, vCores:0&gt;&quot;
}
]
},
&quot;health&quot;: {
&quot;lastrun&quot;: 1326381444693,
&quot;operationsInfo&quot;: [
{
&quot;operation&quot;: &quot;last-allocation&quot;,
&quot;nodeId&quot;: &quot;N/A&quot;,
&quot;containerId&quot;: &quot;N/A&quot;,
&quot;queue&quot;: &quot;N/A&quot;
},
{
&quot;operation&quot;: &quot;last-release&quot;,
&quot;nodeId&quot;: &quot;host.domain.com:8041&quot;,
&quot;containerId&quot;: &quot;container_1326821518301_0005_01_000001&quot;,
&quot;queue&quot;: &quot;root.default&quot;
},
{
&quot;operation&quot;: &quot;last-preemption&quot;,
&quot;nodeId&quot;: &quot;N/A&quot;,
&quot;containerId&quot;: &quot;N/A&quot;,
&quot;queue&quot;: &quot;N/A&quot;
},
{
&quot;operation&quot;: &quot;last-reservation&quot;,
&quot;nodeId&quot;: &quot;N/A&quot;,
&quot;containerId&quot;: &quot;N/A&quot;,
&quot;queue&quot;: &quot;N/A&quot;
}
],
&quot;lastRunDetails&quot;: [
{
&quot;operation&quot;: &quot;releases&quot;,
&quot;count&quot;: 0,
&quot;resources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
}
},
{
&quot;operation&quot;: &quot;allocations&quot;,
&quot;count&quot;: 0,
&quot;resources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
}
},
{
&quot;operation&quot;: &quot;reservations&quot;,
&quot;count&quot;: 0,
&quot;resources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
}
}
]
},
&quot;type&quot;: &quot;capacityScheduler&quot;,
&quot;usedCapacity&quot;: 0.0
}
}
}
```json
**XML response**
HTTP Request:
Accept: application/xml
GET http://rm-http-address:port/ws/v1/cluster/scheduler
Response Header:
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 5778
Server: Jetty(6.1.26)
Response Body:
```xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;scheduler&gt;
&lt;schedulerInfo xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:type=&quot;capacityScheduler&quot;&gt;
&lt;capacity&gt;100.0&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;queueName&gt;root&lt;/queueName&gt;
&lt;queues&gt;
&lt;queue&gt;
&lt;capacity&gt;10.5&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;50.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;10.5&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;50.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;0&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;a&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;queues&gt;
&lt;queue&gt;
&lt;capacity&gt;30.000002&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;50.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;3.15&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;25.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;0&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;a1&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;queues&gt;
&lt;queue xsi:type=&quot;capacitySchedulerLeafQueueInfo&quot;&gt;
&lt;capacity&gt;85.0&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;2.6775&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;25.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;0&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;a1a&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numActiveApplications&gt;0&lt;/numActiveApplications&gt;
&lt;numPendingApplications&gt;0&lt;/numPendingApplications&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;maxApplications&gt;267&lt;/maxApplications&gt;
&lt;maxApplicationsPerUser&gt;267&lt;/maxApplicationsPerUser&gt;
&lt;maxActiveApplications&gt;1&lt;/maxActiveApplications&gt;
&lt;maxActiveApplicationsPerUser&gt;1&lt;/maxActiveApplicationsPerUser&gt;
&lt;userLimit&gt;100&lt;/userLimit&gt;
&lt;users/&gt;
&lt;userLimitFactor&gt;1.0&lt;/userLimitFactor&gt;
&lt;/queue&gt;
&lt;queue xsi:type=&quot;capacitySchedulerLeafQueueInfo&quot;&gt;
&lt;capacity&gt;15.000001&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;0.47250003&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;25.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;0&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;a1b&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numActiveApplications&gt;0&lt;/numActiveApplications&gt;
&lt;numPendingApplications&gt;0&lt;/numPendingApplications&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;maxApplications&gt;47&lt;/maxApplications&gt;
&lt;maxApplicationsPerUser&gt;47&lt;/maxApplicationsPerUser&gt;
&lt;maxActiveApplications&gt;1&lt;/maxActiveApplications&gt;
&lt;maxActiveApplicationsPerUser&gt;1&lt;/maxActiveApplicationsPerUser&gt;
&lt;userLimit&gt;100&lt;/userLimit&gt;
&lt;users/&gt;
&lt;userLimitFactor&gt;1.0&lt;/userLimitFactor&gt;
&lt;/queue&gt;
&lt;/queues&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;/queue&gt;
&lt;queue xsi:type=&quot;capacitySchedulerLeafQueueInfo&quot;&gt;
&lt;capacity&gt;70.0&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;7.35&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;50.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;0&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;a2&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numActiveApplications&gt;0&lt;/numActiveApplications&gt;
&lt;numPendingApplications&gt;0&lt;/numPendingApplications&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;maxApplications&gt;735&lt;/maxApplications&gt;
&lt;maxApplicationsPerUser&gt;73500&lt;/maxApplicationsPerUser&gt;
&lt;maxActiveApplications&gt;1&lt;/maxActiveApplications&gt;
&lt;maxActiveApplicationsPerUser&gt;100&lt;/maxActiveApplicationsPerUser&gt;
&lt;userLimit&gt;100&lt;/userLimit&gt;
&lt;users/&gt;
&lt;userLimitFactor&gt;100.0&lt;/userLimitFactor&gt;
&lt;/queue&gt;
&lt;/queues&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;/queue&gt;
&lt;queue&gt;
&lt;capacity&gt;89.5&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;89.5&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;100.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;2&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;b&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;queues&gt;
&lt;queue xsi:type=&quot;capacitySchedulerLeafQueueInfo&quot;&gt;
&lt;capacity&gt;60.000004&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;53.7&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;100.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;2&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;b1&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numActiveApplications&gt;1&lt;/numActiveApplications&gt;
&lt;numPendingApplications&gt;1&lt;/numPendingApplications&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;maxApplications&gt;5370&lt;/maxApplications&gt;
&lt;maxApplicationsPerUser&gt;537000&lt;/maxApplicationsPerUser&gt;
&lt;maxActiveApplications&gt;1&lt;/maxActiveApplications&gt;
&lt;maxActiveApplicationsPerUser&gt;100&lt;/maxActiveApplicationsPerUser&gt;
&lt;userLimit&gt;100&lt;/userLimit&gt;
&lt;users&gt;
&lt;user&gt;
&lt;username&gt;user2&lt;/username&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numPendingApplications&gt;1&lt;/numPendingApplications&gt;
&lt;numActiveApplications&gt;0&lt;/numActiveApplications&gt;
&lt;/user&gt;
&lt;user&gt;
&lt;username&gt;user1&lt;/username&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numPendingApplications&gt;0&lt;/numPendingApplications&gt;
&lt;numActiveApplications&gt;1&lt;/numActiveApplications&gt;
&lt;/user&gt;
&lt;/users&gt;
&lt;userLimitFactor&gt;100.0&lt;/userLimitFactor&gt;
&lt;/queue&gt;
&lt;queue xsi:type=&quot;capacitySchedulerLeafQueueInfo&quot;&gt;
&lt;capacity&gt;39.5&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;35.3525&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;100.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;0&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;b2&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numActiveApplications&gt;0&lt;/numActiveApplications&gt;
&lt;numPendingApplications&gt;0&lt;/numPendingApplications&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;maxApplications&gt;3535&lt;/maxApplications&gt;
&lt;maxApplicationsPerUser&gt;353500&lt;/maxApplicationsPerUser&gt;
&lt;maxActiveApplications&gt;1&lt;/maxActiveApplications&gt;
&lt;maxActiveApplicationsPerUser&gt;100&lt;/maxActiveApplicationsPerUser&gt;
&lt;userLimit&gt;100&lt;/userLimit&gt;
&lt;users/&gt;
&lt;userLimitFactor&gt;100.0&lt;/userLimitFactor&gt;
&lt;/queue&gt;
&lt;queue xsi:type=&quot;capacitySchedulerLeafQueueInfo&quot;&gt;
&lt;capacity&gt;0.5&lt;/capacity&gt;
&lt;usedCapacity&gt;0.0&lt;/usedCapacity&gt;
&lt;maxCapacity&gt;100.0&lt;/maxCapacity&gt;
&lt;absoluteCapacity&gt;0.4475&lt;/absoluteCapacity&gt;
&lt;absoluteMaxCapacity&gt;100.0&lt;/absoluteMaxCapacity&gt;
&lt;absoluteUsedCapacity&gt;0.0&lt;/absoluteUsedCapacity&gt;
&lt;numApplications&gt;0&lt;/numApplications&gt;
&lt;usedResources&gt;&amp;lt;memory:0, vCores:0&amp;gt;&lt;/usedResources&gt;
&lt;queueName&gt;b3&lt;/queueName&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;numActiveApplications&gt;0&lt;/numActiveApplications&gt;
&lt;numPendingApplications&gt;0&lt;/numPendingApplications&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;maxApplications&gt;44&lt;/maxApplications&gt;
&lt;maxApplicationsPerUser&gt;4400&lt;/maxApplicationsPerUser&gt;
&lt;maxActiveApplications&gt;1&lt;/maxActiveApplications&gt;
&lt;maxActiveApplicationsPerUser&gt;100&lt;/maxActiveApplicationsPerUser&gt;
&lt;userLimit&gt;100&lt;/userLimit&gt;
&lt;users/&gt;
&lt;userLimitFactor&gt;100.0&lt;/userLimitFactor&gt;
&lt;/queue&gt;
&lt;/queues&gt;
&lt;resourcesUsed&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resourcesUsed&gt;
&lt;/queue&gt;
&lt;/queues&gt;
&lt;health&gt;
&lt;lastrun&gt;1326381444693&lt;/lastrun&gt;
&lt;operationsInfo&gt;
&lt;operation&gt;last-allocation&lt;/operation&gt;
&lt;nodeId&gt;N/A&lt;/nodeId&gt;
&lt;containerId&gt;N/A&lt;/containerId&gt;
&lt;queue&gt;N/A&lt;/queue&gt;
&lt;/operationsInfo&gt;
&lt;operationsInfo&gt;
&lt;operation&gt;last-release&lt;/operation&gt;
&lt;nodeId&gt;host.domain.com:8041&lt;/nodeId&gt;
&lt;containerId&gt;container_1326821518301_0005_01_000001&lt;/containerId&gt;
&lt;queue&gt;root.default&lt;/queue&gt;
&lt;/operationsInfo&gt;
&lt;operationsInfo&gt;
&lt;operation&gt;last-preemption&lt;/operation&gt;
&lt;nodeId&gt;N/A&lt;/nodeId&gt;
&lt;containerId&gt;N/A&lt;/containerId&gt;
&lt;queue&gt;N/A&lt;/queue&gt;
&lt;/operationsInfo&gt;
&lt;operationsInfo&gt;
&lt;operation&gt;last-reservation&lt;/operation&gt;
&lt;nodeId&gt;N/A&lt;/nodeId&gt;
&lt;containerId&gt;N/A&lt;/containerId&gt;
&lt;queue&gt;N/A&lt;/queue&gt;
&lt;/operationsInfo&gt;
&lt;lastRunDetails&gt;
&lt;operation&gt;releases&lt;/operation&gt;
&lt;count&gt;0&lt;/count&gt;
&lt;resources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resources&gt;
&lt;/lastRunDetails&gt;
&lt;lastRunDetails&gt;
&lt;operation&gt;allocations&lt;/operation&gt;
&lt;count&gt;0&lt;/count&gt;
&lt;resources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resources&gt;
&lt;/lastRunDetails&gt;
&lt;lastRunDetails&gt;
&lt;operation&gt;reservations&lt;/operation&gt;
&lt;count&gt;0&lt;/count&gt;
&lt;resources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resources&gt;
&lt;/lastRunDetails&gt;
&lt;/health&gt;
&lt;/schedulerInfo&gt;
&lt;/scheduler&gt;
</pre></div></div>
</div></div>
<div class="section">
<h3><a name="Fifo_Scheduler_API"></a>Fifo Scheduler API</h3></div>
<div class="section">
<h3><a name="Elements_of_the_schedulerInfo_object"></a>Elements of the <i>schedulerInfo</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> type </td>
<td align="left"> string </td>
<td align="left"> Scheduler type - fifoScheduler </td></tr>
<tr class="a">
<td align="left"> capacity </td>
<td align="left"> float </td>
<td align="left"> Queue capacity in percentage </td></tr>
<tr class="b">
<td align="left"> usedCapacity </td>
<td align="left"> float </td>
<td align="left"> Used queue capacity in percentage </td></tr>
<tr class="a">
<td align="left"> qstate </td>
<td align="left"> string </td>
<td align="left"> State of the queue - valid values are: STOPPED, RUNNING </td></tr>
<tr class="b">
<td align="left"> minQueueMemoryCapacity </td>
<td align="left"> int </td>
<td align="left"> Minimum queue memory capacity </td></tr>
<tr class="a">
<td align="left"> maxQueueMemoryCapacity </td>
<td align="left"> int </td>
<td align="left"> Maximum queue memory capacity </td></tr>
<tr class="b">
<td align="left"> numNodes </td>
<td align="left"> int </td>
<td align="left"> The total number of nodes </td></tr>
<tr class="a">
<td align="left"> usedNodeCapacity </td>
<td align="left"> int </td>
<td align="left"> The used node capacity </td></tr>
<tr class="b">
<td align="left"> availNodeCapacity </td>
<td align="left"> int </td>
<td align="left"> The available node capacity </td></tr>
<tr class="a">
<td align="left"> totalNodeCapacity </td>
<td align="left"> int </td>
<td align="left"> The total node capacity </td></tr>
<tr class="b">
<td align="left"> numContainers </td>
<td align="left"> int </td>
<td align="left"> The number of containers </td></tr>
</tbody>
</table>
<div class="section">
<h4><a name="Response_Examples"></a>Response Examples</h4>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/scheduler
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;scheduler&quot;:
{
&quot;schedulerInfo&quot;:
{
&quot;type&quot;:&quot;fifoScheduler&quot;,
&quot;capacity&quot;:1,
&quot;usedCapacity&quot;:&quot;NaN&quot;,
&quot;qstate&quot;:&quot;RUNNING&quot;,
&quot;minQueueMemoryCapacity&quot;:1024,
&quot;maxQueueMemoryCapacity&quot;:10240,
&quot;numNodes&quot;:0,
&quot;usedNodeCapacity&quot;:0,
&quot;availNodeCapacity&quot;:0,
&quot;totalNodeCapacity&quot;:0,
&quot;numContainers&quot;:0
}
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/scheduler
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 432
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;scheduler&gt;
&lt;schedulerInfo xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:type=&quot;fifoScheduler&quot;&gt;
&lt;capacity&gt;1.0&lt;/capacity&gt;
&lt;usedCapacity&gt;NaN&lt;/usedCapacity&gt;
&lt;qstate&gt;RUNNING&lt;/qstate&gt;
&lt;minQueueMemoryCapacity&gt;1024&lt;/minQueueMemoryCapacity&gt;
&lt;maxQueueMemoryCapacity&gt;10240&lt;/maxQueueMemoryCapacity&gt;
&lt;numNodes&gt;0&lt;/numNodes&gt;
&lt;usedNodeCapacity&gt;0&lt;/usedNodeCapacity&gt;
&lt;availNodeCapacity&gt;0&lt;/availNodeCapacity&gt;
&lt;totalNodeCapacity&gt;0&lt;/totalNodeCapacity&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;/schedulerInfo&gt;
&lt;/scheduler&gt;
</pre></div></div>
</div></div>
<div class="section">
<h3><a name="Fair_Scheduler_API"></a>Fair Scheduler API</h3></div>
<div class="section">
<h3><a name="Elements_of_the_schedulerInfo_object"></a>Elements of the <i>schedulerInfo</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> type </td>
<td align="left"> string </td>
<td align="left"> Scheduler type - fairScheduler </td></tr>
<tr class="a">
<td align="left"> rootQueue </td>
<td align="left"> The root queue object </td>
<td align="left"> A collection of root queue resources </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_all_queue_objects"></a>Elements of all queue objects</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> maxApps </td>
<td align="left"> int </td>
<td align="left"> The maximum number of applications the queue can have </td></tr>
<tr class="a">
<td align="left"> minResources </td>
<td align="left"> A single resource object </td>
<td align="left"> The configured minimum resources that are guaranteed to the queue </td></tr>
<tr class="b">
<td align="left"> maxResources </td>
<td align="left"> A single resource object </td>
<td align="left"> The configured maximum resources that are allowed to the queue </td></tr>
<tr class="a">
<td align="left"> usedResources </td>
<td align="left"> A single resource object </td>
<td align="left"> The sum of resources allocated to containers within the queue </td></tr>
<tr class="b">
<td align="left"> fairResources </td>
<td align="left"> A single resource object </td>
<td align="left"> The queue&#x2019;s fair share of resources </td></tr>
<tr class="a">
<td align="left"> clusterResources </td>
<td align="left"> A single resource object </td>
<td align="left"> The capacity of the cluster </td></tr>
<tr class="b">
<td align="left"> queueName </td>
<td align="left"> string </td>
<td align="left"> The name of the queue </td></tr>
<tr class="a">
<td align="left"> schedulingPolicy </td>
<td align="left"> string </td>
<td align="left"> The name of the scheduling policy used by the queue </td></tr>
<tr class="b">
<td align="left"> childQueues </td>
<td align="left"> array of queues(JSON)/queue objects(XML) </td>
<td align="left"> A collection of sub-queue information. Omitted if the queue has no childQueues or is a leaf queue. </td></tr>
<tr class="a">
<td align="left"> allocatedContainers </td>
<td align="left"> int </td>
<td align="left"> The number of allocated containers </td></tr>
<tr class="b">
<td align="left"> demandResources </td>
<td align="left"> A single resource object </td>
<td align="left"> The resources that have been requested by containers in this queue which have not been fulfilled by the scheduler </td></tr>
<tr class="a">
<td align="left"> pendingContainers </td>
<td align="left"> int </td>
<td align="left"> The number of pending containers </td></tr>
<tr class="b">
<td align="left"> preemptable </td>
<td align="left"> boolean </td>
<td align="left"> true if containers in this queue can be preempted </td></tr>
<tr class="a">
<td align="left"> reservedContainers </td>
<td align="left"> int </td>
<td align="left"> The number of reserved containers </td></tr>
<tr class="b">
<td align="left"> steadyFairResources </td>
<td align="left"> A single resource object </td>
<td align="left"> The steady fair share for the queue </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Additional_elements_of_leaf_queue_objects_.28with_the_exception_of_the_.E2.80.98childQueues.E2.80.99_property.29"></a>Additional elements of leaf queue objects (with the exception of the &#x2018;childQueues&#x2019; property)</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> type </td>
<td align="left"> string </td>
<td align="left"> The type of the queue - fairSchedulerLeafQueueInfo </td></tr>
<tr class="a">
<td align="left"> numActiveApps </td>
<td align="left"> int </td>
<td align="left"> The number of active applications in this queue </td></tr>
<tr class="b">
<td align="left"> numPendingApps </td>
<td align="left"> int </td>
<td align="left"> The number of pending applications in this queue </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_.28cluster.2Fdemand.2Ffair.2Fmax.2Fmin.2Fused.2F.2A.29Resources_object_in_queues"></a>Elements of the (cluster/demand/fair/max/min/used/*)Resources object in queues</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> The amount of memory used (in MB) </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> The number of virtual cores </td></tr>
</tbody>
</table>
<div class="section">
<h4><a name="Response_Examples"></a>Response Examples</h4>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/scheduler
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;scheduler&quot;: {
&quot;schedulerInfo&quot;: {
&quot;rootQueue&quot;: {
&quot;allocatedContainers&quot;: 0,
&quot;childQueues&quot;: {
&quot;queue&quot;: [
{
&quot;allocatedContainers&quot;: 0,
&quot;clusterResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;demandResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;fairResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;maxApps&quot;: 2147483647,
&quot;maxResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;minResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;numActiveApps&quot;: 0,
&quot;numPendingApps&quot;: 0,
&quot;pendingContainers&quot;: 0,
&quot;preemptable&quot;: true,
&quot;queueName&quot;: &quot;root.default&quot;,
&quot;reservedContainers&quot;: 0,
&quot;schedulingPolicy&quot;: &quot;fair&quot;,
&quot;steadyFairResources&quot;: {
&quot;memory&quot;: 4096,
&quot;vCores&quot;: 0
},
&quot;type&quot;: &quot;fairSchedulerLeafQueueInfo&quot;,
&quot;usedResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
}
},
{
&quot;allocatedContainers&quot;: 0,
&quot;childQueues&quot;: {
&quot;queue&quot;: [
{
&quot;allocatedContainers&quot;: 0,
&quot;clusterResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;demandResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;fairResources&quot;: {
&quot;memory&quot;: 10000,
&quot;vCores&quot;: 0
},
&quot;maxApps&quot;: 2147483647,
&quot;maxResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;minResources&quot;: {
&quot;memory&quot;: 5000,
&quot;vCores&quot;: 0
},
&quot;numActiveApps&quot;: 0,
&quot;numPendingApps&quot;: 0,
&quot;pendingContainers&quot;: 0,
&quot;preemptable&quot;: true,
&quot;queueName&quot;: &quot;root.sample_queue.sample_sub_queue&quot;,
&quot;reservedContainers&quot;: 0,
&quot;schedulingPolicy&quot;: &quot;fair&quot;,
&quot;steadyFairResources&quot;: {
&quot;memory&quot;: 4096,
&quot;vCores&quot;: 0
},
&quot;type&quot;: &quot;fairSchedulerLeafQueueInfo&quot;,
&quot;usedResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
}
}
]
},
&quot;clusterResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;demandResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;fairResources&quot;: {
&quot;memory&quot;: 10000,
&quot;vCores&quot;: 0
},
&quot;maxApps&quot;: 50,
&quot;maxResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 0
},
&quot;minResources&quot;: {
&quot;memory&quot;: 10000,
&quot;vCores&quot;: 0
},
&quot;pendingContainers&quot;: 0,
&quot;preemptable&quot;: true,
&quot;queueName&quot;: &quot;root.sample_queue&quot;,
&quot;reservedContainers&quot;: 0,
&quot;schedulingPolicy&quot;: &quot;fair&quot;,
&quot;steadyFairResources&quot;: {
&quot;memory&quot;: 4096,
&quot;vCores&quot;: 0
},
&quot;usedResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
}
}
]
},
&quot;clusterResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;demandResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;fairResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;maxApps&quot;: 2147483647,
&quot;maxResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;minResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
},
&quot;pendingContainers&quot;: 0,
&quot;preemptable&quot;: true,
&quot;queueName&quot;: &quot;root&quot;,
&quot;reservedContainers&quot;: 0,
&quot;schedulingPolicy&quot;: &quot;fair&quot;,
&quot;steadyFairResources&quot;: {
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 8
},
&quot;usedResources&quot;: {
&quot;memory&quot;: 0,
&quot;vCores&quot;: 0
}
},
&quot;type&quot;: &quot;fairScheduler&quot;
}
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/scheduler
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 2321
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;scheduler&gt;
&lt;schedulerInfo xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:type=&quot;fairScheduler&quot;&gt;
&lt;rootQueue&gt;
&lt;maxApps&gt;2147483647&lt;/maxApps&gt;
&lt;minResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/minResources&gt;
&lt;maxResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/maxResources&gt;
&lt;usedResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/usedResources&gt;
&lt;demandResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/demandResources&gt;
&lt;steadyFairResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/steadyFairResources&gt;
&lt;fairResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/fairResources&gt;
&lt;clusterResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/clusterResources&gt;
&lt;pendingContainers&gt;0&lt;/pendingContainers&gt;
&lt;allocatedContainers&gt;0&lt;/allocatedContainers&gt;
&lt;reservedContainers&gt;0&lt;/reservedContainers&gt;
&lt;queueName&gt;root&lt;/queueName&gt;
&lt;schedulingPolicy&gt;fair&lt;/schedulingPolicy&gt;
&lt;preemptable&gt;true&lt;/preemptable&gt;
&lt;childQueues&gt;
&lt;queue xsi:type=&quot;fairSchedulerLeafQueueInfo&quot;&gt;
&lt;maxApps&gt;2147483647&lt;/maxApps&gt;
&lt;minResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/minResources&gt;
&lt;maxResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/maxResources&gt;
&lt;usedResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/usedResources&gt;
&lt;demandResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/demandResources&gt;
&lt;steadyFairResources&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/steadyFairResources&gt;
&lt;fairResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/fairResources&gt;
&lt;clusterResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/clusterResources&gt;
&lt;pendingContainers&gt;0&lt;/pendingContainers&gt;
&lt;allocatedContainers&gt;0&lt;/allocatedContainers&gt;
&lt;reservedContainers&gt;0&lt;/reservedContainers&gt;
&lt;queueName&gt;root.default&lt;/queueName&gt;
&lt;schedulingPolicy&gt;fair&lt;/schedulingPolicy&gt;
&lt;preemptable&gt;true&lt;/preemptable&gt;
&lt;numPendingApps&gt;0&lt;/numPendingApps&gt;
&lt;numActiveApps&gt;0&lt;/numActiveApps&gt;
&lt;/queue&gt;
&lt;queue&gt;
&lt;maxApps&gt;50&lt;/maxApps&gt;
&lt;minResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/minResources&gt;
&lt;maxResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/maxResources&gt;
&lt;usedResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/usedResources&gt;
&lt;demandResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/demandResources&gt;
&lt;steadyFairResources&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/steadyFairResources&gt;
&lt;fairResources&gt;
&lt;memory&gt;10000&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/fairResources&gt;
&lt;clusterResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/clusterResources&gt;
&lt;pendingContainers&gt;0&lt;/pendingContainers&gt;
&lt;allocatedContainers&gt;0&lt;/allocatedContainers&gt;
&lt;reservedContainers&gt;0&lt;/reservedContainers&gt;
&lt;queueName&gt;root.sample_queue&lt;/queueName&gt;
&lt;schedulingPolicy&gt;fair&lt;/schedulingPolicy&gt;
&lt;preemptable&gt;true&lt;/preemptable&gt;
&lt;childQueues&gt;
&lt;queue xsi:type=&quot;fairSchedulerLeafQueueInfo&quot;&gt;
&lt;maxApps&gt;2147483647&lt;/maxApps&gt;
&lt;minResources&gt;
&lt;memory&gt;5000&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/minResources&gt;
&lt;maxResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/maxResources&gt;
&lt;usedResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/usedResources&gt;
&lt;demandResources&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/demandResources&gt;
&lt;steadyFairResources&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/steadyFairResources&gt;
&lt;fairResources&gt;
&lt;memory&gt;10000&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/fairResources&gt;
&lt;clusterResources&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;8&lt;/vCores&gt;
&lt;/clusterResources&gt;
&lt;pendingContainers&gt;0&lt;/pendingContainers&gt;
&lt;allocatedContainers&gt;0&lt;/allocatedContainers&gt;
&lt;reservedContainers&gt;0&lt;/reservedContainers&gt;
&lt;queueName&gt;root.sample_queue.sample_sub_queue&lt;/queueName&gt;
&lt;schedulingPolicy&gt;fair&lt;/schedulingPolicy&gt;
&lt;preemptable&gt;true&lt;/preemptable&gt;
&lt;numPendingApps&gt;0&lt;/numPendingApps&gt;
&lt;numActiveApps&gt;0&lt;/numActiveApps&gt;
&lt;/queue&gt;
&lt;/childQueues&gt;
&lt;/queue&gt;
&lt;/childQueues&gt;
&lt;/rootQueue&gt;
&lt;/schedulerInfo&gt;
&lt;/scheduler&gt;
</pre></div></div>
</div></div></div>
<div class="section">
<h2><a name="Cluster_Applications_API"></a>Cluster Applications API</h2>
<p>With the Applications API, you can obtain a collection of resources, each of which represents an application. When you run a GET operation on this resource, you obtain a collection of Application Objects.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps">http://rm-http-address:port/ws/v1/cluster/apps</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<p>Multiple parameters can be specified for GET operations. The started and finished times have a begin and end parameter to allow you to specify ranges. For example, one could request all applications that started between 1:00am and 2:00pm on 12/19/2011 with startedTimeBegin=1324256400&amp;startedTimeEnd=1324303200. If the Begin parameter is not specified, it defaults to 0, and if the End parameter is not specified, it defaults to infinity. All query parameters for this api will filter on all applications. However the <tt>queue</tt> query parameter will only implicitly filter on unfinished applications that are currently in the given queue.</p>
<ul>
<li>state [deprecated] - state of the application
<ul>
<li>states - applications matching the given application states, specified as a comma-separated list.</li>
<li>finalStatus - the final status of the application - reported by the application itself</li>
<li>user - user name</li>
<li>queue - unfinished applications that are currently in this queue</li>
<li>limit - total number of app objects to be returned</li>
<li>startedTimeBegin - applications with start time beginning with this time, specified in ms since epoch</li>
<li>startedTimeEnd - applications with start time ending with this time, specified in ms since epoch</li>
<li>finishedTimeBegin - applications with finish time beginning with this time, specified in ms since epoch</li>
<li>finishedTimeEnd - applications with finish time ending with this time, specified in ms since epoch</li>
<li>applicationTypes - applications matching the given application types, specified as a comma-separated list.</li>
<li>applicationTags - applications matching any of the given application tags, specified as a comma-separated list.</li>
<li>name - name of the application</li>
<li>deSelects - a generic fields which will be skipped in the result.</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_apps_.28Applications.29_object"></a>Elements of the <i>apps</i> (Applications) object</h3>
<p>When you make a request for the list of applications, the information will be returned as a collection of app objects. See also <a href="#Application_API">Application API</a> for syntax of the app object.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> app </td>
<td align="left"> array of app objects(JSON)/zero or more application objects(XML) </td>
<td align="left"> The collection of application objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_deSelects_parameter"></a>Elements of the <i>deSelects</i> parameter</h3>
<p>Help requesters who don&#x2019;t need certain information to reduce the overhead.</p>
<p>Current supported items:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> resouceRequests </td>
<td align="left"> comma separated string </td>
<td align="left"> Skip resource requests of application in return </td></tr>
</tbody>
</table>
<p>e.g:</p>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps?deSelects=resouceRequests">http://rm-http-address:port/ws/v1/cluster/apps?deSelects=resouceRequests</a></li>
</ul></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;apps&quot;:
{
&quot;app&quot;:
[
{
&quot;id&quot;: &quot;application_1476912658570_0002&quot;,
&quot;user&quot;: &quot;user2&quot;,
&quot;name&quot;: &quot;word count&quot;,
&quot;queue&quot;: &quot;default&quot;,
&quot;state&quot;: &quot;FINISHED&quot;,
&quot;finalStatus&quot;: &quot;SUCCEEDED&quot;,
&quot;progress&quot;: 100,
&quot;trackingUI&quot;: &quot;History&quot;,
&quot;trackingUrl&quot;: &quot;http://host.domain.com:8088/cluster/app/application_1476912658570_0002&quot;,
&quot;diagnostics&quot;: &quot;...&quot;,
&quot;clusterId&quot;: 1476912658570,
&quot;applicationType&quot;: &quot;MAPREDUCE&quot;,
&quot;applicationTags&quot;: &quot;&quot;,
&quot;priority&quot;: -1,
&quot;startedTime&quot;: 1476913457320,
&quot;finishedTime&quot;: 1476913761898,
&quot;elapsedTime&quot;: 304578,
&quot;amContainerLogs&quot;: &quot;http://host.domain.com:8042/node/containerlogs/container_1476912658570_0002_02_000001/user2&quot;,
&quot;amHostHttpAddress&quot;: &quot;host.domain.com:8042&quot;,
&quot;allocatedMB&quot;: 0,
&quot;allocatedVCores&quot;: 0,
&quot;runningContainers&quot;: 0,
&quot;memorySeconds&quot;: 206464,
&quot;vcoreSeconds&quot;: 201,
&quot;queueUsagePercentage&quot;: 0,
&quot;clusterUsagePercentage&quot;: 0,
&quot;preemptedResourceMB&quot;: 0,
&quot;preemptedResourceVCores&quot;: 0,
&quot;numNonAMContainerPreempted&quot;: 0,
&quot;numAMContainerPreempted&quot;: 0,
&quot;logAggregationStatus&quot;: &quot;DISABLED&quot;,
&quot;unmanagedApplication&quot;: false,
&quot;appNodeLabelExpression&quot;: &quot;&quot;,
&quot;amNodeLabelExpression&quot;: &quot;&quot;,
&quot;resourceRequests&quot;: [
{
&quot;capability&quot;: {
&quot;memory&quot;: 4096,
&quot;virtualCores&quot;: 1
},
&quot;nodeLabelExpression&quot;: &quot;&quot;,
&quot;numContainers&quot;: 0,
&quot;priority&quot;: {
&quot;priority&quot;: 0
},
&quot;relaxLocality&quot;: true,
&quot;resourceName&quot;: &quot;*&quot;
},
{
&quot;capability&quot;: {
&quot;memory&quot;: 4096,
&quot;virtualCores&quot;: 1
},
&quot;nodeLabelExpression&quot;: &quot;&quot;,
&quot;numContainers&quot;: 0,
&quot;priority&quot;: {
&quot;priority&quot;: 20
},
&quot;relaxLocality&quot;: true,
&quot;resourceName&quot;: &quot;host1.domain.com&quot;
},
{
&quot;capability&quot;: {
&quot;memory&quot;: 4096,
&quot;virtualCores&quot;: 1
},
&quot;nodeLabelExpression&quot;: &quot;&quot;,
&quot;numContainers&quot;: 0,
&quot;priority&quot;: {
&quot;priority&quot;: 20
},
&quot;relaxLocality&quot;: true,
&quot;resourceName&quot;: &quot;host2.domain.com&quot;
}]
},
{
&quot;id&quot;: &quot;application_1476912658570_0001&quot;,
&quot;user&quot;: &quot;user1&quot;,
&quot;name&quot;: &quot;Sleep job&quot;,
&quot;queue&quot;: &quot;default&quot;,
&quot;state&quot;: &quot;FINISHED&quot;,
&quot;finalStatus&quot;: &quot;SUCCEEDED&quot;,
&quot;progress&quot;: 100,
&quot;trackingUI&quot;: &quot;History&quot;,
&quot;trackingUrl&quot;: &quot;http://host.domain.com:8088/cluster/app/application_1476912658570_0001&quot;,
&quot;diagnostics&quot;: &quot;...&quot;,
&quot;clusterId&quot;: 1476912658570,
&quot;applicationType&quot;: &quot;YARN&quot;,
&quot;applicationTags&quot;: &quot;&quot;,
&quot;priority&quot;: -1,
&quot;startedTime&quot;: 1476913464750,
&quot;finishedTime&quot;: 1476913863175,
&quot;elapsedTime&quot;: 398425,
&quot;amContainerLogs&quot;: &quot;http://host.domain.com:8042/node/containerlogs/container_1476912658570_0001_02_000001/user1&quot;,
&quot;amHostHttpAddress&quot;: &quot;host.domain.com:8042&quot;,
&quot;allocatedMB&quot;: 0,
&quot;allocatedVCores&quot;: 0,
&quot;runningContainers&quot;: 0,
&quot;memorySeconds&quot;: 205410,
&quot;vcoreSeconds&quot;: 200,
&quot;queueUsagePercentage&quot;: 0,
&quot;clusterUsagePercentage&quot;: 0,
&quot;preemptedResourceMB&quot;: 0,
&quot;preemptedResourceVCores&quot;: 0,
&quot;numNonAMContainerPreempted&quot;: 0,
&quot;numAMContainerPreempted&quot;: 0,
&quot;logAggregationStatus&quot;: &quot;DISABLED&quot;,
&quot;unmanagedApplication&quot;: false,
&quot;appNodeLabelExpression&quot;: &quot;&quot;,
&quot;amNodeLabelExpression&quot;: &quot;&quot;,
&quot;resourceRequests&quot;: [
{
&quot;capability&quot;: {
&quot;memory&quot;: 4096,
&quot;virtualCores&quot;: 1
},
&quot;nodeLabelExpression&quot;: &quot;&quot;,
&quot;numContainers&quot;: 0,
&quot;priority&quot;: {
&quot;priority&quot;: 0
},
&quot;relaxLocality&quot;: true,
&quot;resourceName&quot;: &quot;*&quot;
},
{
&quot;capability&quot;: {
&quot;memory&quot;: 4096,
&quot;virtualCores&quot;: 1
},
&quot;nodeLabelExpression&quot;: &quot;&quot;,
&quot;numContainers&quot;: 0,
&quot;priority&quot;: {
&quot;priority&quot;: 20
},
&quot;relaxLocality&quot;: true,
&quot;resourceName&quot;: &quot;host3.domain.com&quot;
},
{
&quot;capability&quot;: {
&quot;memory&quot;: 4096,
&quot;virtualCores&quot;: 1
},
&quot;nodeLabelExpression&quot;: &quot;&quot;,
&quot;numContainers&quot;: 0,
&quot;priority&quot;: {
&quot;priority&quot;: 20
},
&quot;relaxLocality&quot;: true,
&quot;resourceName&quot;: &quot;host4.domain.com&quot;
}]
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 2459
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;apps&gt;
&lt;app&gt;
&lt;id&gt;application_1476912658570_0002&lt;/id&gt;
&lt;user&gt;user2&lt;/user&gt;
&lt;name&gt;word count&lt;/name&gt;
&lt;queue&gt;default&lt;/queue&gt;
&lt;state&gt;FINISHED&lt;/state&gt;
&lt;finalStatus&gt;SUCCEEDED&lt;/finalStatus&gt;
&lt;progress&gt;100.0&lt;/progress&gt;
&lt;trackingUI&gt;History&lt;/trackingUI&gt;
&lt;trackingUrl&gt;http://host.domain.com:8088/cluster/app/application_1476912658570_0002&lt;/trackingUrl&gt;
&lt;diagnostics&gt;...&lt;/diagnostics&gt;
&lt;clusterId&gt;1476912658570&lt;/clusterId&gt;
&lt;applicationType&gt;YARN&lt;/applicationType&gt;
&lt;applicationTags&gt;&lt;/applicationTags&gt;
&lt;priority&gt;-1&lt;/priority&gt;
&lt;startedTime&gt;1476913457320&lt;/startedTime&gt;
&lt;finishedTime&gt;1476913761898&lt;/finishedTime&gt;
&lt;elapsedTime&gt;304578&lt;/elapsedTime&gt;
&lt;amContainerLogs&gt;http://host.domain.com:8042/node/containerlogs/container_1476912658570_0002_02_000001/user2&lt;/amContainerLogs&gt;
&lt;amHostHttpAddress&gt;host.domain.com:8042&lt;/amHostHttpAddress&gt;
&lt;allocatedMB&gt;-1&lt;/allocatedMB&gt;
&lt;allocatedVCores&gt;-1&lt;/allocatedVCores&gt;
&lt;runningContainers&gt;-1&lt;/runningContainers&gt;
&lt;memorySeconds&gt;206464&lt;/memorySeconds&gt;
&lt;vcoreSeconds&gt;201&lt;/vcoreSeconds&gt;
&lt;queueUsagePercentage&gt;0.0&lt;/queueUsagePercentage&gt;
&lt;clusterUsagePercentage&gt;0.0&lt;/clusterUsagePercentage&gt;
&lt;preemptedResourceMB&gt;0&lt;/preemptedResourceMB&gt;
&lt;preemptedResourceVCores&gt;0&lt;/preemptedResourceVCores&gt;
&lt;numNonAMContainerPreempted&gt;0&lt;/numNonAMContainerPreempted&gt;
&lt;numAMContainerPreempted&gt;0&lt;/numAMContainerPreempted&gt;
&lt;logAggregationStatus&gt;DISABLED&lt;/logAggregationStatus&gt;
&lt;unmanagedApplication&gt;false&lt;/unmanagedApplication&gt;
&lt;appNodeLabelExpression&gt;&lt;/appNodeLabelExpression&gt;
&lt;amNodeLabelExpression&gt;&lt;/amNodeLabelExpression&gt;
&lt;resourceRequests&gt;
&lt;capability&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;virtualCores&gt;1&lt;/virtualCores&gt;
&lt;/capability&gt;
&lt;nodeLabelExpression/&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;priority&gt;
&lt;priority&gt;0&lt;/priority&gt;
&lt;/priority&gt;
&lt;relaxLocality&gt;true&lt;/relaxLocality&gt;
&lt;resourceName&gt;*&lt;/resourceName&gt;
&lt;/resourceRequests&gt;
&lt;resourceRequests&gt;
&lt;capability&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;virtualCores&gt;1&lt;/virtualCores&gt;
&lt;/capability&gt;
&lt;nodeLabelExpression/&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;priority&gt;
&lt;priority&gt;20&lt;/priority&gt;
&lt;/priority&gt;
&lt;relaxLocality&gt;true&lt;/relaxLocality&gt;
&lt;resourceName&gt;host1.domain.com&lt;/resourceName&gt;
&lt;/resourceRequests&gt;
&lt;resourceRequests&gt;
&lt;capability&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;virtualCores&gt;1&lt;/virtualCores&gt;
&lt;/capability&gt;
&lt;nodeLabelExpression/&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;priority&gt;
&lt;priority&gt;20&lt;/priority&gt;
&lt;/priority&gt;
&lt;relaxLocality&gt;true&lt;/relaxLocality&gt;
&lt;resourceName&gt;host2.domain.com&lt;/resourceName&gt;
&lt;/resourceRequests&gt;
&lt;/app&gt;
&lt;app&gt;
&lt;id&gt;application_1476912658570_0001&lt;/id&gt;
&lt;user&gt;user1&lt;/user&gt;
&lt;name&gt;Sleep job&lt;/name&gt;
&lt;queue&gt;default&lt;/queue&gt;
&lt;state&gt;FINISHED&lt;/state&gt;
&lt;finalStatus&gt;SUCCEEDED&lt;/finalStatus&gt;
&lt;progress&gt;100.0&lt;/progress&gt;
&lt;trackingUI&gt;History&lt;/trackingUI&gt;
&lt;trackingUrl&gt;http://host.domain.com:8088/cluster/app/application_1476912658570_0001&lt;/trackingUrl&gt;
&lt;diagnostics&gt;...&lt;/diagnostics&gt;
&lt;clusterId&gt;1476912658570&lt;/clusterId&gt;
&lt;applicationType&gt;YARN&lt;/applicationType&gt;
&lt;applicationTags&gt;&lt;/applicationTags&gt;
&lt;priority&gt;-1&lt;/priority&gt;
&lt;startedTime&gt;1476913464750&lt;/startedTime&gt;
&lt;finishedTime&gt;1476913863175&lt;/finishedTime&gt;
&lt;elapsedTime&gt;398425&lt;/elapsedTime&gt;
&lt;amContainerLogs&gt;http://host.domain.com:8042/node/containerlogs/container_1476912658570_0001_02_000001/user1&lt;/amContainerLogs&gt;
&lt;amHostHttpAddress&gt;host.domain.com:8042&lt;/amHostHttpAddress&gt;
&lt;allocatedMB&gt;-1&lt;/allocatedMB&gt;
&lt;allocatedVCores&gt;-1&lt;/allocatedVCores&gt;
&lt;runningContainers&gt;-1&lt;/runningContainers&gt;
&lt;memorySeconds&gt;205410&lt;/memorySeconds&gt;
&lt;vcoreSeconds&gt;200&lt;/vcoreSeconds&gt;
&lt;queueUsagePercentage&gt;0.0&lt;/queueUsagePercentage&gt;
&lt;clusterUsagePercentage&gt;0.0&lt;/clusterUsagePercentage&gt;
&lt;preemptedResourceMB&gt;0&lt;/preemptedResourceMB&gt;
&lt;preemptedResourceVCores&gt;0&lt;/preemptedResourceVCores&gt;
&lt;numNonAMContainerPreempted&gt;0&lt;/numNonAMContainerPreempted&gt;
&lt;numAMContainerPreempted&gt;0&lt;/numAMContainerPreempted&gt;
&lt;logAggregationStatus&gt;DISABLED&lt;/logAggregationStatus&gt;
&lt;unmanagedApplication&gt;false&lt;/unmanagedApplication&gt;
&lt;appNodeLabelExpression&gt;&lt;/appNodeLabelExpression&gt;
&lt;amNodeLabelExpression&gt;&lt;/amNodeLabelExpression&gt;
&lt;resourceRequests&gt;
&lt;capability&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;virtualCores&gt;1&lt;/virtualCores&gt;
&lt;/capability&gt;
&lt;nodeLabelExpression/&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;priority&gt;
&lt;priority&gt;0&lt;/priority&gt;
&lt;/priority&gt;
&lt;relaxLocality&gt;true&lt;/relaxLocality&gt;
&lt;resourceName&gt;*&lt;/resourceName&gt;
&lt;/resourceRequests&gt;
&lt;resourceRequests&gt;
&lt;capability&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;virtualCores&gt;1&lt;/virtualCores&gt;
&lt;/capability&gt;
&lt;nodeLabelExpression/&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;priority&gt;
&lt;priority&gt;20&lt;/priority&gt;
&lt;/priority&gt;
&lt;relaxLocality&gt;true&lt;/relaxLocality&gt;
&lt;resourceName&gt;host1.domain.com&lt;/resourceName&gt;
&lt;/resourceRequests&gt;
&lt;resourceRequests&gt;
&lt;capability&gt;
&lt;memory&gt;4096&lt;/memory&gt;
&lt;virtualCores&gt;1&lt;/virtualCores&gt;
&lt;/capability&gt;
&lt;nodeLabelExpression/&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;priority&gt;
&lt;priority&gt;20&lt;/priority&gt;
&lt;/priority&gt;
&lt;relaxLocality&gt;true&lt;/relaxLocality&gt;
&lt;resourceName&gt;host2.domain.com&lt;/resourceName&gt;
&lt;/resourceRequests&gt;
&lt;/app&gt;
&lt;/apps&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Application_Statistics_API"></a>Cluster Application Statistics API</h2>
<p>With the Application Statistics API, you can obtain a collection of triples, each of which contains the application type, the application state and the number of applications of this type and this state in ResourceManager context. Note that with the performance concern, we currently only support at most one applicationType per query. We may support multiple applicationTypes per query as well as more statistics in the future. When you run a GET operation on this resource, you obtain a collection of statItem objects.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/appstatistics">http://rm-http-address:port/ws/v1/cluster/appstatistics</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Required"></a>Query Parameters Required</h3>
<p>Two paramters can be specified. The parameters are case insensitive.</p>
<ul>
<li>states - states of the applications, specified as a comma-separated list. If states is not provided, the API will enumerate all application states and return the counts of them.
<ul>
<li>applicationTypes - types of the applications, specified as a comma-separated list. If applicationTypes is not provided, the API will count the applications of any application type. In this case, the response shows * to indicate any application type. Note that we only support at most one applicationType temporarily. Otherwise, users will expect an BadRequestException.</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_appStatInfo_.28statItems.29_object"></a>Elements of the <i>appStatInfo</i> (statItems) object</h3>
<p>When you make a request for the list of statistics items, the information will be returned as a collection of statItem objects</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> statItem </td>
<td align="left"> array of statItem objects(JSON)/zero or more statItem objects(XML) </td>
<td align="left"> The collection of statItem objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/appstatistics?states=accepted,running,finished&amp;applicationTypes=mapreduce
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;appStatInfo&quot;:
{
&quot;statItem&quot;:
[
{
&quot;state&quot; : &quot;accepted&quot;,
&quot;type&quot; : &quot;mapreduce&quot;,
&quot;count&quot; : 4
},
{
&quot;state&quot; : &quot;running&quot;,
&quot;type&quot; : &quot;mapreduce&quot;,
&quot;count&quot; : 1
},
{
&quot;state&quot; : &quot;finished&quot;,
&quot;type&quot; : &quot;mapreduce&quot;,
&quot;count&quot; : 7
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/appstatistics?states=accepted,running,finished&amp;applicationTypes=mapreduce
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 2459
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appStatInfo&gt;
&lt;statItem&gt;
&lt;state&gt;accepted&lt;/state&gt;
&lt;type&gt;mapreduce&lt;/type&gt;
&lt;count&gt;4&lt;/count&gt;
&lt;/statItem&gt;
&lt;statItem&gt;
&lt;state&gt;running&lt;/state&gt;
&lt;type&gt;mapreduce&lt;/type&gt;
&lt;count&gt;1&lt;/count&gt;
&lt;/statItem&gt;
&lt;statItem&gt;
&lt;state&gt;finished&lt;/state&gt;
&lt;type&gt;mapreduce&lt;/type&gt;
&lt;count&gt;7&lt;/count&gt;
&lt;/statItem&gt;
&lt;/appStatInfo&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Application_API"></a>Cluster Application API</h2>
<p>An application resource contains information about a particular application that was submitted to a cluster.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<p>Use the following URI to obtain an app object, from a application identified by the appid value.</p>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}">http://rm-http-address:port/ws/v1/cluster/apps/{appid}</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_app_.28Application.29_object"></a>Elements of the <i>app</i> (Application) object</h3>
<p>Note that depending on security settings a user might not be able to see all the fields.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> id </td>
<td align="left"> string </td>
<td align="left"> The application id </td></tr>
<tr class="a">
<td align="left"> user </td>
<td align="left"> string </td>
<td align="left"> The user who started the application </td></tr>
<tr class="b">
<td align="left"> name </td>
<td align="left"> string </td>
<td align="left"> The application name </td></tr>
<tr class="a">
<td align="left"> queue </td>
<td align="left"> string </td>
<td align="left"> The queue the application was submitted to </td></tr>
<tr class="b">
<td align="left"> state </td>
<td align="left"> string </td>
<td align="left"> The application state according to the ResourceManager - valid values are members of the YarnApplicationState enum: NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED </td></tr>
<tr class="a">
<td align="left"> finalStatus </td>
<td align="left"> string </td>
<td align="left"> The final status of the application if finished - reported by the application itself - valid values are the members of the FinalApplicationStatus enum: UNDEFINED, SUCCEEDED, FAILED, KILLED </td></tr>
<tr class="b">
<td align="left"> progress </td>
<td align="left"> float </td>
<td align="left"> The progress of the application as a percent </td></tr>
<tr class="a">
<td align="left"> trackingUI </td>
<td align="left"> string </td>
<td align="left"> Where the tracking url is currently pointing - History (for history server) or ApplicationMaster </td></tr>
<tr class="b">
<td align="left"> trackingUrl </td>
<td align="left"> string </td>
<td align="left"> The web URL that can be used to track the application </td></tr>
<tr class="a">
<td align="left"> diagnostics </td>
<td align="left"> string </td>
<td align="left"> Detailed diagnostics information </td></tr>
<tr class="b">
<td align="left"> clusterId </td>
<td align="left"> long </td>
<td align="left"> The cluster id </td></tr>
<tr class="a">
<td align="left"> applicationType </td>
<td align="left"> string </td>
<td align="left"> The application type </td></tr>
<tr class="b">
<td align="left"> applicationTags </td>
<td align="left"> string </td>
<td align="left"> Comma separated tags of an application </td></tr>
<tr class="a">
<td align="left"> priority </td>
<td align="left"> string </td>
<td align="left"> Priority of the submitted application </td></tr>
<tr class="b">
<td align="left"> startedTime </td>
<td align="left"> long </td>
<td align="left"> The time in which application started (in ms since epoch) </td></tr>
<tr class="a">
<td align="left"> finishedTime </td>
<td align="left"> long </td>
<td align="left"> The time in which the application finished (in ms since epoch) </td></tr>
<tr class="b">
<td align="left"> elapsedTime </td>
<td align="left"> long </td>
<td align="left"> The elapsed time since the application started (in ms) </td></tr>
<tr class="a">
<td align="left"> amContainerLogs </td>
<td align="left"> string </td>
<td align="left"> The URL of the application master container logs </td></tr>
<tr class="b">
<td align="left"> amHostHttpAddress </td>
<td align="left"> string </td>
<td align="left"> The nodes http address of the application master </td></tr>
<tr class="a">
<td align="left"> amRPCAddress </td>
<td align="left"> string </td>
<td align="left"> The RPC address of the application master </td></tr>
<tr class="b">
<td align="left"> allocatedMB </td>
<td align="left"> int </td>
<td align="left"> The sum of memory in MB allocated to the application&#x2019;s running containers </td></tr>
<tr class="a">
<td align="left"> allocatedVCores </td>
<td align="left"> int </td>
<td align="left"> The sum of virtual cores allocated to the application&#x2019;s running containers </td></tr>
<tr class="b">
<td align="left"> runningContainers </td>
<td align="left"> int </td>
<td align="left"> The number of containers currently running for the application </td></tr>
<tr class="a">
<td align="left"> memorySeconds </td>
<td align="left"> long </td>
<td align="left"> The amount of memory the application has allocated (megabyte-seconds) </td></tr>
<tr class="b">
<td align="left"> vcoreSeconds </td>
<td align="left"> long </td>
<td align="left"> The amount of CPU resources the application has allocated (virtual core-seconds) </td></tr>
<tr class="a">
<td align="left"> queueUsagePercentage </td>
<td align="left"> float </td>
<td align="left"> The percentage of resources of the queue that the app is using </td></tr>
<tr class="b">
<td align="left"> clusterUsagePercentage </td>
<td align="left"> float </td>
<td align="left"> The percentage of resources of the cluster that the app is using. </td></tr>
<tr class="a">
<td align="left"> preemptedResourceMB </td>
<td align="left"> long </td>
<td align="left"> Memory used by preempted container </td></tr>
<tr class="b">
<td align="left"> preemptedResourceVCores </td>
<td align="left"> long </td>
<td align="left"> Number of virtual cores used by preempted container </td></tr>
<tr class="a">
<td align="left"> numNonAMContainerPreempted </td>
<td align="left"> int </td>
<td align="left"> Number of standard containers preempted </td></tr>
<tr class="b">
<td align="left"> numAMContainerPreempted </td>
<td align="left"> int </td>
<td align="left"> Number of application master containers preempted </td></tr>
<tr class="a">
<td align="left"> logAggregationStatus </td>
<td align="left"> string </td>
<td align="left"> Status of log aggregation - valid values are the members of the LogAggregationStatus enum: DISABLED, NOT_START, RUNNING, RUNNING_WITH_FAILURE, SUCCEEDED, FAILED, TIME_OUT </td></tr>
<tr class="b">
<td align="left"> unmanagedApplication </td>
<td align="left"> boolean </td>
<td align="left"> Is the application unmanaged. </td></tr>
<tr class="a">
<td align="left"> appNodeLabelExpression </td>
<td align="left"> string </td>
<td align="left"> Node Label expression which is used to identify the nodes on which application&#x2019;s containers are expected to run by default.</td></tr>
<tr class="b">
<td align="left"> amNodeLabelExpression </td>
<td align="left"> string </td>
<td align="left"> Node Label expression which is used to identify the node on which application&#x2019;s AM container is expected to run.</td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1476912658570_0002
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;app&quot;: {
&quot;id&quot;: &quot;application_1476912658570_0002&quot;,
&quot;user&quot;: &quot;user2&quot;,
&quot;name&quot;: &quot;word count&quot;,
&quot;queue&quot;: &quot;default&quot;,
&quot;state&quot;: &quot;FINISHED&quot;,
&quot;finalStatus&quot;: &quot;SUCCEEDED&quot;,
&quot;progress&quot;: 100,
&quot;trackingUI&quot;: &quot;History&quot;,
&quot;trackingUrl&quot;: &quot;http://host.domain.com:8088/cluster/app/application_1476912658570_0002&quot;,
&quot;diagnostics&quot;: &quot;...&quot;,
&quot;clusterId&quot;: 1476912658570,
&quot;applicationType&quot;: &quot;YARN&quot;,
&quot;applicationTags&quot;: &quot;&quot;,
&quot;priority&quot;: -1,
&quot;startedTime&quot;: 1476913457320,
&quot;finishedTime&quot;: 1476913761898,
&quot;elapsedTime&quot;: 304578,
&quot;amContainerLogs&quot;: &quot;http://host.domain.com:8042/node/containerlogs/container_1476912658570_0002_02_000001/dr.who&quot;,
&quot;amHostHttpAddress&quot;: &quot;host.domain.com:8042&quot;,
&quot;allocatedMB&quot;: -1,
&quot;allocatedVCores&quot;: -1,
&quot;runningContainers&quot;: -1,
&quot;memorySeconds&quot;: 206464,
&quot;vcoreSeconds&quot;: 201,
&quot;queueUsagePercentage&quot;: 0,
&quot;clusterUsagePercentage&quot;: 0,
&quot;preemptedResourceMB&quot;: 0,
&quot;preemptedResourceVCores&quot;: 0,
&quot;numNonAMContainerPreempted&quot;: 0,
&quot;numAMContainerPreempted&quot;: 0,
&quot;logAggregationStatus&quot;: &quot;DISABLED&quot;,
&quot;unmanagedApplication&quot;: false,
&quot;appNodeLabelExpression&quot;: &quot;&quot;,
&quot;amNodeLabelExpression&quot;: &quot;&quot;
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1326821518301_0005
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 847
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;app&gt;
&lt;id&gt;application_1476912658570_0002&lt;/id&gt;
&lt;user&gt;user2&lt;/user&gt;
&lt;name&gt;word count&lt;/name&gt;
&lt;queue&gt;default&lt;/queue&gt;
&lt;state&gt;FINISHED&lt;/state&gt;
&lt;finalStatus&gt;SUCCEEDED&lt;/finalStatus&gt;
&lt;progress&gt;100.0&lt;/progress&gt;
&lt;trackingUI&gt;History&lt;/trackingUI&gt;
&lt;trackingUrl&gt;http://host.domain.com:8088/cluster/app/application_1476912658570_0002&lt;/trackingUrl&gt;
&lt;diagnostics&gt;...&lt;/diagnostics&gt;
&lt;clusterId&gt;1476912658570&lt;/clusterId&gt;
&lt;applicationType&gt;YARN&lt;/applicationType&gt;
&lt;applicationTags&gt;&lt;/applicationTags&gt;
&lt;priority&gt;-1&lt;/priority&gt;
&lt;startedTime&gt;1476913457320&lt;/startedTime&gt;
&lt;finishedTime&gt;1476913761898&lt;/finishedTime&gt;
&lt;elapsedTime&gt;304578&lt;/elapsedTime&gt;
&lt;amContainerLogs&gt;http://host.domain.com:8042/node/containerlogs/container_1476912658570_0002_02_000001/dr.who&lt;/amContainerLogs&gt;
&lt;amHostHttpAddress&gt;host.domain.com:8042&lt;/amHostHttpAddress&gt;
&lt;allocatedMB&gt;-1&lt;/allocatedMB&gt;
&lt;allocatedVCores&gt;-1&lt;/allocatedVCores&gt;
&lt;runningContainers&gt;-1&lt;/runningContainers&gt;
&lt;memorySeconds&gt;206464&lt;/memorySeconds&gt;
&lt;vcoreSeconds&gt;201&lt;/vcoreSeconds&gt;
&lt;queueUsagePercentage&gt;0.0&lt;/queueUsagePercentage&gt;
&lt;clusterUsagePercentage&gt;0.0&lt;/clusterUsagePercentage&gt;
&lt;preemptedResourceMB&gt;0&lt;/preemptedResourceMB&gt;
&lt;preemptedResourceVCores&gt;0&lt;/preemptedResourceVCores&gt;
&lt;numNonAMContainerPreempted&gt;0&lt;/numNonAMContainerPreempted&gt;
&lt;numAMContainerPreempted&gt;0&lt;/numAMContainerPreempted&gt;
&lt;logAggregationStatus&gt;DISABLED&lt;/logAggregationStatus&gt;
&lt;unmanagedApplication&gt;false&lt;/unmanagedApplication&gt;
&lt;appNodeLabelExpression&gt;&lt;/appNodeLabelExpression&gt;
&lt;amNodeLabelExpression&gt;&lt;/amNodeLabelExpression&gt;
&lt;/app&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Application_Attempts_API"></a>Cluster Application Attempts API</h2>
<p>With the application attempts API, you can obtain a collection of resources that represent an application attempt. When you run a GET operation on this resource, you obtain a collection of App Attempt Objects.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_appAttempts_object"></a>Elements of the <i>appAttempts</i> object</h3>
<p>When you make a request for the list of app attempts, the information will be returned as an array of app attempt objects.</p>
<p>appAttempts:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> appAttempt </td>
<td align="left"> array of app attempt objects(JSON)/zero or more app attempt objects(XML) </td>
<td align="left"> The collection of app attempt objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_appAttempt_object"></a>Elements of the <i>appAttempt</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> id </td>
<td align="left"> string </td>
<td align="left"> The app attempt id </td></tr>
<tr class="a">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> The node id of the node the attempt ran on </td></tr>
<tr class="b">
<td align="left"> nodeHttpAddress </td>
<td align="left"> string </td>
<td align="left"> The node http address of the node the attempt ran on </td></tr>
<tr class="a">
<td align="left"> logsLink </td>
<td align="left"> string </td>
<td align="left"> The http link to the app attempt logs </td></tr>
<tr class="b">
<td align="left"> containerId </td>
<td align="left"> string </td>
<td align="left"> The id of the container for the app attempt </td></tr>
<tr class="a">
<td align="left"> startTime </td>
<td align="left"> long </td>
<td align="left"> The start time of the attempt (in ms since epoch) </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1326821518301_0005/appattempts
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;appAttempts&quot; : {
&quot;appAttempt&quot; : [
{
&quot;nodeId&quot; : &quot;host.domain.com:8041&quot;,
&quot;nodeHttpAddress&quot; : &quot;host.domain.com:8042&quot;,
&quot;startTime&quot; : 1326381444693,
&quot;id&quot; : 1,
&quot;logsLink&quot; : &quot;http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001/user1&quot;,
&quot;containerId&quot; : &quot;container_1326821518301_0005_01_000001&quot;
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1326821518301_0005/appattempts
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 575
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appAttempts&gt;
&lt;appttempt&gt;
&lt;nodeHttpAddress&gt;host.domain.com:8042&lt;/nodeHttpAddress&gt;
&lt;nodeId&gt;host.domain.com:8041&lt;/nodeId&gt;
&lt;id&gt;1&lt;/id&gt;
&lt;startTime&gt;1326381444693&lt;/startTime&gt;
&lt;containerId&gt;container_1326821518301_0005_01_000001&lt;/containerId&gt;
&lt;logsLink&gt;http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001/user1&lt;/logsLink&gt;
&lt;/appAttempt&gt;
&lt;/appAttempts&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Containers_for_an_Application_Attempt_API"></a>Containers for an Application Attempt API</h2>
<p>With Containers for an Application Attempt API you can obtain the list of containers, which belongs to an Application Attempt.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_containers_object"></a>Elements of the <i>containers</i> object</h3>
<p>When you make a request for the list of containers, the information will be returned as an array of container objects.</p>
<p>containers:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> containers </td>
<td align="left"> array of app container objects(JSON)/zero or more container objects(XML) </td>
<td align="left"> The collection of app container objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_container_object"></a>Elements of the <i>container</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> containerId </td>
<td align="left"> string </td>
<td align="left"> The container id </td></tr>
<tr class="a">
<td align="left"> allocatedMB </td>
<td align="left"> long </td>
<td align="left"> The amount of memory allocated for the container in MB </td></tr>
<tr class="b">
<td align="left"> allocatedVCores </td>
<td align="left"> int </td>
<td align="left"> The amount of virtual cores allocated for the container </td></tr>
<tr class="a">
<td align="left"> assignedNodeId </td>
<td align="left"> string </td>
<td align="left"> The node id of the node the attempt ran on </td></tr>
<tr class="b">
<td align="left"> priority </td>
<td align="left"> int </td>
<td align="left"> Allocated priority of the container </td></tr>
<tr class="a">
<td align="left"> startedTime </td>
<td align="left"> long </td>
<td align="left"> The start time of the attempt (in ms since epoch) </td></tr>
<tr class="b">
<td align="left"> finishedTime </td>
<td align="left"> long </td>
<td align="left"> The finish time of the attempt (in ms since epoch) 0 if not finished </td></tr>
<tr class="a">
<td align="left"> elapsedTime </td>
<td align="left"> long </td>
<td align="left"> The elapsed time in ms since the startedTime </td></tr>
<tr class="b">
<td align="left"> logUrl </td>
<td align="left"> string </td>
<td align="left"> The web URL that can be used to check the log for the container </td></tr>
<tr class="a">
<td align="left"> containerExitStatus </td>
<td align="left"> int </td>
<td align="left"> Final exit status of the container </td></tr>
<tr class="b">
<td align="left"> containerState </td>
<td align="left"> string </td>
<td align="left"> State of the container, can be NEW, RUNNING, or COMPLETE </td></tr>
<tr class="a">
<td align="left"> nodeHttpAddress </td>
<td align="left"> string </td>
<td align="left" colspan="2"> The node http address of the node the attempt ran on </td></tr>
<tr class="b">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> The node id of the node the attempt ran on </td></tr>
<tr class="a">
<td align="left"> allocatedResources </td>
<td align="left">array of resource(JSON)/zero or more resource objects(XML) </td>
<td align="left"> Allocated resources for the container </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_resource_object"></a>Elements of the <i>resource</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> The maximum memory for the container </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> The maximum number of vcores for the container </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;containers&quot; : {
&quot;container&quot;: [
{
&quot;containerId&quot;: &quot;container_1531404209605_0008_01_000001&quot;,
&quot;allocatedMB&quot;: &quot;1536&quot;,
&quot;allocatedVCores&quot;: &quot;1&quot;,
&quot;assignedNodeId&quot;: &quot;host.domain.com:37814&quot;,
&quot;priority&quot;: &quot;0&quot;,
&quot;startedTime&quot;: &quot;1531405909444&quot;,
&quot;finishedTime&quot;: &quot;0&quot;,
&quot;elapsedTime&quot;: &quot;4112&quot;,
&quot;logUrl&quot;: &quot;http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest&quot;,
&quot;containerExitStatus&quot;: &quot;0&quot;,
&quot;containerState&quot;: &quot;RUNNING&quot;,
&quot;nodeHttpAddress&quot;: &quot;http://host.domain.com:8042&quot;,
&quot;nodeId&quot;: &quot;host.domain.com:37814&quot;,
&quot;allocatedResources&quot;: [
{
&quot;key&quot;: &quot;memory-mb&quot;,
&quot;value&quot;: &quot;1536&quot;
},
{
&quot;key&quot;: &quot;vcores&quot;,
&quot;value&quot;: &quot;1&quot;
}
]
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 1104
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;containers&gt;
&lt;container&gt;
&lt;containerId&gt;container_1531404209605_0008_01_000001&lt;/containerId&gt;
&lt;allocatedMB&gt;1536&lt;/allocatedMB&gt;
&lt;allocatedVCores&gt;1&lt;/allocatedVCores&gt;
&lt;assignedNodeId&gt;host.domain.com:37814&lt;/assignedNodeId&gt;
&lt;priority&gt;0&lt;/priority&gt;
&lt;startedTime&gt;1531405909444&lt;/startedTime&gt;
&lt;finishedTime&gt;0&lt;/finishedTime&gt;
&lt;elapsedTime&gt;4112&lt;/elapsedTime&gt;
&lt;logUrl&gt;
http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest
&lt;/logUrl&gt;
&lt;containerExitStatus&gt;0&lt;/containerExitStatus&gt;
&lt;containerState&gt;RUNNING&lt;/containerState&gt;
&lt;nodeHttpAddress&gt;http://host.domain.com:8042&lt;/nodeHttpAddress&gt;
&lt;nodeId&gt;host.domain.com:37814&lt;/nodeId&gt;
&lt;allocatedResources&gt;
&lt;entry&gt;
&lt;key&gt;memory-mb&lt;/key&gt;
&lt;value&gt;1536&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;vcores&lt;/key&gt;
&lt;value&gt;1&lt;/value&gt;
&lt;/entry&gt;
&lt;/allocatedResources&gt;
&lt;/container&gt;
&lt;/containers&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Specific_Container_for_an_Application_Attempt_API"></a>Specific Container for an Application Attempt API</h2>
<p>With Specific Container for an Application Attempt API you can obtain information about a specific container, which belongs to an Application Attempt and selected by the container id.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers/{containerId}">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers/{containerId}</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_container_object"></a>Elements of the <i>container</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> containerId </td>
<td align="left"> string </td>
<td align="left"> The container id </td></tr>
<tr class="a">
<td align="left"> allocatedMB </td>
<td align="left"> long </td>
<td align="left"> The amount of memory allocated for the container in MB </td></tr>
<tr class="b">
<td align="left"> allocatedVCores </td>
<td align="left"> int </td>
<td align="left"> The amount of virtual cores allocated for the container </td></tr>
<tr class="a">
<td align="left"> assignedNodeId </td>
<td align="left"> string </td>
<td align="left"> The node id of the node the attempt ran on </td></tr>
<tr class="b">
<td align="left"> priority </td>
<td align="left"> int </td>
<td align="left"> Allocated priority of the container </td></tr>
<tr class="a">
<td align="left"> startedTime </td>
<td align="left"> long </td>
<td align="left"> The start time of the attempt (in ms since epoch) </td></tr>
<tr class="b">
<td align="left"> finishedTime </td>
<td align="left"> long </td>
<td align="left"> The finish time of the attempt (in ms since epoch) 0 if not finished </td></tr>
<tr class="a">
<td align="left"> elapsedTime </td>
<td align="left"> long </td>
<td align="left"> The elapsed time in ms since the startedTime </td></tr>
<tr class="b">
<td align="left"> logUrl </td>
<td align="left"> string </td>
<td align="left"> The web URL that can be used to check the log for the container </td></tr>
<tr class="a">
<td align="left"> containerExitStatus </td>
<td align="left"> int </td>
<td align="left"> Final exit status of the container </td></tr>
<tr class="b">
<td align="left"> containerState </td>
<td align="left"> string </td>
<td align="left"> State of the container, can be NEW, RUNNING, or COMPLETE </td></tr>
<tr class="a">
<td align="left"> nodeHttpAddress </td>
<td align="left"> string </td>
<td align="left" colspan="2"> The node http address of the node the attempt ran on </td></tr>
<tr class="b">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> The node id of the node the attempt ran on </td></tr>
<tr class="a">
<td align="left"> allocatedResources </td>
<td align="left">array of resource(JSON)/zero or more resource objects(XML) </td>
<td align="left"> Allocated resources for the container </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_resource_object"></a>Elements of the <i>resource</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> The maximum memory for the container </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> The maximum number of vcores for the container </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers/{containerId}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;container&quot;: {
&quot;containerId&quot;: &quot;container_1531404209605_0008_01_000001&quot;,
&quot;allocatedMB&quot;: &quot;1536&quot;,
&quot;allocatedVCores&quot;: &quot;1&quot;,
&quot;assignedNodeId&quot;: &quot;host.domain.com:37814&quot;,
&quot;priority&quot;: &quot;0&quot;,
&quot;startedTime&quot;: &quot;1531405909444&quot;,
&quot;finishedTime&quot;: &quot;0&quot;,
&quot;elapsedTime&quot;: &quot;4112&quot;,
&quot;logUrl&quot;: &quot;http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest&quot;,
&quot;containerExitStatus&quot;: &quot;0&quot;,
&quot;containerState&quot;: &quot;RUNNING&quot;,
&quot;nodeHttpAddress&quot;: &quot;http://host.domain.com:8042&quot;,
&quot;nodeId&quot;: &quot;host.domain.com:37814&quot;,
&quot;allocatedResources&quot;: [
{
&quot;key&quot;: &quot;memory-mb&quot;,
&quot;value&quot;: &quot;1536&quot;
},
{
&quot;key&quot;: &quot;vcores&quot;,
&quot;value&quot;: &quot;1&quot;
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appAttemptId}/containers/{containerId}
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 1104
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;container&gt;
&lt;containerId&gt;container_1531404209605_0008_01_000001&lt;/containerId&gt;
&lt;allocatedMB&gt;1536&lt;/allocatedMB&gt;
&lt;allocatedVCores&gt;1&lt;/allocatedVCores&gt;
&lt;assignedNodeId&gt;host.domain.com:37814&lt;/assignedNodeId&gt;
&lt;priority&gt;0&lt;/priority&gt;
&lt;startedTime&gt;1531405909444&lt;/startedTime&gt;
&lt;finishedTime&gt;0&lt;/finishedTime&gt;
&lt;elapsedTime&gt;4112&lt;/elapsedTime&gt;
&lt;logUrl&gt;
http://host.domain.com:8042/node/containerlogs/container_1531404209605_0008_01_000001/systest
&lt;/logUrl&gt;
&lt;containerExitStatus&gt;0&lt;/containerExitStatus&gt;
&lt;containerState&gt;RUNNING&lt;/containerState&gt;
&lt;nodeHttpAddress&gt;http://host.domain.com:8042&lt;/nodeHttpAddress&gt;
&lt;nodeId&gt;host.domain.com:37814&lt;/nodeId&gt;
&lt;allocatedResources&gt;
&lt;entry&gt;
&lt;key&gt;memory-mb&lt;/key&gt;
&lt;value&gt;1536&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;vcores&lt;/key&gt;
&lt;value&gt;1&lt;/value&gt;
&lt;/entry&gt;
&lt;/allocatedResources&gt;
&lt;/container&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Nodes_API"></a>Cluster Nodes API</h2>
<p>With the Nodes API, you can obtain a collection of resources, each of which represents a node. When you run a GET operation on this resource, you obtain a collection of Node Objects.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/nodes">http://rm-http-address:port/ws/v1/cluster/nodes</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<ul>
<li>states - the states of the node, specified as a comma-separated list, valid values are: NEW, RUNNING, UNHEALTHY, DECOMMISSIONING, DECOMMISSIONED, LOST, REBOOTED, SHUTDOWN</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_nodes_object"></a>Elements of the <i>nodes</i> object</h3>
<p>When you make a request for the list of nodes, the information will be returned as a collection of node objects. See also <a href="#Node_API">Node API</a> for syntax of the node object.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> node </td>
<td align="left"> array of node objects(JSON)/zero or more node objects(XML) </td>
<td align="left"> A collection of node objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/nodes
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;nodes&quot;:
{
&quot;node&quot;:
[
{
&quot;rack&quot;:&quot;\/default-rack&quot;,
&quot;state&quot;:&quot;RUNNING&quot;,
&quot;id&quot;:&quot;host.domain.com:54158&quot;,
&quot;nodeHostName&quot;:&quot;host.domain.com&quot;,
&quot;nodeHTTPAddress&quot;:&quot;host.domain.com:8042&quot;,
&quot;lastHealthUpdate&quot;: 1476995346399,
&quot;version&quot;: &quot;3.0.0-alpha2-SNAPSHOT&quot;,
&quot;healthReport&quot;:&quot;&quot;,
&quot;numContainers&quot;:0,
&quot;usedMemoryMB&quot;:0,
&quot;availMemoryMB&quot;:8192,
&quot;usedVirtualCores&quot;:0,
&quot;availableVirtualCores&quot;:8,
&quot;resourceUtilization&quot;:
{
&quot;nodePhysicalMemoryMB&quot;:1027,
&quot;nodeVirtualMemoryMB&quot;:1027,
&quot;nodeCPUUsage&quot;:0.016661113128066063,
&quot;aggregatedContainersPhysicalMemoryMB&quot;:0,
&quot;aggregatedContainersVirtualMemoryMB&quot;:0,
&quot;containersCPUUsage&quot;:0
}
},
{
&quot;rack&quot;:&quot;\/default-rack&quot;,
&quot;state&quot;:&quot;RUNNING&quot;,
&quot;id&quot;:&quot;host.domain.com:54158&quot;,
&quot;nodeHostName&quot;:&quot;host.domain.com&quot;,
&quot;nodeHTTPAddress&quot;:&quot;host.domain.com:8042&quot;,
&quot;lastHealthUpdate&quot;:1476995346399,
&quot;version&quot;:&quot;3.0.0-alpha2-SNAPSHOT&quot;,
&quot;healthReport&quot;:&quot;&quot;,
&quot;numContainers&quot;:0,
&quot;usedMemoryMB&quot;:0,
&quot;availMemoryMB&quot;:8192,
&quot;usedVirtualCores&quot;:0,
&quot;availableVirtualCores&quot;:8,
&quot;resourceUtilization&quot;:
{
&quot;nodePhysicalMemoryMB&quot;:1027,
&quot;nodeVirtualMemoryMB&quot;:1027,
&quot;nodeCPUUsage&quot;:0.016661113128066063,
&quot;aggregatedContainersPhysicalMemoryMB&quot;:0,
&quot;aggregatedContainersVirtualMemoryMB&quot;:0,
&quot;containersCPUUsage&quot;:0
}
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/nodes
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 1104
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;nodes&gt;
&lt;node&gt;
&lt;rack&gt;/default-rack&lt;/rack&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;id&gt;host1.domain.com:54158&lt;/id&gt;
&lt;nodeHostName&gt;host1.domain.com&lt;/nodeHostName&gt;
&lt;nodeHTTPAddress&gt;host1.domain.com:8042&lt;/nodeHTTPAddress&gt;
&lt;lastHealthUpdate&gt;1476995346399&lt;/lastHealthUpdate&gt;
&lt;version&gt;3.0.0-SNAPSHOT&lt;/version&gt;
&lt;healthReport&gt;&lt;/healthReport&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;usedMemoryMB&gt;0&lt;/usedMemoryMB&gt;
&lt;availMemoryMB&gt;8192&lt;/availMemoryMB&gt;
&lt;usedVirtualCores&gt;0&lt;/usedVirtualCores&gt;
&lt;availableVirtualCores&gt;8&lt;/availableVirtualCores&gt;
&lt;resourceUtilization&gt;
&lt;nodePhysicalMemoryMB&gt;1027&lt;/nodePhysicalMemoryMB&gt;
&lt;nodeVirtualMemoryMB&gt;1027&lt;/nodeVirtualMemoryMB&gt;
&lt;nodeCPUUsage&gt;0.006664445623755455&lt;/nodeCPUUsage&gt;
&lt;aggregatedContainersPhysicalMemoryMB&gt;0&lt;/aggregatedContainersPhysicalMemoryMB&gt;
&lt;aggregatedContainersVirtualMemoryMB&gt;0&lt;/aggregatedContainersVirtualMemoryMB&gt;
&lt;containersCPUUsage&gt;0.0&lt;/containersCPUUsage&gt;
&lt;/resourceUtilization&gt;
&lt;/node&gt;
&lt;node&gt;
&lt;rack&gt;/default-rack&lt;/rack&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;id&gt;host2.domain.com:54158&lt;/id&gt;
&lt;nodeHostName&gt;host2.domain.com&lt;/nodeHostName&gt;
&lt;nodeHTTPAddress&gt;host2.domain.com:8042&lt;/nodeHTTPAddress&gt;
&lt;lastHealthUpdate&gt;1476995346399&lt;/lastHealthUpdate&gt;
&lt;version&gt;3.0.0-SNAPSHOT&lt;/version&gt;
&lt;healthReport&gt;&lt;/healthReport&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;usedMemoryMB&gt;0&lt;/usedMemoryMB&gt;
&lt;availMemoryMB&gt;8192&lt;/availMemoryMB&gt;
&lt;usedVirtualCores&gt;0&lt;/usedVirtualCores&gt;
&lt;availableVirtualCores&gt;8&lt;/availableVirtualCores&gt;
&lt;resourceUtilization&gt;
&lt;nodePhysicalMemoryMB&gt;1027&lt;/nodePhysicalMemoryMB&gt;
&lt;nodeVirtualMemoryMB&gt;1027&lt;/nodeVirtualMemoryMB&gt;
&lt;nodeCPUUsage&gt;0.006664445623755455&lt;/nodeCPUUsage&gt;
&lt;aggregatedContainersPhysicalMemoryMB&gt;0&lt;/aggregatedContainersPhysicalMemoryMB&gt;
&lt;aggregatedContainersVirtualMemoryMB&gt;0&lt;/aggregatedContainersVirtualMemoryMB&gt;
&lt;containersCPUUsage&gt;0.0&lt;/containersCPUUsage&gt;
&lt;/resourceUtilization&gt;
&lt;/node&gt;
&lt;/nodes&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Node_API"></a>Cluster Node API</h2>
<p>A node resource contains information about a node in the cluster.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<p>Use the following URI to obtain a Node Object, from a node identified by the nodeid value.</p>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/nodes/{nodeid}">http://rm-http-address:port/ws/v1/cluster/nodes/{nodeid}</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_node_object"></a>Elements of the <i>node</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> rack </td>
<td align="left"> string </td>
<td align="left"> The rack location of this node </td></tr>
<tr class="a">
<td align="left"> state </td>
<td align="left"> string </td>
<td align="left"> State of the node - valid values are: NEW, RUNNING, UNHEALTHY, DECOMMISSIONING, DECOMMISSIONED, LOST, REBOOTED, SHUTDOWN </td></tr>
<tr class="b">
<td align="left"> id </td>
<td align="left"> string </td>
<td align="left"> The node id </td></tr>
<tr class="a">
<td align="left"> nodeHostName </td>
<td align="left"> string </td>
<td align="left"> The host name of the node </td></tr>
<tr class="b">
<td align="left"> nodeHTTPAddress </td>
<td align="left"> string </td>
<td align="left"> The nodes HTTP address </td></tr>
<tr class="a">
<td align="left"> lastHealthUpdate </td>
<td align="left"> long </td>
<td align="left"> The last time the node reported its health (in ms since epoch) </td></tr>
<tr class="b">
<td align="left"> version </td>
<td align="left"> string </td>
<td align="left"> Version of hadoop running on node </td></tr>
<tr class="a">
<td align="left"> healthReport </td>
<td align="left"> string </td>
<td align="left"> A detailed health report </td></tr>
<tr class="b">
<td align="left"> numContainers </td>
<td align="left"> int </td>
<td align="left"> The total number of containers currently running on the node </td></tr>
<tr class="a">
<td align="left"> usedMemoryMB </td>
<td align="left"> long </td>
<td align="left"> The total amount of memory currently used on the node (in MB) </td></tr>
<tr class="b">
<td align="left"> availMemoryMB </td>
<td align="left"> long </td>
<td align="left"> The total amount of memory currently available on the node (in MB) </td></tr>
<tr class="a">
<td align="left"> usedVirtualCores </td>
<td align="left"> long </td>
<td align="left"> The total number of vCores currently used on the node </td></tr>
<tr class="b">
<td align="left"> availableVirtualCores </td>
<td align="left"> long </td>
<td align="left"> The total number of vCores available on the node </td></tr>
<tr class="a">
<td align="left"> resourceUtilization </td>
<td align="left"> object </td>
<td align="left"> Resource utilization on the node </td></tr>
<tr class="b">
<td align="left"> totalResource </td>
<td align="left"> object </td>
<td align="left"> Resources on the node </td></tr>
</tbody>
</table>
<p>The <i>resourceUtilization</i> object contains the following elements:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> nodePhysicalMemoryMB </td>
<td align="left"> int </td>
<td align="left"> Node physical memory utilization </td></tr>
<tr class="a">
<td align="left"> nodeVirtualMemoryMB </td>
<td align="left"> int </td>
<td align="left"> Node virtual memory utilization </td></tr>
<tr class="b">
<td align="left"> nodeCPUUsage </td>
<td align="left"> double </td>
<td align="left"> Node CPU utilization </td></tr>
<tr class="a">
<td align="left"> aggregatedContainersPhysicalMemoryMB </td>
<td align="left"> int </td>
<td align="left"> The aggregated physical memory utilization of the containers </td></tr>
<tr class="b">
<td align="left"> aggregatedContainersVirtualMemoryMB </td>
<td align="left"> int </td>
<td align="left"> The aggregated virtual memory utilization of the containers </td></tr>
<tr class="a">
<td align="left"> containersCPUUsage </td>
<td align="left"> double </td>
<td align="left"> The aggregated CPU utilization of the containers </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/nodes/h2:1235
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;node&quot;:
{
&quot;rack&quot;:&quot;\/default-rack&quot;,
&quot;state&quot;:&quot;RUNNING&quot;,
&quot;id&quot;:&quot;host.domain.com:54158&quot;,
&quot;nodeHostName&quot;:&quot;host.domain.com&quot;,
&quot;nodeHTTPAddress&quot;:&quot;host.domain.com:8042&quot;,
&quot;lastHealthUpdate&quot;:1476916746399,
&quot;version&quot;:&quot;3.0.0-SNAPSHOT&quot;,
&quot;healthReport&quot;:&quot;&quot;,
&quot;numContainers&quot;:0,
&quot;usedMemoryMB&quot;:0,
&quot;availMemoryMB&quot;:8192,
&quot;usedVirtualCores&quot;:0,
&quot;availableVirtualCores&quot;:8,
&quot;resourceUtilization&quot;:
{
&quot;nodePhysicalMemoryMB&quot;: 968,
&quot;nodeVirtualMemoryMB&quot;: 968,
&quot;nodeCPUUsage&quot;: 0.01332889124751091,
&quot;aggregatedContainersPhysicalMemoryMB&quot;: 0,
&quot;aggregatedContainersVirtualMemoryMB&quot;: 0,
&quot;containersCPUUsage&quot;: 0
},
&quot;totalResource&quot;:
{
&quot;memory&quot;: 2048,
&quot;vCores&quot;: 5
}
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/node/h2:1235
Accept: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 552
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;node&gt;
&lt;rack&gt;/default-rack&lt;/rack&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;id&gt;host.domain.com:54158&lt;/id&gt;
&lt;nodeHostName&gt;host.domain.com&lt;/nodeHostName&gt;
&lt;nodeHTTPAddress&gt;host.domain.com:8042&lt;/nodeHTTPAddress&gt;
&lt;lastHealthUpdate&gt;1476916746399&lt;/lastHealthUpdate&gt;
&lt;version&gt;3.0.0-SNAPSHOT&lt;/version&gt;
&lt;healthReport&gt;&lt;/healthReport&gt;
&lt;numContainers&gt;0&lt;/numContainers&gt;
&lt;usedMemoryMB&gt;0&lt;/usedMemoryMB&gt;
&lt;availMemoryMB&gt;8192&lt;/availMemoryMB&gt;
&lt;usedVirtualCores&gt;0&lt;/usedVirtualCores&gt;
&lt;availableVirtualCores&gt;8&lt;/availableVirtualCores&gt;
&lt;resourceUtilization&gt;
&lt;nodePhysicalMemoryMB&gt;968&lt;/nodePhysicalMemoryMB&gt;
&lt;nodeVirtualMemoryMB&gt;968&lt;/nodeVirtualMemoryMB&gt;
&lt;nodeCPUUsage&gt;0.01332889124751091&lt;/nodeCPUUsage&gt;
&lt;aggregatedContainersPhysicalMemoryMB&gt;0&lt;/aggregatedContainersPhysicalMemoryMB&gt;
&lt;aggregatedContainersVirtualMemoryMB&gt;0&lt;/aggregatedContainersVirtualMemoryMB&gt;
&lt;containersCPUUsage&gt;0.0&lt;/containersCPUUsage&gt;
&lt;/resourceUtilization&gt;
&lt;totalResource&gt;
&lt;memory&gt;2048&lt;/memory&gt;
&lt;vCores&gt;5&lt;/vCores&gt;
&lt;/totalResource&gt;
&lt;/node&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Node_Update_Resource_API"></a>Cluster Node Update Resource API</h2>
<p>Update the total resources in a node.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<p>Use the following URI to update the resources of a Node Object identified by the nodeid value.</p>
<div>
<div>
<pre class="source"> http://rm-http-address:port/ws/v1/cluster/nodes/{nodeid}/resource
</pre></div></div>
</div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<div>
<div>
<pre class="source"> POST
</pre></div></div>
</div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_resourceOption_object"></a>Elements of the <i>resourceOption</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> long </td>
<td align="left"> The total amount of memory to set on the node (in MB) </td></tr>
<tr class="a">
<td align="left"> vcores </td>
<td align="left"> long </td>
<td align="left"> The total number of vCores to set on the node </td></tr>
<tr class="b">
<td align="left"> overCommitTimeout </td>
<td align="left"> long </td>
<td align="left"> The timeout to preempt containers </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/nodes/h2:1235/resource
</pre></div></div>
<p>Request body:</p>
<div>
<div>
<pre class="source">{
&quot;resource&quot;:
{
&quot;memory&quot;: 1024,
&quot;vCores&quot;: 3
},
&quot;overCommitTimeout&quot;: -1
}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;resourceInfo&quot;:
{
&quot;memory&quot;: 8192,
&quot;vCores&quot;: 5
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/node/h2:1235/resource
Accept: application/xml
</pre></div></div>
<p>Request body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;resourceOption&gt;
&lt;resource&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;5&lt;/vCores&gt;
&lt;/resource&gt;
&lt;overCommitTimeout&gt;1000&lt;/overCommitTimeout&gt;
&lt;/resourceOption&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 552
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;resourceInfo&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;5&lt;/vCores&gt;
&lt;/resourceInfo&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Writeable_APIs"></a>Cluster Writeable APIs</h2>
<p>The setions below refer to APIs which allow to create and modify applications. These APIs are currently in alpha and may change in the future.</p></div>
<div class="section">
<h2><a name="Cluster_New_Application_API"></a>Cluster New Application API</h2>
<p>With the New Application API, you can obtain an application-id which can then be used as part of the <a href="#Cluster_Applications_APISubmit_Application">Cluster Submit Applications API</a> to submit applications. The response also includes the maximum resource capabilities available on the cluster.</p>
<p>This feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/new-application">http://rm-http-address:port/ws/v1/cluster/apps/new-application</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>POST</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_NewApplication_object"></a>Elements of the NewApplication object</h3>
<p>The NewApplication response contains the following elements:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> application-id </td>
<td align="left"> string </td>
<td align="left"> The newly created application id </td></tr>
<tr class="a">
<td align="left"> maximum-resource-capabilities </td>
<td align="left"> object </td>
<td align="left"> The maximum resource capabilities available on this cluster </td></tr>
</tbody>
</table>
<p>The <i>maximum-resource-capabilites</i> object contains the following elements:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> The maximum memory available for a container </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> The maximum number of cores available for a container </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/apps/new-application
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;application-id&quot;:&quot;application_1404198295326_0003&quot;,
&quot;maximum-resource-capability&quot;:
{
&quot;memory&quot;:8192,
&quot;vCores&quot;:32
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/apps/new-application
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 248
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;NewApplication&gt;
&lt;application-id&gt;application_1404198295326_0003&lt;/application-id&gt;
&lt;maximum-resource-capability&gt;
&lt;memory&gt;8192&lt;/memory&gt;
&lt;vCores&gt;32&lt;/vCores&gt;
&lt;/maximum-resource-capability&gt;
&lt;/NewApplication&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Applications_API.28Submit_Application.29"></a>Cluster Applications API(Submit Application)</h2>
<p>The Submit Applications API can be used to submit applications. In case of submitting applications, you must first obtain an application-id using the <a href="#Cluster_New_Application_API">Cluster New Application API</a>. The application-id must be part of the request body. The response contains a URL to the application page which can be used to track the state and progress of your application.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps">http://rm-http-address:port/ws/v1/cluster/apps</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>POST</li>
</ul></div>
<div class="section">
<h3><a name="POST_Response_Examples"></a>POST Response Examples</h3>
<p>POST requests can be used to submit apps to the ResourceManager. As mentioned above, an application-id must be obtained first. Successful submissions result in a 202 response code and a Location header specifying where to get information about the app. Please note that in order to submit an app, you must have an authentication filter setup for the HTTP interface. The functionality requires that a username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response.</p>
<p>Please note that this feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h4><a name="Elements_of_the_POST_request_object"></a>Elements of the POST request object</h4>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> application-id </td>
<td align="left"> string </td>
<td align="left"> The application id </td></tr>
<tr class="a">
<td align="left"> application-name </td>
<td align="left"> string </td>
<td align="left"> The application name </td></tr>
<tr class="b">
<td align="left"> queue </td>
<td align="left"> string </td>
<td align="left"> The name of the queue to which the application should be submitted </td></tr>
<tr class="a">
<td align="left"> priority </td>
<td align="left"> int </td>
<td align="left"> The priority of the application </td></tr>
<tr class="b">
<td align="left"> am-container-spec </td>
<td align="left"> object </td>
<td align="left"> The application master container launch context, described below </td></tr>
<tr class="a">
<td align="left"> unmanaged-AM </td>
<td align="left"> boolean </td>
<td align="left"> Is the application using an unmanaged application master </td></tr>
<tr class="b">
<td align="left"> max-app-attempts </td>
<td align="left"> int </td>
<td align="left"> The max number of attempts for this application </td></tr>
<tr class="a">
<td align="left"> resource </td>
<td align="left"> object </td>
<td align="left"> The resources the application master requires, described below </td></tr>
<tr class="b">
<td align="left"> application-type </td>
<td align="left"> string </td>
<td align="left"> The application type(MapReduce, Pig, Hive, etc) </td></tr>
<tr class="a">
<td align="left"> keep-containers-across-application-attempts </td>
<td align="left"> boolean </td>
<td align="left"> Should YARN keep the containers used by this application instead of destroying them </td></tr>
<tr class="b">
<td align="left"> application-tags </td>
<td align="left"> object </td>
<td align="left"> List of application tags, please see the request examples on how to speciy the tags </td></tr>
<tr class="a">
<td align="left"> log-aggregation-context</td>
<td align="left"> object </td>
<td align="left"> Represents all of the information needed by the NodeManager to handle the logs for this application </td></tr>
<tr class="b">
<td align="left"> attempt-failures-validity-interval</td>
<td align="left"> long </td>
<td align="left"> The failure number will no take attempt failures which happen out of the validityInterval into failure count</td></tr>
<tr class="a">
<td align="left"> reservation-id</td>
<td align="left"> string </td>
<td align="left"> Represent the unique id of the corresponding reserved resource allocation in the scheduler </td></tr>
<tr class="b">
<td align="left"> am-black-listing-requests</td>
<td align="left"> object </td>
<td align="left"> Contains blacklisting information such as &#x201c;enable/disable AM blacklisting&#x201d; and &#x201c;disable failure threshold&#x201d; </td></tr>
</tbody>
</table>
<p>Elements of the <i>am-container-spec</i> object</p>
<p>The am-container-spec object should be used to provide the container launch context for the application master.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> local-resources </td>
<td align="left"> object </td>
<td align="left"> Object describing the resources that need to be localized, described below </td></tr>
<tr class="a">
<td align="left"> environment </td>
<td align="left"> object </td>
<td align="left"> Environment variables for your containers, specified as key value pairs </td></tr>
<tr class="b">
<td align="left"> commands </td>
<td align="left"> object </td>
<td align="left"> The commands for launching your container, in the order in which they should be executed </td></tr>
<tr class="a">
<td align="left"> service-data </td>
<td align="left"> object </td>
<td align="left"> Application specific service data; key is the name of the auxiliary servce, value is base-64 encoding of the data you wish to pass </td></tr>
<tr class="b">
<td align="left"> credentials </td>
<td align="left"> object </td>
<td align="left"> The credentials required for your application to run, described below </td></tr>
<tr class="a">
<td align="left"> application-acls </td>
<td align="left"> objec </td>
<td align="left"> ACLs for your application; the key can be &#x201c;VIEW_APP&#x201d; or &#x201c;MODIFY_APP&#x201d;, the value is the list of users with the permissions </td></tr>
</tbody>
</table>
<p>Elements of the <i>local-resources</i> object</p>
<p>The object is a collection of key-value pairs. They key is an identifier for the resources to be localized and the value is the details of the resource. The elements of the value are described below:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> resource </td>
<td align="left"> string </td>
<td align="left"> Location of the resource to be localized </td></tr>
<tr class="a">
<td align="left"> type </td>
<td align="left"> string </td>
<td align="left"> Type of the resource; options are &#x201c;ARCHIVE&#x201d;, &#x201c;FILE&#x201d;, and &#x201c;PATTERN&#x201d; </td></tr>
<tr class="b">
<td align="left"> visibility </td>
<td align="left"> string </td>
<td align="left"> Visibility the resource to be localized; options are &#x201c;PUBLIC&#x201d;, &#x201c;PRIVATE&#x201d;, and &#x201c;APPLICATION&#x201d; </td></tr>
<tr class="a">
<td align="left"> size </td>
<td align="left"> long </td>
<td align="left"> Size of the resource to be localized </td></tr>
<tr class="b">
<td align="left"> timestamp </td>
<td align="left"> long </td>
<td align="left"> Timestamp of the resource to be localized </td></tr>
</tbody>
</table>
<p>Elements of the <i>credentials</i> object</p>
<p>The credentials object should be used to pass data required for the application to authenticate itself such as delegation-tokens and secrets.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> tokens </td>
<td align="left"> object </td>
<td align="left"> Tokens that you wish to pass to your application, specified as key-value pairs. The key is an identifier for the token and the value is the token(which should be obtained using the respective web-services) </td></tr>
<tr class="a">
<td align="left"> secrets </td>
<td align="left"> object </td>
<td align="left"> Secrets that you wish to use in your application, specified as key-value pairs. They key is an identifier and the value is the base-64 encoding of the secret </td></tr>
</tbody>
</table>
<p>Elements of the POST request body <i>resource</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> Memory required for each container </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> Virtual cores required for each container </td></tr>
</tbody>
</table>
<p>Elements of the POST request body <i>log-aggregation-context</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> log-include-pattern </td>
<td align="left"> string </td>
<td align="left"> The log files which match the defined include pattern will be uploaded when the applicaiton finishes </td></tr>
<tr class="a">
<td align="left"> log-exclude-pattern </td>
<td align="left"> string </td>
<td align="left"> The log files which match the defined exclude pattern will not be uploaded when the applicaiton finishes </td></tr>
<tr class="b">
<td align="left"> rolled-log-include-pattern </td>
<td align="left"> string </td>
<td align="left"> The log files which match the defined include pattern will be aggregated in a rolling fashion </td></tr>
<tr class="a">
<td align="left"> rolled-log-exclude-pattern </td>
<td align="left"> string </td>
<td align="left"> The log files which match the defined exclude pattern will not be aggregated in a rolling fashion </td></tr>
<tr class="b">
<td align="left"> log-aggregation-policy-class-name </td>
<td align="left"> string </td>
<td align="left"> The policy which will be used by NodeManager to aggregate the logs </td></tr>
<tr class="a">
<td align="left"> log-aggregation-policy-parameters </td>
<td align="left"> string </td>
<td align="left"> The parameters passed to the policy class </td></tr>
</tbody>
</table>
<p>Elements of the POST request body <i>am-black-listing-requests</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> am-black-listing-enabled </td>
<td align="left"> boolean </td>
<td align="left"> Whether AM Blacklisting is enabled </td></tr>
<tr class="a">
<td align="left"> disable-failure-threshold </td>
<td align="left"> float </td>
<td align="left"> AM Blacklisting disable failure threshold </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/apps
Accept: application/json
Content-Type: application/json
{
&quot;application-id&quot;:&quot;application_1404203615263_0001&quot;,
&quot;application-name&quot;:&quot;test&quot;,
&quot;am-container-spec&quot;:
{
&quot;local-resources&quot;:
{
&quot;entry&quot;:
[
{
&quot;key&quot;:&quot;AppMaster.jar&quot;,
&quot;value&quot;:
{
&quot;resource&quot;:&quot;hdfs://hdfs-namenode:9000/user/testuser/DistributedShell/demo-app/AppMaster.jar&quot;,
&quot;type&quot;:&quot;FILE&quot;,
&quot;visibility&quot;:&quot;APPLICATION&quot;,
&quot;size&quot;: 43004,
&quot;timestamp&quot;: 1405452071209
}
}
]
},
&quot;commands&quot;:
{
&quot;command&quot;:&quot;{{JAVA_HOME}}/bin/java -Xmx10m org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster --container_memory 10 --container_vcores 1 --num_containers 1 --priority 0 1&gt;&lt;LOG_DIR&gt;/AppMaster.stdout 2&gt;&lt;LOG_DIR&gt;/AppMaster.stderr&quot;
},
&quot;environment&quot;:
{
&quot;entry&quot;:
[
{
&quot;key&quot;: &quot;DISTRIBUTEDSHELLSCRIPTTIMESTAMP&quot;,
&quot;value&quot;: &quot;1405459400754&quot;
},
{
&quot;key&quot;: &quot;CLASSPATH&quot;,
&quot;value&quot;: &quot;{{CLASSPATH}}&lt;CPS&gt;./*&lt;CPS&gt;{{HADOOP_CONF_DIR}}&lt;CPS&gt;{{HADOOP_COMMON_HOME}}/share/hadoop/common/*&lt;CPS&gt;{{HADOOP_COMMON_HOME}}/share/hadoop/common/lib/*&lt;CPS&gt;{{HADOOP_HDFS_HOME}}/share/hadoop/hdfs/*&lt;CPS&gt;{{HADOOP_HDFS_HOME}}/share/hadoop/hdfs/lib/*&lt;CPS&gt;{{HADOOP_YARN_HOME}}/share/hadoop/yarn/*&lt;CPS&gt;{{HADOOP_YARN_HOME}}/share/hadoop/yarn/lib/*&lt;CPS&gt;./log4j.properties&quot;
},
{
&quot;key&quot;: &quot;DISTRIBUTEDSHELLSCRIPTLEN&quot;,
&quot;value&quot;: &quot;6&quot;
},
{
&quot;key&quot;: &quot;DISTRIBUTEDSHELLSCRIPTLOCATION&quot;,
&quot;value&quot;: &quot;hdfs://hdfs-namenode:9000/user/testuser/demo-app/shellCommands&quot;
}
]
}
},
&quot;unmanaged-AM&quot;:false,
&quot;max-app-attempts&quot;:2,
&quot;resource&quot;:
{
&quot;memory&quot;:1024,
&quot;vCores&quot;:1
},
&quot;application-type&quot;:&quot;YARN&quot;,
&quot;keep-containers-across-application-attempts&quot;:false,
&quot;log-aggregation-context&quot;:
{
&quot;log-include-pattern&quot;:&quot;file1&quot;,
&quot;log-exclude-pattern&quot;:&quot;file2&quot;,
&quot;rolled-log-include-pattern&quot;:&quot;file3&quot;,
&quot;rolled-log-exclude-pattern&quot;:&quot;file4&quot;,
&quot;log-aggregation-policy-class-name&quot;:&quot;org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AllContainerLogAggregationPolicy&quot;,
&quot;log-aggregation-policy-parameters&quot;:&quot;&quot;
},
&quot;attempt-failures-validity-interval&quot;:3600000,
&quot;reservation-id&quot;:&quot;reservation_1454114874_1&quot;,
&quot;am-black-listing-requests&quot;:
{
&quot;am-black-listing-enabled&quot;:true,
&quot;disable-failure-threshold&quot;:0.01
}
}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 202
Transfer-Encoding: chunked
Location: http://rm-http-address:port/ws/v1/cluster/apps/application_1404203615263_0001
Content-Type: application/json
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source">POST http://rm-http-address:port/ws/v1/cluster/apps
Accept: application/xml
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;application-submission-context&gt;
&lt;application-id&gt;application_1404204891930_0002&lt;/application-id&gt;
&lt;application-name&gt;test&lt;/application-name&gt;
&lt;queue&gt;testqueue&lt;/queue&gt;
&lt;priority&gt;3&lt;/priority&gt;
&lt;am-container-spec&gt;
&lt;local-resources&gt;
&lt;entry&gt;
&lt;key&gt;example&lt;/key&gt;
&lt;value&gt;
&lt;resource&gt;hdfs://hdfs-namenode:9000/user/testuser/DistributedShell/demo-app/AppMaster.jar&lt;/resource&gt;
&lt;type&gt;FILE&lt;/type&gt;
&lt;visibility&gt;APPLICATION&lt;/visibility&gt;
&lt;size&gt;43004&lt;/size&gt;
&lt;timestamp&gt;1405452071209&lt;/timestamp&gt;
&lt;/value&gt;
&lt;/entry&gt;
&lt;/local-resources&gt;
&lt;environment&gt;
&lt;entry&gt;
&lt;key&gt;DISTRIBUTEDSHELLSCRIPTTIMESTAMP&lt;/key&gt;
&lt;value&gt;1405459400754&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;CLASSPATH&lt;/key&gt;
&lt;value&gt;{{CLASSPATH}}&amp;lt;CPS&amp;gt;./*&amp;lt;CPS&amp;gt;{{HADOOP_CONF_DIR}}&amp;lt;CPS&amp;gt;{{HADOOP_COMMON_HOME}}/share/hadoop/common/*&amp;lt;CPS&amp;gt;{{HADOOP_COMMON_HOME}}/share/hadoop/common/lib/*&amp;lt;CPS&amp;gt;{{HADOOP_HDFS_HOME}}/share/hadoop/hdfs/*&amp;lt;CPS&amp;gt;{{HADOOP_HDFS_HOME}}/share/hadoop/hdfs/lib/*&amp;lt;CPS&amp;gt;{{HADOOP_YARN_HOME}}/share/hadoop/yarn/*&amp;lt;CPS&amp;gt;{{HADOOP_YARN_HOME}}/share/hadoop/yarn/lib/*&amp;lt;CPS&amp;gt;./log4j.properties&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;DISTRIBUTEDSHELLSCRIPTLEN&lt;/key&gt;
&lt;value&gt;6&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;DISTRIBUTEDSHELLSCRIPTLOCATION&lt;/key&gt;
&lt;value&gt;hdfs://hdfs-namenode:9000/user/testuser/demo-app/shellCommands&lt;/value&gt;
&lt;/entry&gt;
&lt;/environment&gt;
&lt;commands&gt;
&lt;command&gt;{{JAVA_HOME}}/bin/java -Xmx10m org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster --container_memory 10 --container_vcores 1 --num_containers 1 --priority 0 1&amp;gt;&amp;lt;LOG_DIR&amp;gt;/AppMaster.stdout 2&amp;gt;&amp;lt;LOG_DIR&amp;gt;/AppMaster.stderr&lt;/command&gt;
&lt;/commands&gt;
&lt;service-data&gt;
&lt;entry&gt;
&lt;key&gt;test&lt;/key&gt;
&lt;value&gt;dmFsdWUxMg&lt;/value&gt;
&lt;/entry&gt;
&lt;/service-data&gt;
&lt;credentials&gt;
&lt;tokens/&gt;
&lt;secrets&gt;
&lt;entry&gt;
&lt;key&gt;secret1&lt;/key&gt;
&lt;value&gt;c2VjcmV0MQ&lt;/value&gt;
&lt;/entry&gt;
&lt;/secrets&gt;
&lt;/credentials&gt;
&lt;application-acls&gt;
&lt;entry&gt;
&lt;key&gt;VIEW_APP&lt;/key&gt;
&lt;value&gt;testuser3, testuser4&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;MODIFY_APP&lt;/key&gt;
&lt;value&gt;testuser1, testuser2&lt;/value&gt;
&lt;/entry&gt;
&lt;/application-acls&gt;
&lt;/am-container-spec&gt;
&lt;unmanaged-AM&gt;false&lt;/unmanaged-AM&gt;
&lt;max-app-attempts&gt;2&lt;/max-app-attempts&gt;
&lt;resource&gt;
&lt;memory&gt;1024&lt;/memory&gt;
&lt;vCores&gt;1&lt;/vCores&gt;
&lt;/resource&gt;
&lt;application-type&gt;YARN&lt;/application-type&gt;
&lt;keep-containers-across-application-attempts&gt;false&lt;/keep-containers-across-application-attempts&gt;
&lt;application-tags&gt;
&lt;tag&gt;tag 2&lt;/tag&gt;
&lt;tag&gt;tag1&lt;/tag&gt;
&lt;/application-tags&gt;
&lt;log-aggregation-context&gt;
&lt;log-include-pattern&gt;file1&lt;/log-include-pattern&gt;
&lt;log-exclude-pattern&gt;file2&lt;/log-exclude-pattern&gt;
&lt;rolled-log-include-pattern&gt;file3&lt;/rolled-log-include-pattern&gt;
&lt;rolled-log-exclude-pattern&gt;file4&lt;/rolled-log-exclude-pattern&gt;
&lt;log-aggregation-policy-class-name&gt;org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AllContainerLogAggregationPolicy&lt;/log-aggregation-policy-class-name&gt;
&lt;log-aggregation-policy-parameters&gt;&lt;/log-aggregation-policy-parameters&gt;
&lt;/log-aggregation-context&gt;
&lt;attempt-failures-validity-interval&gt;3600000&lt;/attempt-failures-validity-interval&gt;
&lt;reservation-id&gt;reservation_1454114874_1&lt;/reservation-id&gt;
&lt;am-black-listing-requests&gt;
&lt;am-black-listing-enabled&gt;true&lt;/am-black-listing-enabled&gt;
&lt;disable-failure-threshold&gt;0.01&lt;/disable-failure-threshold&gt;
&lt;/am-black-listing-requests&gt;
&lt;/application-submission-context&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 202
Transfer-Encoding: chunked
Location: http://rm-http-address:port/ws/v1/cluster/apps/application_1404204891930_0002
Content-Type: application/xml
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
</div></div></div>
<div class="section">
<h2><a name="Cluster_Application_State_API"></a>Cluster Application State API</h2>
<p>With the application state API, you can query the state of a submitted app as well kill a running app by modifying the state of a running app using a PUT request with the state set to &#x201c;KILLED&#x201d;. To perform the PUT operation, authentication has to be setup for the RM web services. In addition, you must be authorized to kill the app. Currently you can only change the state to &#x201c;KILLED&#x201d;; an attempt to change the state to any other results in a 400 error response. Examples of the unauthorized and bad request errors are below. When you carry out a successful PUT, the iniital response may be a 202. You can confirm that the app is killed by repeating the PUT request until you get a 200, querying the state using the GET method or querying for app information and checking the state. In the examples below, we repeat the PUT request and get a 200 response.</p>
<p>Please note that in order to kill an app, you must have an authentication filter setup for the HTTP interface. The functionality requires that a username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response.</p>
<p>This feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/state">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/state</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET
<ul>
<li>PUT</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_appstate_object"></a>Elements of <i>appstate</i> object</h3>
<p>When you make a request for the state of an app, the information returned has the following fields</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> state </td>
<td align="left"> string </td>
<td align="left"> The application state - can be one of &#x201c;NEW&#x201d;, &#x201c;NEW_SAVING&#x201d;, &#x201c;SUBMITTED&#x201d;, &#x201c;ACCEPTED&#x201d;, &#x201c;RUNNING&#x201d;, &#x201c;FINISHED&#x201d;, &#x201c;FAILED&#x201d;, &#x201c;KILLED&#x201d; </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON responses</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;state&quot;:&quot;ACCEPTED&quot;
}
</pre></div></div>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">{
&quot;state&quot;:&quot;KILLED&quot;
}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 202 Accepted
Content-Type: application/json
Transfer-Encoding: chunked
Location: http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;state&quot;:&quot;ACCEPTED&quot;
}
PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">{
&quot;state&quot;:&quot;KILLED&quot;
}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;state&quot;:&quot;KILLED&quot;
}
</pre></div></div>
<p><b>XML responses</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 99
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appstate&gt;
&lt;state&gt;ACCEPTED&lt;/state&gt;
&lt;/appstate&gt;
</pre></div></div>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appstate&gt;
&lt;state&gt;KILLED&lt;/state&gt;
&lt;/appstate&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 202 Accepted
Content-Type: application/xml
Content-Length: 794
Location: http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appstate&gt;
&lt;state&gt;ACCEPTED&lt;/state&gt;
&lt;/appstate&gt;
</pre></div></div>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appstate&gt;
&lt;state&gt;KILLED&lt;/state&gt;
&lt;/appstate&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 917
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appstate&gt;
&lt;state&gt;KILLED&lt;/state&gt;
&lt;/appstate&gt;
</pre></div></div>
<p><b>Unauthorized Error Response</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appstate&gt;
&lt;state&gt;KILLED&lt;/state&gt;
&lt;/appstate&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 403 Unauthorized
Server: Jetty(6.1.26)
</pre></div></div>
<p><b>Bad Request Error Response</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appstate&gt;
&lt;state&gt;RUNNING&lt;/state&gt;
&lt;/appstate&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 400
Content-Length: 295
Content-Type: application/xml
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;RemoteException&gt;
&lt;exception&gt;BadRequestException&lt;/exception&gt;
&lt;message&gt;java.lang.Exception: Only 'KILLED' is allowed as a target state.&lt;/message&gt;
&lt;javaClassName&gt;org.apache.hadoop.yarn.webapp.BadRequestException&lt;/javaClassName&gt;
&lt;/RemoteException&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Application_Queue_API"></a>Cluster Application Queue API</h2>
<p>With the application queue API, you can query the queue of a submitted app as well move a running app to another queue using a PUT request specifying the target queue. To perform the PUT operation, authentication has to be setup for the RM web services. In addition, you must be authorized to move the app. Currently you can only move the app if you&#x2019;re using the Capacity scheduler or the Fair scheduler.</p>
<p>Please note that in order to move an app, you must have an authentication filter setup for the HTTP interface. The functionality requires that a username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response.</p>
<p>This feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/queue">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/queue</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET
<ul>
<li>PUT</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_appqueue_object"></a>Elements of <i>appqueue</i> object</h3>
<p>When you make a request for the state of an app, the information returned has the following fields</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> queue </td>
<td align="left"> string </td>
<td align="left"> The application queue </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON responses</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/queue
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;queue&quot;:&quot;default&quot;
}
</pre></div></div>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/queue
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">{
&quot;queue&quot;:&quot;test&quot;
}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;queue&quot;:&quot;test&quot;
}
</pre></div></div>
<p><b>XML responses</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/queue
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 98
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appqueue&gt;
&lt;queue&gt;default&lt;/queue&gt;
&lt;/appqueue&gt;
</pre></div></div>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/queue
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appqueue&gt;
&lt;queue&gt;test&lt;/queue&gt;
&lt;/appqueue&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 95
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;appqueue&gt;
&lt;queue&gt;test&lt;/queue&gt;
&lt;/appqueue&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Application_Priority_API"></a>Cluster Application Priority API</h2>
<p>With the application priority API, you can query the priority of a submitted app as well update priority of a running or accepted app using a PUT request specifying the target priority. To perform the PUT operation, authentication has to be setup for the RM web services. In addition, you must be authorized to update the app priority. Currently you can only update the app priority if you&#x2019;re using the Capacity scheduler.</p>
<p>Please note that in order to update priority of an app, you must have an authentication filter setup for the HTTP interface. The functionality requires that a username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response.</p>
<p>This feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/priority">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/priority</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET
<ul>
<li>PUT</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_apppriority_object"></a>Elements of <i>apppriority</i> object</h3>
<p>When you make a request for the state of an app, the information returned has the following fields</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> priority </td>
<td align="left"> int </td>
<td align="left"> The application priority </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON responses</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/priority
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;priority&quot;:0
}
</pre></div></div>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/priority
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">{
&quot;priority&quot;:8
}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;priority&quot;:8
}
</pre></div></div>
<p><b>XML responses</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/priority
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 98
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;applicationpriority&gt;
&lt;priority&gt;0&lt;/priority&gt;
&lt;/applicationpriority&gt;
</pre></div></div>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/priority
</pre></div></div>
<p>Request Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;applicationpriority&gt;
&lt;priority&gt;8&lt;/priority&gt;
&lt;/applicationpriority&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source">HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 95
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;applicationpriority&gt;
&lt;priority&gt;8&lt;/priority&gt;
&lt;/applicationpriority&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Delegation_Tokens_API"></a>Cluster Delegation Tokens API</h2>
<p>The Delegation Tokens API can be used to create, renew and cancel YARN ResourceManager delegation tokens. All delegation token requests must be carried out on a Kerberos authenticated connection(using SPNEGO). Carrying out operations on a non-kerberos connection will result in a FORBIDDEN response. In case of renewing a token, only the renewer specified when creating the token can renew the token. Other users(including the owner) are forbidden from renewing tokens. It should be noted that when cancelling or renewing a token, the token to be cancelled or renewed is specified by setting a header.</p>
<p>This feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<p>Use the following URI to create and cancel delegation tokens.</p>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/delegation-token">http://rm-http-address:port/ws/v1/cluster/delegation-token</a></li>
</ul>
<p>Use the following URI to renew delegation tokens.</p>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/delegation-token/expiration">http://rm-http-address:port/ws/v1/cluster/delegation-token/expiration</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>POST
<ul>
<li>DELETE</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_delegation-token_object"></a>Elements of the <i>delegation-token</i> object</h3>
<p>The response from the delegation tokens API contains one of the fields listed below.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> token </td>
<td align="left"> string </td>
<td align="left"> The delegation token </td></tr>
<tr class="a">
<td align="left"> renewer </td>
<td align="left"> string </td>
<td align="left"> The user who is allowed to renew the delegation token </td></tr>
<tr class="b">
<td align="left"> owner </td>
<td align="left"> string </td>
<td align="left"> The owner of the delegation token </td></tr>
<tr class="a">
<td align="left"> kind </td>
<td align="left"> string </td>
<td align="left"> The kind of delegation token </td></tr>
<tr class="b">
<td align="left"> expiration-time </td>
<td align="left"> long </td>
<td align="left"> The expiration time of the token </td></tr>
<tr class="a">
<td align="left"> max-validity </td>
<td align="left"> long </td>
<td align="left"> The maximum validity of the token </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<div class="section">
<h4><a name="Creating_a_token"></a>Creating a token</h4>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/delegation-token
Accept: application/json
Content-Type: application/json
{
&quot;renewer&quot; : &quot;test-renewer&quot;
}
</pre></div></div>
<p>Response Header</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
WWW-Authenticate: Negotiate ...
Date: Sat, 28 Jun 2014 18:08:11 GMT
Server: Jetty(6.1.26)
Set-Cookie: ...
Content-Type: application/json
</pre></div></div>
<p>Response body</p>
<div>
<div>
<pre class="source"> {
&quot;token&quot;:&quot;MgASY2xpZW50QEVYQU1QTEUuQ09NDHRlc3QtcmVuZXdlcgCKAUckiEZpigFHSJTKaQECFN9EMM9BzfPoDxu572EVUpzqhnSGE1JNX0RFTEVHQVRJT05fVE9LRU4A&quot;,
&quot;renewer&quot;:&quot;test-renewer&quot;,
&quot;owner&quot;:&quot;client@EXAMPLE.COM&quot;,
&quot;kind&quot;:&quot;RM_DELEGATION_TOKEN&quot;,
&quot;expiration-time&quot;:1405153616489,
&quot;max-validity&quot;:1405672016489
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/delegation-token
Accept: application/xml
Content-Type: application/xml
&lt;delegation-token&gt;
&lt;renewer&gt;test-renewer&lt;/renewer&gt;
&lt;/delegation-token&gt;
</pre></div></div>
<p>Response Header</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
WWW-Authenticate: Negotiate ...
Date: Sat, 28 Jun 2014 18:08:11 GMT
Content-Length: 423
Server: Jetty(6.1.26)
Set-Cookie: ...
Content-Type: application/xml
</pre></div></div>
<p>Response Body</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;delegation-token&gt; &lt;token&gt;MgASY2xpZW50QEVYQU1QTEUuQ09NDHRlc3QtcmVuZXdlcgCKAUckgZ8yigFHSI4jMgcCFDTG8X6XFFn2udQngzSXQL8vWaKIE1JNX0RFTEVHQVRJT05fVE9LRU4A&lt;/token&gt;
&lt;renewer&gt;test-renewer&lt;/renewer&gt;
&lt;owner&gt;client@EXAMPLE.COM&lt;/owner&gt;
&lt;kind&gt;RM_DELEGATION_TOKEN&lt;/kind&gt;
&lt;expiration-time&gt;1405153180466&lt;/expiration-time&gt;
&lt;max-validity&gt;1405671580466&lt;/max-validity&gt;
&lt;/delegation-token&gt;
</pre></div></div>
</div>
<div class="section">
<h4><a name="Renewing_a_token"></a>Renewing a token</h4>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/delegation-token/expiration
Accept: application/json
Hadoop-YARN-RM-Delegation-Token: MgASY2xpZW50QEVYQU1QTEUuQ09NDHRlc3QtcmVuZXdlcgCKAUbjqcHHigFHB7ZFxwQCFKWD3znCkDSy6SQIjRCLDydxbxvgE1JNX0RFTEVHQVRJT05fVE9LRU4A
Content-Type: application/json
</pre></div></div>
<p>Response Header</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
WWW-Authenticate: Negotiate ...
Date: Sat, 28 Jun 2014 18:08:11 GMT
Server: Jetty(6.1.26)
Set-Cookie: ...
Content-Type: application/json
</pre></div></div>
<p>Response body</p>
<div>
<div>
<pre class="source"> {
&quot;expiration-time&quot;:1404112520402
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/delegation-token/expiration
Accept: application/xml
Content-Type: application/xml
Hadoop-YARN-RM-Delegation-Token: MgASY2xpZW50QEVYQU1QTEUuQ09NDHRlc3QtcmVuZXdlcgCKAUbjqcHHigFHB7ZFxwQCFKWD3znCkDSy6SQIjRCLDydxbxvgE1JNX0RFTEVHQVRJT05fVE9LRU4A
</pre></div></div>
<p>Response Header</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
WWW-Authenticate: Negotiate ...
Date: Sat, 28 Jun 2014 18:08:11 GMT
Content-Length: 423
Server: Jetty(6.1.26)
Set-Cookie: ...
Content-Type: application/xml
</pre></div></div>
<p>Response Body</p>
<div>
<div>
<pre class="source"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;delegation-token&gt;
&lt;expiration-time&gt;1404112520402&lt;/expiration-time&gt;
&lt;/delegation-token&gt;
</pre></div></div>
</div>
<div class="section">
<h4><a name="Cancelling_a_token"></a>Cancelling a token</h4>
<p>HTTP Request</p>
<div>
<div>
<pre class="source">DELETE http://rm-http-address:port/ws/v1/cluster/delegation-token
Hadoop-YARN-RM-Delegation-Token: MgASY2xpZW50QEVYQU1QTEUuQ09NDHRlc3QtcmVuZXdlcgCKAUbjqcHHigFHB7ZFxwQCFKWD3znCkDSy6SQIjRCLDydxbxvgE1JNX0RFTEVHQVRJT05fVE9LRU4A
Accept: application/xml
</pre></div></div>
<p>Response Header</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
WWW-Authenticate: Negotiate ...
Date: Sun, 29 Jun 2014 07:25:18 GMT
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
Set-Cookie: ...
Content-Type: application/xml
</pre></div></div>
<p>No response body.</p></div></div>
<div class="section">
<h3><a name="Authentication_using_delegation_tokens"></a>Authentication using delegation tokens</h3>
<p>This feature is in the alpha mode and may change in the future.</p>
<p>You can use delegation tokens to authenticate yourself when using YARN RM webservices. However, this requires setting the right configurations. The conditions for this are:</p>
<ul>
<li>
<p>Hadoop is setup in secure mode with the authentication type set to kerberos.</p>
</li>
<li>
<p>Hadoop HTTP authentication is setup with the authentication type set to kerberos</p>
</li>
</ul>
<p>Once setup, delegation tokens can be fetched using the web services listed above and used as shown in an example below:</p>
<div>
<div>
<pre class="source"> PUT http://rm-http-address:port/ws/v1/cluster/apps/application_1399397633663_0003/state
X-Hadoop-Delegation-Token: MgASY2xpZW50QEVYQU1QTEUuQ09NDHRlc3QtcmVuZXdlcgCKAUbjqcHHigFHB7ZFxwQCFKWD3znCkDSy6SQIjRCLDydxbxvgE1JNX0RFTEVHQVRJT05fVE9LRU4A
Content-Type: application/json; charset=UTF8
{
&quot;state&quot;:&quot;KILLED&quot;
}
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Reservation_API_List"></a>Cluster Reservation API List</h2>
<p>The Cluster Reservation API can be used to list reservations. When listing reservations the user must specify the constraints in terms of a queue, reservation-id, start time or end time. The user must also specify whether or not to include the full resource allocations of the reservations being listed. The resulting page returns a response containing information related to the reservation such as the acceptance time, the user, the resource allocations, the reservation-id, as well as the reservation definition.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/reservation/list">http://rm-http-address:port/ws/v1/cluster/reservation/list</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<ul>
<li>queue - the queue name containing the reservations to be listed. if not set, this value will default to &#x201c;default&#x201d;.
<ul>
<li>reservation-id - the reservation-id of the reservation which will be listed. If this parameter is present, start-time and end-time will be ignored.</li>
<li>start-time - reservations that end after this start-time will be listed. If unspecified or invalid, this will default to 0.</li>
<li>end-time - reservations that start after this end-time will be listed. If unspecified or invalid, this will default to Long.MaxValue.</li>
<li>include-resource-allocations - true or false. If true, the resource allocations of the reservation will be included in the response. If false, no resource allocations will be included in the response. This will default to false.</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_ReservationListInfo_object"></a>Elements of the <i>ReservationListInfo</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> reservations </td>
<td align="left"> array of ReservationInfo(JSON) / zero or more ReservationInfo objects(XML) </td>
<td align="left"> The reservations that are listed with the given query </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_reservations_object"></a>Elements of the <i>reservations</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> acceptance-time </td>
<td align="left"> long </td>
<td align="left"> Time that the reservation was accepted </td></tr>
<tr class="a">
<td align="left"> resource-allocations </td>
<td align="left"> array of ResourceAllocationInfo(JSON) / zero or more ResourceAllocationInfo objects(XML) </td>
<td align="left"> Resource allocation information for the reservation </td></tr>
<tr class="b">
<td align="left"> reservation-id </td>
<td align="left"> A single ReservationId string </td>
<td align="left"> The unique reservation identifier </td></tr>
<tr class="a">
<td align="left"> reservation-definition </td>
<td align="left"> A single ReservationDefinition Object </td>
<td align="left"> A set of constraints representing the need for resources over time of a user </td></tr>
<tr class="b">
<td align="left"> user </td>
<td align="left"> string </td>
<td align="left"> User who made the reservation </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_resource-allocations_object"></a>Elements of the <i>resource-allocations</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> resource </td>
<td align="left"> A single Resource object </td>
<td align="left"> The resources allocated for the reservation allocation </td></tr>
<tr class="a">
<td align="left"> startTime </td>
<td align="left"> long </td>
<td align="left"> Start time that the resource is allocated for </td></tr>
<tr class="b">
<td align="left"> endTime </td>
<td align="left"> long </td>
<td align="left"> End time that the resource is allocated for </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the__resource_object"></a>Elements of the <i>resource</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> The memory allocated for the reservation allocation </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> The number of cores allocated for the reservation allocation </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_reservation-definition_object"></a>Elements of the <i>reservation-definition</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> arrival </td>
<td align="left"> long </td>
<td align="left"> The UTC time representation of the earliest time this reservation can be allocated from. </td></tr>
<tr class="a">
<td align="left"> deadline </td>
<td align="left"> long </td>
<td align="left"> The UTC time representation of the latest time within which this reservation can be allocated. </td></tr>
<tr class="b">
<td align="left"> reservation-name </td>
<td align="left"> string </td>
<td align="left"> A mnemonic name of the reservation (not a valid identifier). </td></tr>
<tr class="a">
<td align="left"> reservation-requests </td>
<td align="left"> object </td>
<td align="left"> A list of &#x201c;stages&#x201d; or phases of this reservation, each describing resource requirements and duration </td></tr>
<tr class="b">
<td align="left"> priority </td>
<td align="left"> int </td>
<td align="left"> An integer representing the priority of the reservation. A lower number for priority indicates a higher priority reservation. Recurring reservations are always higher priority than non-recurring reservations. Priority for non-recurring reservations are only compared with non-recurring reservations. Likewise with recurring reservations. </td></tr>
<tr class="a">
<td align="left"> recurrence-expression </td>
<td align="left"> string </td>
<td align="left"> A recurrence expression which represents the time period of a periodic job. Currently, only long values are supported. Later, support for regular expressions denoting arbitrary recurrence patterns (e.g., every Tuesday and Thursday) will be added. Recurrence is represented in milliseconds for periodic jobs. Recurrence is 0 for non-periodic jobs. Periodic jobs are valid until they are explicitly cancelled and have higher priority than non-periodic jobs (during initial placement and re-planning). Periodic job allocations are consistent across runs (flexibility in allocation is leveraged only during initial placement, allocations remain consistent thereafter). Note that the recurrence expression must be greater than the duration of the reservation (deadline - arrival). Also note that the configured max period must be divisible by the recurrence expression. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_reservation-requests_object"></a>Elements of the <i>reservation-requests</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> reservation-request-interpreter </td>
<td align="left"> int </td>
<td align="left"> A numeric choice of how to interpret the set of ReservationRequest: 0 is an ANY, 1 for ALL, 2 for ORDER, 3 for ORDER_NO_GAP </td></tr>
<tr class="a">
<td align="left"> reservation-request </td>
<td align="left"> object </td>
<td align="left"> The description of the resource and time capabilities for a phase/stage of this reservation </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_reservation-request_object"></a>Elements of the <i>reservation-request</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> duration </td>
<td align="left"> long </td>
<td align="left"> The duration of a ReservationRequest in milliseconds (amount of consecutive milliseconds a satisfiable allocation for this portion of the reservation should exist for). </td></tr>
<tr class="a">
<td align="left"> num-containers </td>
<td align="left"> int </td>
<td align="left"> The number of containers required in this phase of the reservation (capture the maximum parallelism of the job(s) in this phase). </td></tr>
<tr class="b">
<td align="left"> min-concurrency </td>
<td align="left"> int </td>
<td align="left"> The minimum number of containers that must be concurrently allocated to satisfy this allocation (capture min-parallelism, useful to express gang semantics). </td></tr>
<tr class="a">
<td align="left"> capability </td>
<td align="left"> object </td>
<td align="left"> Allows to specify the size of each container (memory, vCores).</td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="GET_Response_Examples"></a>GET Response Examples</h3>
<p>Get requests can be used to list reservations to the ResourceManager. As mentioned above, information pertaining to the reservation is returned upon success (in the body of the answer). Successful list requests result in a 200 response. Please note that in order to submit a reservation, you must have an authentication filter setup for the HTTP interface. the functionality requires that the username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response. Please note that this feature is currently in the alpha stage and may change in the future.</p>
<p><b>JSON response</b></p>
<p>This request return all active reservations within the start time 1455159355000 and 1475160036000. Since include-resource-allocations is set to true, the full set of resource allocations will be included in the response.</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/reservation/list?queue=dedicated&amp;start-time=1455159355000&amp;end-time=1475160036000&amp;include-resource-allocations=true
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Cache-Control: no-cache
Content-Encoding: gzip
Pragma: no-cache,no-cache
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;reservations&quot;: {
&quot;acceptance-time&quot;: &quot;1455160008442&quot;,
&quot;user&quot;: &quot;submitter&quot;,
&quot;resource-allocations&quot;: [
{
&quot;resource&quot;: {
&quot;memory&quot;: &quot;0&quot;,
&quot;vCores&quot;: &quot;0&quot;
},
&quot;startTime&quot;: &quot;1465541532000&quot;,
&quot;endTime&quot;: &quot;1465542250000&quot;
},
{
&quot;resource&quot;: {
&quot;memory&quot;: &quot;1024&quot;,
&quot;vCores&quot;: &quot;1&quot;
},
&quot;startTime&quot;: &quot;1465542250000&quot;,
&quot;endTime&quot;: &quot;1465542251000&quot;
},
{
&quot;resource&quot;: {
&quot;memory&quot;: &quot;0&quot;,
&quot;vCores&quot;: &quot;0&quot;
},
&quot;startTime&quot;: &quot;1465542251000&quot;,
&quot;endTime&quot;: &quot;1465542252000&quot;
}
],
&quot;reservation-id&quot;: &quot;reservation_1458852875788_0002&quot;,
&quot;reservation-definition&quot;: {
&quot;arrival&quot;: &quot;1465541532000&quot;,
&quot;deadline&quot;: &quot;1465542252000&quot;,
&quot;reservation-requests&quot;: {
&quot;reservation-request-interpreter&quot;: &quot;0&quot;,
&quot;reservation-request&quot;: {
&quot;capability&quot;: {
&quot;memory&quot;: &quot;1024&quot;,
&quot;vCores&quot;: &quot;1&quot;
},
&quot;min-concurrency&quot;: &quot;1&quot;,
&quot;num-containers&quot;: &quot;1&quot;,
&quot;duration&quot;: &quot;60&quot;
}
},
&quot;reservation-name&quot;: &quot;res_1&quot;
}
}
}
</pre></div></div>
<p><b>XML Response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> GET http://rm-http-address:port/ws/v1/cluster/reservation/list?queue=dedicated&amp;start-time=1455159355000&amp;end-time=1475160036000&amp;include-resource-allocations=true
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-length: 395
Cache-Control: no-cache
Content-Encoding: gzip
Pragma: no-cache,no-cache
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;reservationListInfo&gt;
&lt;reservations&gt;
&lt;acceptance-time&gt;1455233661003&lt;/acceptance-time&gt;
&lt;user&gt;dr.who&lt;/user&gt;
&lt;resource-allocations&gt;
&lt;resource&gt;
&lt;memory&gt;0&lt;/memory&gt;
&lt;vCores&gt;0&lt;/vCores&gt;
&lt;/resource&gt;
&lt;startTime&gt;1465541532000&lt;/startTime&gt;
&lt;endTime&gt;1465542251000&lt;/endTime&gt;
&lt;/resource-allocations&gt;
&lt;resource-allocations&gt;
&lt;resource&gt;
&lt;memory&gt;1024&lt;/memory&gt;
&lt;vCores&gt;1&lt;/vCores&gt;
&lt;/resource&gt;
&lt;startTime&gt;1465542251000&lt;/startTime&gt;
&lt;endTime&gt;1465542252000&lt;/endTime&gt;
&lt;/resource-allocations&gt;
&lt;reservation-id&gt;reservation_1458852875788_0002&lt;/reservation-id&gt;
&lt;reservation-definition&gt;
&lt;arrival&gt;1465541532000&lt;/arrival&gt;
&lt;deadline&gt;1465542252000&lt;/deadline&gt;
&lt;reservation-requests&gt;
&lt;reservation-request-interpreter&gt;0&lt;/reservation-request-interpreter&gt;
&lt;reservation-request&gt;
&lt;capability&gt;
&lt;memory&gt;1024&lt;/memory&gt;
&lt;vCores&gt;1&lt;/vCores&gt;
&lt;/capability&gt;
&lt;min-concurrency&gt;1&lt;/min-concurrency&gt;
&lt;num-containers&gt;1&lt;/num-containers&gt;
&lt;duration&gt;60&lt;/duration&gt;
&lt;/reservation-request&gt;
&lt;/reservation-requests&gt;
&lt;reservation-name&gt;res_1&lt;/reservation-name&gt;
&lt;/reservation-definition&gt;
&lt;/reservations&gt;
&lt;/reservationListInfo&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Reservation_API_Create"></a>Cluster Reservation API Create</h2>
<p>Use the New Reservation API, to obtain a reservation-id which can then be used as part of the <a href="#Cluster_Reservation_API_Submit">Cluster Reservation API Submit</a> to submit reservations.</p>
<p>This feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/reservation/new-reservation">http://rm-http-address:port/ws/v1/cluster/reservation/new-reservation</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>POST</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Elements_of_the_new-reservation_object"></a>Elements of the new-reservation object</h3>
<p>The new-reservation response contains the following elements:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> reservation-id </td>
<td align="left"> string </td>
<td align="left"> The newly created reservation id </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/reservation/new-reservation
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;reservation-id&quot;:&quot;reservation_1404198295326_0003&quot;
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/reservation/new-reservation
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 248
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;new-reservation&gt;
&lt;reservation-id&gt;reservation_1404198295326_0003&lt;/reservation-id&gt;
&lt;/new-reservation&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Reservation_API_Submit"></a>Cluster Reservation API Submit</h2>
<p>The Cluster Reservation API can be used to submit reservations. When submitting a reservation the user specifies the constraints in terms of resources, and time that is required. The resulting response is successful if the reservation can be made. If a reservation-id is used to submit a reservation multiple times, the request will succeed if the reservation definition is the same, but only one reservation will be created. If the reservation definition is different, the server will respond with an error response. When the reservation is made, the user can use the reservation-id used to submit the reservation to get access to the resources by specifying it as part of <a href="#Cluster_Applications_APISubmit_Application">Cluster Submit Applications API</a>.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/reservation/submit">http://rm-http-address:port/ws/v1/cluster/reservation/submit</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>POST</li>
</ul></div>
<div class="section">
<h3><a name="POST_Response_Examples"></a>POST Response Examples</h3>
<p>POST requests can be used to submit reservations to the ResourceManager. As mentioned above, a reservation-id is returned upon success (in the body of the answer). Successful submissions result in a 200 response. Please note that in order to submit a reservation, you must have an authentication filter setup for the HTTP interface. The functionality requires that a username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response.</p>
<p>Please note that this feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h4><a name="Elements_of_the_POST_request_object"></a>Elements of the POST request object</h4>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> queue </td>
<td align="left"> string </td>
<td align="left"> The (reservable) queue you are submitting to</td></tr>
<tr class="a">
<td align="left"> reservation-definition </td>
<td align="left"> object </td>
<td align="left"> A set of constraints representing the need for resources over time of a user. </td></tr>
<tr class="b">
<td align="left"> reservation-id </td>
<td align="left"> string </td>
<td align="left"> The reservation id to use to submit the reservation. </td></tr>
</tbody>
</table>
<p>Elements of the <i>reservation-definition</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left">arrival </td>
<td align="left"> long </td>
<td align="left"> The UTC time representation of the earliest time this reservation can be allocated from. </td></tr>
<tr class="a">
<td align="left"> deadline </td>
<td align="left"> long </td>
<td align="left"> The UTC time representation of the latest time within which this reservation can be allocated. </td></tr>
<tr class="b">
<td align="left"> reservation-name </td>
<td align="left"> string </td>
<td align="left"> A mnemonic name of the reservation (not a valid identifier). </td></tr>
<tr class="a">
<td align="left"> reservation-requests </td>
<td align="left"> object </td>
<td align="left"> A list of &#x201c;stages&#x201d; or phases of this reservation, each describing resource requirements and duration </td></tr>
<tr class="b">
<td align="left"> priority </td>
<td align="left"> int </td>
<td align="left"> An integer representing the priority of the reservation. A lower number for priority indicates a higher priority reservation. Recurring reservations are always higher priority than non-recurring reservations. Priority for non-recurring reservations are only compared with non-recurring reservations. Likewise with recurring reservations. </td></tr>
</tbody>
</table>
<p>Elements of the <i>reservation-requests</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> reservation-request-interpreter </td>
<td align="left"> int </td>
<td align="left"> A numeric choice of how to interpret the set of ReservationRequest: 0 is an ANY, 1 for ALL, 2 for ORDER, 3 for ORDER_NO_GAP </td></tr>
<tr class="a">
<td align="left"> reservation-request </td>
<td align="left"> object </td>
<td align="left"> The description of the resource and time capabilities for a phase/stage of this reservation </td></tr>
</tbody>
</table>
<p>Elements of the <i>reservation-request</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> duration </td>
<td align="left"> long </td>
<td align="left"> The duration of a ReservationRequeust in milliseconds (amount of consecutive milliseconds a satisfiable allocation for this portion of the reservation should exist for). </td></tr>
<tr class="a">
<td align="left"> num-containers </td>
<td align="left"> int </td>
<td align="left"> The number of containers required in this phase of the reservation (capture the maximum parallelism of the job(s) in this phase). </td></tr>
<tr class="b">
<td align="left"> min-concurrency </td>
<td align="left"> int </td>
<td align="left"> The minimum number of containers that must be concurrently allocated to satisfy this allocation (capture min-parallelism, useful to express gang semantics). </td></tr>
<tr class="a">
<td align="left"> capability </td>
<td align="left"> object </td>
<td align="left"> Allows to specify the size of each container (memory, vCores).</td></tr>
</tbody>
</table>
<p>Elements of the <i>capability</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> the number of MB of memory for this container </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> the number of virtual cores for this container </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>This examples contains a reservation composed of two stages (alternative to each other as the <i>reservation-request-interpreter</i> is set to 0), so that the first is shorter and &#x201c;taller&#x201d; and &#x201c;gang&#x201d; with exactly 220 containers for 60 seconds, while the second alternative is longer with 120 seconds duration and less tall with 110 containers (and a min-concurrency of 1 container, thus no gang semantics).</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source">POST http://rmdns:8088/ws/v1/cluster/reservation/submit
Content-Type: application/json
{
&quot;queue&quot; : &quot;dedicated&quot;,
&quot;reservation-id&quot;:&quot;reservation_1404198295326_0003&quot;
&quot;reservation-definition&quot; : {
&quot;arrival&quot; : 1765541532000,
&quot;deadline&quot; : 1765542252000,
&quot;reservation-name&quot; : &quot;res_1&quot;,
&quot;reservation-requests&quot; : {
&quot;reservation-request-interpreter&quot; : 0,
&quot;reservation-request&quot; : [
{
&quot;duration&quot; : 60000,
&quot;num-containers&quot; : 220,
&quot;min-concurrency&quot; : 220,
&quot;capability&quot; : {
&quot;memory&quot; : 1024,
&quot;vCores&quot; : 1
}
},
{
&quot;duration&quot; : 120000,
&quot;num-containers&quot; : 110,
&quot;min-concurrency&quot; : 1,
&quot;capability&quot; : {
&quot;memory&quot; : 1024,
&quot;vCores&quot; : 1
}
}
]
}
}
}
</pre></div></div>
<p>Response Header:</p>
<p>200 OK Cache-Control: no-cache Expires: Thu, 17 Dec 2015 23:36:34 GMT, Thu, 17 Dec 2015 23:36:34 GMT Date: Thu, 17 Dec 2015 23:36:34 GMT, Thu, 17 Dec 2015 23:36:34 GMT Pragma: no-cache, no-cache Content-Type: application/xml Content-Encoding: gzip Content-Length: 137 Server: Jetty(6.1.26)</p>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source">POST http://rmdns:8088/ws/v1/cluster/reservation/submit
Accept: application/xml
Content-Type: application/xml
&lt;reservation-submission-context&gt;
&lt;queue&gt;dedicated&lt;/queue&gt;
&lt;reservation-id&gt;reservation_1404198295326_0003&lt;/reservation-id&gt;
&lt;reservation-definition&gt;
&lt;arrival&gt;1765541532000&lt;/arrival&gt;
&lt;deadline&gt;1765542252000&lt;/deadline&gt;
&lt;reservation-name&gt;res_1&lt;/reservation-name&gt;
&lt;reservation-requests&gt;
&lt;reservation-request-interpreter&gt;0&lt;/reservation-request-interpreter&gt;
&lt;reservation-request&gt;
&lt;duration&gt;60000&lt;/duration&gt;
&lt;num-containers&gt;220&lt;/num-containers&gt;
&lt;min-concurrency&gt;220&lt;/min-concurrency&gt;
&lt;capability&gt;
&lt;memory&gt;1024&lt;/memory&gt;
&lt;vCores&gt;1&lt;/vCores&gt;
&lt;/capability&gt;
&lt;/reservation-request&gt;
&lt;reservation-request&gt;
&lt;duration&gt;120000&lt;/duration&gt;
&lt;num-containers&gt;110&lt;/num-containers&gt;
&lt;min-concurrency&gt;1&lt;/min-concurrency&gt;
&lt;capability&gt;
&lt;memory&gt;1024&lt;/memory&gt;
&lt;vCores&gt;1&lt;/vCores&gt;
&lt;/capability&gt;
&lt;/reservation-request&gt;
&lt;/reservation-requests&gt;
&lt;/reservation-definition&gt;
&lt;/reservation-submission-context&gt;
</pre></div></div>
<p>Response Header:</p>
<p>200 OK Cache-Control: no-cache Expires: Thu, 17 Dec 2015 23:49:21 GMT, Thu, 17 Dec 2015 23:49:21 GMT Date: Thu, 17 Dec 2015 23:49:21 GMT, Thu, 17 Dec 2015 23:49:21 GMT Pragma: no-cache, no-cache Content-Type: application/xml Content-Encoding: gzip Content-Length: 137 Server: Jetty(6.1.26)</p>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
</div></div></div>
<div class="section">
<h2><a name="Cluster_Reservation_API_Update"></a>Cluster Reservation API Update</h2>
<p>The Cluster Reservation API Update can be used to update existing reservations.Update of a Reservation works similarly to submit described above, but the user submits the reservation-id of an existing reservation to be updated. The semantics is a try-and-swap, successful operation will modify the existing reservation based on the requested update parameter, while a failed execution will leave the existing reservation unchanged.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/reservation/update">http://rm-http-address:port/ws/v1/cluster/reservation/update</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>POST</li>
</ul></div>
<div class="section">
<h3><a name="POST_Response_Examples"></a>POST Response Examples</h3>
<p>POST requests can be used to update reservations to the ResourceManager. Successful submissions result in a 200 response, indicate in-place update of the existing reservation (id does not change). Please note that in order to update a reservation, you must have an authentication filter setup for the HTTP interface. The functionality requires that a username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response.</p>
<p>Please note that this feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h4><a name="Elements_of_the_POST_request_object"></a>Elements of the POST request object</h4>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> reservation-id </td>
<td align="left"> string </td>
<td align="left"> The id of the reservation to be updated (the system automatically looks up the right queue from this)</td></tr>
<tr class="a">
<td align="left"> reservation-definition </td>
<td align="left"> object </td>
<td align="left"> A set of constraints representing the need for resources over time of a user. </td></tr>
</tbody>
</table>
<p>Elements of the <i>reservation-definition</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left">arrival </td>
<td align="left"> long </td>
<td align="left"> The UTC time representation of the earliest time this reservation can be allocated from. </td></tr>
<tr class="a">
<td align="left"> deadline </td>
<td align="left"> long </td>
<td align="left"> The UTC time representation of the latest time within which this reservation can be allocated. </td></tr>
<tr class="b">
<td align="left"> reservation-name </td>
<td align="left"> string </td>
<td align="left"> A mnemonic name of the reservation (not a valid identifier). </td></tr>
<tr class="a">
<td align="left"> reservation-requests </td>
<td align="left"> object </td>
<td align="left"> A list of &#x201c;stages&#x201d; or phases of this reservation, each describing resource requirements and duration </td></tr>
<tr class="b">
<td align="left"> priority </td>
<td align="left"> int </td>
<td align="left"> An integer representing the priority of the reservation. A lower number for priority indicates a higher priority reservation. Recurring reservations are always higher priority than non-recurring reservations. Priority for non-recurring reservations are only compared with non-recurring reservations. Likewise with recurring reservations. </td></tr>
</tbody>
</table>
<p>Elements of the <i>reservation-requests</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> reservation-request-interpreter </td>
<td align="left"> int </td>
<td align="left"> A numeric choice of how to interpret the set of ReservationRequest: 0 is an ANY, 1 for ALL, 2 for ORDER, 3 for ORDER_NO_GAP </td></tr>
<tr class="a">
<td align="left"> reservation-request </td>
<td align="left"> object </td>
<td align="left"> The description of the resource and time capabilities for a phase/stage of this reservation </td></tr>
</tbody>
</table>
<p>Elements of the <i>reservation-request</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> duration </td>
<td align="left"> long </td>
<td align="left"> The duration of a ReservationRequeust in milliseconds (amount of consecutive milliseconds a satisfiable allocation for this portion of the reservation should exist for). </td></tr>
<tr class="a">
<td align="left"> num-containers </td>
<td align="left"> int </td>
<td align="left"> The number of containers required in this phase of the reservation (capture the maximum parallelism of the job(s) in this phase). </td></tr>
<tr class="b">
<td align="left"> min-concurrency </td>
<td align="left"> int </td>
<td align="left"> The minimum number of containers that must be concurrently allocated to satisfy this allocation (capture min-parallelism, useful to express gang semantics). </td></tr>
<tr class="a">
<td align="left"> capability </td>
<td align="left"> object </td>
<td align="left"> Allows to specify the size of each container (memory, vCores).</td></tr>
</tbody>
</table>
<p>Elements of the <i>capability</i> object</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> memory </td>
<td align="left"> int </td>
<td align="left"> the number of MB of memory for this container </td></tr>
<tr class="a">
<td align="left"> vCores </td>
<td align="left"> int </td>
<td align="left"> the number of virtual cores for this container </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>This examples updates an existing reservation identified by <i>reservation_1449259268893_0005</i> with two stages (in order as the <i>reservation-request-interpreter</i> is set to 2), with the first stage being a &#x201c;gang&#x201d; of 10 containers for 5 minutes (min-concurrency of 10 containers) followed by a 50 containers for 10 minutes(min-concurrency of 1 container, thus no gang semantics).</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source">POST http://rmdns:8088/ws/v1/cluster/reservation/update
Accept: application/json
Content-Type: application/json
{
&quot;reservation-id&quot; : &quot;reservation_1449259268893_0005&quot;,
&quot;reservation-definition&quot; : {
&quot;arrival&quot; : 1765541532000,
&quot;deadline&quot; : 1765542252000,
&quot;reservation-name&quot; : &quot;res_1&quot;,
&quot;reservation-requests&quot; : {
&quot;reservation-request-interpreter&quot; : 2,
&quot;reservation-request&quot; : [
{
&quot;duration&quot; : 300000,
&quot;num-containers&quot; : 10,
&quot;min-concurrency&quot; : 10,
&quot;capability&quot; : {
&quot;memory&quot; : 1024,
&quot;vCores&quot; : 1
}
},
{
&quot;duration&quot; : 60000,
&quot;num-containers&quot; : 50,
&quot;min-concurrency&quot; : 1,
&quot;capability&quot; : {
&quot;memory&quot; : 1024,
&quot;vCores&quot; : 1
}
}
]
}
}
}
</pre></div></div>
<p>Response Header:</p>
<p>200 OK Cache-Control: no-cache Expires: Thu, 17 Dec 2015 23:36:34 GMT, Thu, 17 Dec 2015 23:36:34 GMT Date: Thu, 17 Dec 2015 23:36:34 GMT, Thu, 17 Dec 2015 23:36:34 GMT Pragma: no-cache, no-cache Content-Type: application/json Content-Encoding: gzip Content-Length: 137 Server: Jetty(6.1.26)</p>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source">POST http://rmdns:8088/ws/v1/cluster/reservation/update
Accept: application/xml
Content-Type: application/xml
&lt;reservation-update-context&gt;
&lt;reservation-id&gt;reservation_1449259268893_0005&lt;/reservation-id&gt;
&lt;reservation-definition&gt;
&lt;arrival&gt;1765541532000&lt;/arrival&gt;
&lt;deadline&gt;1765542252000&lt;/deadline&gt;
&lt;reservation-name&gt;res_1&lt;/reservation-name&gt;
&lt;reservation-requests&gt;
&lt;reservation-request-interpreter&gt;2&lt;/reservation-request-interpreter&gt;
&lt;reservation-request&gt;
&lt;duration&gt;300000&lt;/duration&gt;
&lt;num-containers&gt;10&lt;/num-containers&gt;
&lt;min-concurrency&gt;10&lt;/min-concurrency&gt;
&lt;capability&gt;
&lt;memory&gt;1024&lt;/memory&gt;
&lt;vCores&gt;1&lt;/vCores&gt;
&lt;/capability&gt;
&lt;/reservation-request&gt;
&lt;reservation-request&gt;
&lt;duration&gt;60000&lt;/duration&gt;
&lt;num-containers&gt;50&lt;/num-containers&gt;
&lt;min-concurrency&gt;1&lt;/min-concurrency&gt;
&lt;capability&gt;
&lt;memory&gt;1024&lt;/memory&gt;
&lt;vCores&gt;1&lt;/vCores&gt;
&lt;/capability&gt;
&lt;/reservation-request&gt;
&lt;/reservation-requests&gt;
&lt;/reservation-definition&gt;
&lt;/reservation-update-context&gt;
</pre></div></div>
<p>Response Header:</p>
<p>200 OK Cache-Control: no-cache Expires: Thu, 17 Dec 2015 23:49:21 GMT, Thu, 17 Dec 2015 23:49:21 GMT Date: Thu, 17 Dec 2015 23:49:21 GMT, Thu, 17 Dec 2015 23:49:21 GMT Pragma: no-cache, no-cache Content-Type: application/xml Content-Encoding: gzip Content-Length: 137 Server: Jetty(6.1.26)</p>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
</div></div></div>
<div class="section">
<h2><a name="Cluster_Reservation_API_Delete"></a>Cluster Reservation API Delete</h2>
<p>The Cluster Reservation API Delete can be used to delete existing reservations.Delete works similar to update. The requests contains the reservation-id, and if successful the reservation is cancelled, otherwise the reservation remains in the system.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/reservation/delete">http://rm-http-address:port/ws/v1/cluster/reservation/delete</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>POST</li>
</ul></div>
<div class="section">
<h3><a name="POST_Response_Examples"></a>POST Response Examples</h3>
<p>POST requests can be used to delete reservations to the ResourceManager. Successful submissions result in a 200 response, indicating that the delete succeeded. Please note that in order to delete a reservation, you must have an authentication filter setup for the HTTP interface. The functionality requires that a username is set in the HttpServletRequest. If no filter is setup, the response will be an &#x201c;UNAUTHORIZED&#x201d; response.</p>
<p>Please note that this feature is currently in the alpha stage and may change in the future.</p>
<div class="section">
<h4><a name="Elements_of_the_POST_request_object"></a>Elements of the POST request object</h4>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> reservation-id </td>
<td align="left"> string </td>
<td align="left"> The id of the reservation to be deleted (the system automatically looks up the right queue from this)</td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>This examples deletes an existing reservation identified by <i>reservation_1449259268893_0006</i></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source">POST http://10.200.91.98:8088/ws/v1/cluster/reservation/delete
Accept: application/json
Content-Type: application/json
{
&quot;reservation-id&quot; : &quot;reservation_1449259268893_0006&quot;
}
</pre></div></div>
<p>Response Header:</p>
<p>200 OK Cache-Control: no-cache Expires: Fri, 18 Dec 2015 01:31:05 GMT, Fri, 18 Dec 2015 01:31:05 GMT Date: Fri, 18 Dec 2015 01:31:05 GMT, Fri, 18 Dec 2015 01:31:05 GMT Pragma: no-cache, no-cache Content-Type: application/json Content-Encoding: gzip Transfer-Encoding: chunked Server: Jetty(6.1.26)</p>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source">POST http://10.200.91.98:8088/ws/v1/cluster/reservation/delete
Accept: application/xml
Content-Type: application/xml
&lt;reservation-delete-context&gt;
&lt;reservation-id&gt;reservation_1449259268893_0006&lt;/reservation-id&gt;
&lt;/reservation-delete-context&gt;
</pre></div></div>
<p>Response Header:</p>
<p>200 OK Cache-Control: no-cache Expires: Fri, 18 Dec 2015 01:33:23 GMT, Fri, 18 Dec 2015 01:33:23 GMT Date: Fri, 18 Dec 2015 01:33:23 GMT, Fri, 18 Dec 2015 01:33:23 GMT Pragma: no-cache, no-cache Content-Type: application/xml Content-Encoding: gzip Content-Length: 101 Server: Jetty(6.1.26)</p>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> No response body
</pre></div></div>
</div></div></div>
<div class="section">
<h2><a name="Cluster_Application_Timeouts_API"></a>Cluster Application Timeouts API</h2>
<p>Cluster Application Timeouts API can be used to get all configured timeouts of an application. When you run a GET operation on this resource, a collection of timeout objects is returned. Each timeout object is composed of a timeout type, expiry-time and remaining time in seconds.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_timeouts_.28Application_Timeouts.29_object"></a>Elements of the <i>timeouts</i> (Application Timeouts) object</h3>
<p>When you make a request for the list of application timeouts, the information will be returned as a collection of timeout objects. See also <a href="#Cluster_Application_Timeout_API">Cluster Application Timeout API</a> for syntax of the timeout object.</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> timeout </td>
<td align="left"> array of timeout objects(JSON)/zero or more application objects(XML) </td>
<td align="left"> The collection of application timeout objects </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/json
GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;timeouts&quot;:
{
&quot;timeout&quot;:
[
{
&quot;type&quot;: &quot;LIFETIME&quot;,
&quot;expiryTime&quot;: &quot;2016-12-05T22:51:00.104+0530&quot;,
&quot;remainingTimeInSeconds&quot;: 27
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 712
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;timeouts&gt;
&lt;timeout&gt;
&lt;type&gt;LIFETIME&lt;/type&gt;
&lt;expiryTime&gt;2016-12-05T22:51:00.104+0530&lt;/expiryTime&gt;
&lt;remainingTimeInSeconds&gt;27&lt;/remainingTimeInSeconds&gt;
&lt;/timeout&gt;
&lt;/timeouts&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Application_Timeout_API"></a>Cluster Application Timeout API</h2>
<p>The Cluster Application Timeout resource contains information about timeout.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts/{type}">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts/{type}</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_timeout_.28Application_Timeout.29_object"></a>Elements of the <i>timeout</i> (Application Timeout) object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> type </td>
<td align="left"> string </td>
<td align="left"> Timeout type. Valid values are the members of the ApplicationTimeoutType enum. LIFETIME is currently the only valid value. </td></tr>
<tr class="a">
<td align="left"> expiryTime </td>
<td align="left"> string </td>
<td align="left"> Time at which the application will expire in ISO8601 yyyy-MM-dd&#x2019;T&#x2019;HH:mm:ss.SSSZ format. If UNLIMITED, then application will run forever. </td></tr>
<tr class="b">
<td align="left"> remainingTimeInSeconds </td>
<td align="left"> long </td>
<td align="left"> Remaining time for configured application timeout. -1 indicates that application is not configured with timeout. Zero(0) indicates that application has expired with configured timeout type. </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/json
GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts/LIFETIME
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;timeout&quot;:
{
&quot;type&quot;: &quot;LIFETIME&quot;,
&quot;expiryTime&quot;: &quot;2016-12-05T22:51:00.104+0530&quot;,
&quot;remainingTimeInSeconds&quot;: 27
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
GET http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeouts/LIFETIME
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 712
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;timeout&gt;
&lt;type&gt;LIFETIME&lt;/type&gt;
&lt;expiryTime&gt;2016-12-05T22:51:00.104+0530&lt;/expiryTime&gt;
&lt;remainingTimeInSeconds&gt;27&lt;/remainingTimeInSeconds&gt;
&lt;/timeout&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Cluster_Application_Timeout_Update_API"></a>Cluster Application Timeout Update API</h2>
<p>Update timeout of an application for given timeout type.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeout">http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeout</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>PUT</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_timeout_object"></a>Elements of the <i>timeout</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> type </td>
<td align="left"> string </td>
<td align="left"> Timeout type. Valid values are the members of the ApplicationTimeoutType enum. LIFETIME is currently the only valid value. </td></tr>
<tr class="a">
<td align="left"> expiryTime </td>
<td align="left"> string </td>
<td align="left"> Time at which the application will expire in ISO8601 yyyy-MM-dd&#x2019;T&#x2019;HH:mm:ss.SSSZ format. </td></tr>
</tbody>
</table>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/json
PUT http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeout
Content-Type: application/json
{
&quot;timeout&quot;:
{
&quot;type&quot;: &quot;LIFETIME&quot;,
&quot;expiryTime&quot;: &quot;2016-11-27T09:36:16.678+05:30&quot;
}
}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;timeout&quot;:
{
&quot;type&quot;: &quot;LIFETIME&quot;,
&quot;expiryTime&quot;: &quot;2016-11-27T09:36:16.678+05:30&quot;,
&quot;remainingTimeInSeconds&quot;: 90
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
PUT http://rm-http-address:port/ws/v1/cluster/apps/{appid}/timeout
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;timeout&gt;
&lt;type&gt;LIFETIME&lt;/type&gt;
&lt;expiryTime&gt;2016-11-27T09:36:16.678+05:30&lt;/expiryTime&gt;
&lt;/timeout&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 712
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;timeout&gt;
&lt;type&gt;LIFETIME&lt;/type&gt;
&lt;expiryTime&gt;2016-11-27T09:36:16.678+05:30&lt;/expiryTime&gt;
&lt;remainingTimeInSeconds&gt;90&lt;/remainingTimeInSeconds&gt;
&lt;/timeout&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Scheduler_Configuration_Mutation_API"></a>Scheduler Configuration Mutation API</h2>
<p>The scheduler configuration mutation API provides a way to modify scheduler/queue configuration and queue hierarchy.</p>
<p>Please note that this feature is currently in the alpha stage and is subject to change.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/scheduler-conf">http://rm-http-address:port/ws/v1/cluster/scheduler-conf</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET
<ul>
<li>PUT</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_sched-conf_object"></a>Elements of the <i>sched-conf</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> update-queue </td>
<td align="left"> object </td>
<td align="left"> A queue whose configurations should be updated </td></tr>
<tr class="a">
<td align="left"> add-queue </td>
<td align="left"> object </td>
<td align="left"> A queue to add to the scheduler along with this queue&#x2019;s configurations </td></tr>
<tr class="b">
<td align="left"> remove-queue </td>
<td align="left"> string </td>
<td align="left"> Full path name of a queue to remove </td></tr>
<tr class="a">
<td align="left"> global-updates </td>
<td align="left"> map </td>
<td align="left"> Map of key value pairs to update scheduler&#x2019;s global configuration </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="GET_Request_Examples"></a>GET Request Examples</h3>
<p>Get requests are used to retrieve the scheduler&#x2019;s configuration that is currently loaded into scheduler&#x2019;s context.</p>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
Content-Type: application/xml
GET http://rm-http-address:port/ws/v1/cluster/scheduler-conf
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> TTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;configuration&gt;
&lt;property&gt;
&lt;name&gt;yarn.scheduler.capacity.root.queues&lt;/name&gt;
&lt;value&gt;default&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;yarn.scheduler.capacity.maximum-applications&lt;/name&gt;
&lt;value&gt;10000&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;yarn.scheduler.capacity.root.default.capacity&lt;/name&gt;
&lt;value&gt;100&lt;/value&gt;
&lt;/property&gt;
&lt;/configuration&gt;
</pre></div></div>
</div>
<div class="section">
<h3><a name="PUT_Request_Examples"></a>PUT Request Examples</h3>
<p>Put requests are used to modify the scheduler configuration. A successful mutation results in a 200 response. A malformed request or one which resulted in an invalid scheduler configuration results in a 400 response.</p>
<p><b>Updating queue configuration(s)</b></p>
<p>Request for updating queue configurations.</p>
<p><i>Elements of the</i> update-queue <i>object</i></p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> queue-name </td>
<td align="left"> string </td>
<td align="left"> Full path name of the queue to update </td></tr>
<tr class="a">
<td align="left"> params </td>
<td align="left"> map </td>
<td align="left"> A map of key value configuration pairs to update for this queue </td></tr>
</tbody>
</table>
<p>Assuming we are using the capacity scheduler and the current queue configuration is a single queue <i>root.default</i>, this example sets <i>root.default</i>&#x2019;s maximum applications to 100 and its minimum user limit percent to 10.</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;sched-conf&gt;
&lt;update-queue&gt;
&lt;queue-name&gt;root.default&lt;/queue-name&gt;
&lt;params&gt;
&lt;entry&gt;
&lt;key&gt;maximum-applications&lt;/key&gt;
&lt;value&gt;100&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;minimum-user-limit-percent&lt;/key&gt;
&lt;value&gt;10&lt;/value&gt;
&lt;/entry&gt;
&lt;/params&gt;
&lt;/update-queue&gt;
&lt;/sched-conf&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Transfer-Encoding: chunked
</pre></div></div>
<p><b>Adding a queue</b></p>
<p>Request for adding queues/updating queue configurations.</p>
<p><i>Elements of the</i> add-queue <i>object</i></p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> queue-name </td>
<td align="left"> string </td>
<td align="left"> Full path name of the queue to add </td></tr>
<tr class="a">
<td align="left"> params </td>
<td align="left"> map </td>
<td align="left"> A map of key value configuration pairs to set for this queue </td></tr>
</tbody>
</table>
<p>Assuming we are using the capacity scheduler and the current queue configuration is a single queue <i>root.default</i>, this example adds a queue <i>root.a</i> with capacity/maximum-capacity 10, and adjusts <i>root.default</i>&#x2019;s capacity/maximum-capacity to 90. (More complex examples include adding a queue whose parent is also being added in the same request, or adding multiple sibling queues.)</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;sched-conf&gt;
&lt;add-queue&gt;
&lt;queue-name&gt;root.a&lt;/queue-name&gt;
&lt;params&gt;
&lt;entry&gt;
&lt;key&gt;capacity&lt;/key&gt;
&lt;value&gt;10&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;maximum-capacity&lt;/key&gt;
&lt;value&gt;10&lt;/value&gt;
&lt;/entry&gt;
&lt;/params&gt;
&lt;/add-queue&gt;
&lt;update-queue&gt;
&lt;queue-name&gt;root.default&lt;/queue-name&gt;
&lt;params&gt;
&lt;entry&gt;
&lt;key&gt;capacity&lt;/key&gt;
&lt;value&gt;90&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;maximum-capacity&lt;/key&gt;
&lt;value&gt;90&lt;/value&gt;
&lt;/entry&gt;
&lt;/params&gt;
&lt;/update-queue&gt;
&lt;/sched-conf&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Transfer-Encoding: chunked
</pre></div></div>
<p><b>Removing queues</b></p>
<p>Request for removing queues from the queue hierarchy.</p>
<p>Assuming we are using the capacity scheduler and the current queue configuration is three queues <i>root.default</i>, <i>root.a</i>, and <i>root.b</i>, this example removes both <i>root.a</i> and <i>root.b</i>. (More complex examples include removing a parent queue and its children.)</p>
<p><b>Note:</b> Queues must be put into <tt>STOPPED</tt> state before they are deleted. Any updated queue configuration should be a valid one i.e. queue-capacity at each <i>level</i> should be equal to 100%.</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;sched-conf&gt;
&lt;remove-queue&gt;root.a&lt;/remove-queue&gt;
&lt;remove-queue&gt;root.b&lt;/remove-queue&gt;
&lt;/sched-conf&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Transfer-Encoding: chunked
</pre></div></div>
<p><b>Updating global scheduler configurations</b></p>
<p>Request for updating global scheduler configurations. Assuming we are using the capacity scheduler, this example enables queue mappings. For global configuration updates, the full configuration key must be specified.</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;sched-conf&gt;
&lt;global-updates&gt;
&lt;entry&gt;
&lt;key&gt;yarn.scheduler.capacity.queue-mappings-override.enable&lt;/key&gt;
&lt;value&gt;true&lt;/value&gt;
&lt;/entry&gt;
&lt;/global-updates&gt;
&lt;/sched-conf&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Transfer-Encoding: chunked
</pre></div></div>
<p><b>Adding Node Labels to a queue</b></p>
<p>Assuming we are using the capacity scheduler and the current queue configuration is two queues root.default, and root.a, this example adds a Node Label x to the queue root.a. Create a Node Label x and assign the nodes with below commands.</p>
<p><tt>yarn rmadmin -addToClusterNodeLabels &quot;x(exclusive=true)&quot;</tt></p>
<p><tt>yarn rmadmin -replaceLabelsOnNode &quot;&lt;nodeId&gt;=x&quot;</tt></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;sched-conf&gt;
&lt;update-queue&gt;
&lt;queue-name&gt;root.a&lt;/queue-name&gt;
&lt;params&gt;
&lt;entry&gt;
&lt;key&gt;accessible-node-labels&lt;/key&gt;
&lt;value&gt;x&lt;/value&gt;
&lt;/entry&gt;
&lt;entry&gt;
&lt;key&gt;accessible-node-labels.x.capacity&lt;/key&gt;
&lt;value&gt;100&lt;/value&gt;
&lt;/entry&gt;
&lt;/params&gt;
&lt;/update-queue&gt;
&lt;update-queue&gt;
&lt;queue-name&gt;root&lt;/queue-name&gt;
&lt;params&gt;
&lt;entry&gt;
&lt;key&gt;accessible-node-labels.x.capacity&lt;/key&gt;
&lt;value&gt;100&lt;/value&gt;
&lt;/entry&gt;
&lt;/params&gt;
&lt;/update-queue&gt;
&lt;/sched-conf&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Transfer-Encoding: chunked
</pre></div></div>
<p><b>Removing Node Labels from a queue</b></p>
<p>Assuming we are using the capacity scheduler and the current queue configuration is two queues root.default, and root.a and Node Label x is assigned to queue root.a. This example unsets the Node Label x from the queue root.a and removes it.</p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
PUT http://rm-http-address:port/ws/v1/cluster/scheduler-conf
Content-Type: application/xml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;sched-conf&gt;
&lt;update-queue&gt;
&lt;queue-name&gt;root.a&lt;/queue-name&gt;
&lt;params&gt;
&lt;entry&gt;
&lt;key&gt;accessible-node-labels&lt;/key&gt;
&lt;value&gt;&lt;/value&gt;
&lt;/entry&gt;
&lt;/params&gt;
&lt;/update-queue&gt;
&lt;/sched-conf&gt;
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Transfer-Encoding: chunked
</pre></div></div>
<p><tt>yarn rmadmin -removeFromClusterNodeLabels x</tt></p></div></div>
<div class="section">
<h2><a name="Cluster_Container_Signal_API"></a>Cluster Container Signal API</h2>
<p>With the Container Signal API, you can send a signal to a specified container with one of the following commands: OUTPUT_THREAD_DUMP, GRACEFUL_SHUTDOWN and FORCEFUL_SHUTDOWN.</p>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<div>
<div>
<pre class="source"> http://rm-http-address:port/ws/v1/cluster/containers/{containerId}/signal/{command}
</pre></div></div>
</div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<div>
<div>
<pre class="source"> POST
</pre></div></div>
</div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<div>
<div>
<pre class="source"> None
</pre></div></div>
</div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/containers/container_1531404209605_0008_01_000001/signal/OUTPUT_THREAD_DUMP
Accept: application/json
Content-Type: application/json
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>No response body.</p>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> POST http://rm-http-address:port/ws/v1/cluster/containers/container_1531404209605_0008_01_000001/signal/OUTPUT_THREAD_DUMP
Accept: application/xml
Content-Type: application/xml
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 552
Server: Jetty(6.1.26)
</pre></div></div>
<p>No response body.</p></div></div>
<div class="section">
<h2><a name="Scheduler_Activities_API"></a>Scheduler Activities API</h2>
<p>The scheduler activities RESTful API is available if you are using capacity scheduler and can fetch scheduler activities info recorded in a scheduling cycle. The API returns a message that includes important scheduling activities info which has a hierarchical layout with following fields:</p>
<ul>
<li><b>Activities</b> - Activities is the root object of scheduler activities.</li>
<li><b>Allocations</b> - Allocations are allocation attempts based on partition or reservation.</li>
<li><b>Hierarchical Queues</b> - Hierarchical Queues where the scheduler have been tried to allocate containers to, each of them contains queue name, allocation state, optional diagnostic and optional children.</li>
<li><b>Applications</b> - Applications are shown as children of leaf queue, each of them contains the basic info about the application.</li>
<li><b>Requests</b> - Requests are shown as children of application, each of them contains the basic info about the request.</li>
<li><b>Nodes</b> - Nodes are shown as children of request, each of them contains node id, allocation state, optional name which should appear after allocating or reserving a container on the node, and optional diagnostic which should present if failed to allocate or reserve a container on this node. For aggregated nodes grouped by allocation state and diagnostic, each of them contains allocation state, aggregated node IDs and optional diagnostic.</li>
</ul>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/scheduler/activities">http://rm-http-address:port/ws/v1/cluster/scheduler/activities</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<p>Multiple parameters can be specified for GET operations.</p>
<ul>
<li>nodeId - specified node ID, if not specified, the scheduler will record the scheduling activities info for the next scheduling cycle on all nodes.
<ul>
<li>groupBy - aggregation type of application activities, currently only support &#x201c;diagnostic&#x201d; with which user can query aggregated activities grouped by allocation state and diagnostic.</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_Activities_object"></a>Elements of the <i>Activities</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> The node ID on which scheduler tries to allocate containers. </td></tr>
<tr class="a">
<td align="left"> timestamp </td>
<td align="left"> long </td>
<td align="left"> Timestamp of the activities. </td></tr>
<tr class="b">
<td align="left"> dateTime </td>
<td align="left"> string </td>
<td align="left"> Date time of the activities. </td></tr>
<tr class="a">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Top diagnostic of the activities about empty results, unavailable environments, or illegal input parameters, such as &#x201c;waiting for display&#x201d;, &#x201c;waiting for the next allocation&#x201d;, &#x201c;No node manager running in the cluster&#x201d;, &#x201c;Got invalid groupBy: xx, valid groupBy types: DIAGNOSTICS&#x201d; </td></tr>
<tr class="b">
<td align="left"> allocations </td>
<td align="left"> array of allocations </td>
<td align="left"> A collection of allocation objects. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Allocation_object"></a>Elements of the <i>Allocation</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> partition </td>
<td align="left"> string </td>
<td align="left"> Partition of the allocation. </td></tr>
<tr class="a">
<td align="left"> updatedContainerId </td>
<td align="left"> string </td>
<td align="left"> Updated(allocated or reserved) container id in the allocation. </td></tr>
<tr class="b">
<td align="left"> finalAllocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the allocation, including ALLOCATED, ALLOCATED_FROM_RESERVED, RESERVED, and SKIPPED. </td></tr>
<tr class="a">
<td align="left"> root </td>
<td align="left"> Queue </td>
<td align="left"> Queue object </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Queue_object"></a>Elements of the <i>Queue</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> name </td>
<td align="left"> string </td>
<td align="left"> Name of the queue. </td></tr>
<tr class="a">
<td align="left"> allocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the queue, including ACCEPTED, REJECTED, and SKIPPED. </td></tr>
<tr class="b">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Diagnostic of the queue. </td></tr>
<tr class="a">
<td align="left"> children </td>
<td align="left"> array of queues or applications </td>
<td align="left"> A collection of queue objects (for parent queues) or app objects (for leaf queues) </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Application_object"></a>Elements of the <i>Application</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> name </td>
<td align="left"> string </td>
<td align="left"> Name of the application. </td></tr>
<tr class="a">
<td align="left"> appPriority </td>
<td align="left"> string </td>
<td align="left"> Priority of the application. </td></tr>
<tr class="b">
<td align="left"> allocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the application, including ALLOCATED, RESERVED, RE_RESERVED, and SKIPPED. </td></tr>
<tr class="a">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Diagnostic of the application. </td></tr>
<tr class="b">
<td align="left"> children </td>
<td align="left"> array of requests </td>
<td align="left"> A collection of request objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Request_object"></a>Elements of the <i>Request</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> name </td>
<td align="left"> string </td>
<td align="left"> Name of the request, the value format is &#x201c;request_&lt;requestPriority&gt;_&lt;allocationRequestId&gt;&#x201d; which can be used to identify different requests. </td></tr>
<tr class="a">
<td align="left"> requestPriority </td>
<td align="left"> string </td>
<td align="left"> Priority of the request. </td></tr>
<tr class="b">
<td align="left"> allocationRequestId </td>
<td align="left"> string </td>
<td align="left"> Allocation request id of the request. </td></tr>
<tr class="a">
<td align="left"> allocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the application, including ALLOCATED, RESERVED, RE_RESERVED, and SKIPPED. </td></tr>
<tr class="b">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Diagnostic of the request. </td></tr>
<tr class="a">
<td align="left"> children </td>
<td align="left"> array of nodes </td>
<td align="left"> A collection of node objects. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Node_object"></a>Elements of the <i>Node</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> name </td>
<td align="left"> string </td>
<td align="left"> Container information which is optional and can be shown when allocation state is ALLOCATED, RESERVED or ALLOCATED_FROM_RESERVED. </td></tr>
<tr class="a">
<td align="left"> allocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the application, including ALLOCATED, RESERVED, RE_RESERVED, and SKIPPED. </td></tr>
<tr class="b">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Diagnostic about node in normal mode or nodes in aggregation mode </td></tr>
<tr class="a">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> The node id on which the scheduling process is based, won&#x2019;t show for aggregation query with groupBy parameter. </td></tr>
<tr class="b">
<td align="left"> nodeIds </td>
<td align="left"> array of strings </td>
<td align="left"> A collection of node IDs for aggregated activities, only show for aggregation query with groupBy parameter. </td></tr>
<tr class="a">
<td align="left"> count </td>
<td align="left"> int </td>
<td align="left"> The number of node IDs, only show for aggregation query with groupBy parameter. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/json
GET http://rm-http-address:port/ws/v1/cluster/scheduler/activities
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<p>Following is an output example when global scheduling is enabled, there are multiple activities at the node level for a single request. For single node placement, differences are that nodeId will be shown as a field of activities and there should be only one activity at the node level for every request.</p>
<div>
<div>
<pre class="source">{
&quot;activities&quot;: {
&quot;timestamp&quot;: 1562296830912,
&quot;dateTime&quot;: &quot;Fri Jul 05 11:20:30 CST 2019&quot;,
&quot;allocations&quot;: [
{
&quot;partition&quot;: &quot;&quot;,
&quot;finalAllocationState&quot;: &quot;ALLOCATED&quot;,
&quot;root&quot;: {
&quot;name&quot;: &quot;root&quot;,
&quot;allocationState&quot;: &quot;ACCEPTED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;a&quot;,
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Queue does not need more resources&quot;
},
{
&quot;name&quot;: &quot;b&quot;,
&quot;allocationState&quot;: &quot;ACCEPTED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;application_1562296828063_0001&quot;,
&quot;appPriority&quot;: 0,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;request_1_-1&quot;,
&quot;requestPriority&quot;: 1,
&quot;allocationRequestId&quot;: -1,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&lt;memory:3072, vCores:1&gt;, available=&lt;memory:2048, vCores:2&gt;&quot;,
&quot;nodeId&quot;: &quot;127.0.0.2:1234&quot;
},
{
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&lt;memory:3072, vCores:1&gt;, available=&lt;memory:2048, vCores:2&gt;&quot;,
&quot;nodeId&quot;: &quot;127.0.0.3:1234&quot;
},
{
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&lt;memory:3072, vCores:1&gt;, available=&lt;memory:2048, vCores:2&gt;&quot;,
&quot;nodeId&quot;: &quot;127.0.0.4:1234&quot;
},
{
&quot;name&quot;: &quot;Container: [ContainerId: null, AllocationRequestId: -1, Version: 0, NodeId: 127.0.0.1:1234, NodeHttpAddress: 127.0.0.1:2, Resource: &lt;memory:3072, vCores:1&gt;, Priority: 1, Token: null, ExecutionType: GUARANTEED, ]&quot;,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;nodeId&quot;: &quot;127.0.0.1:1234&quot;
}
]
}
]
}
]
}
]
}
}
]
}
}
</pre></div></div>
<p>When we query scheduler activities REST API with query parameters(&#x201c;groupBy=diagnostic&#x201d;), 4 node activities info will be grouped into 2 groups: SKIPPED group with the same diagnostic &#x201c;Node&#x2019;s total resource is insufficient for request, insufficient resources=[memory-mb]&#x201d; and ALLOCATED group, the output should be as follows:</p>
<div>
<div>
<pre class="source">{
&quot;activities&quot;: {
&quot;timestamp&quot;: 1562297536893,
&quot;dateTime&quot;: &quot;Fri Jul 05 11:32:16 CST 2019&quot;,
&quot;allocations&quot;: [
{
&quot;partition&quot;: &quot;&quot;,
&quot;finalAllocationState&quot;: &quot;ALLOCATED&quot;,
&quot;root&quot;: {
&quot;name&quot;: &quot;root&quot;,
&quot;allocationState&quot;: &quot;ACCEPTED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;a&quot;,
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Queue does not need more resources&quot;
},
{
&quot;name&quot;: &quot;b&quot;,
&quot;allocationState&quot;: &quot;ACCEPTED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;application_1562297533892_0001&quot;,
&quot;appPriority&quot;: 0,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;request_1_-1&quot;,
&quot;requestPriority&quot;: 1,
&quot;allocationRequestId&quot;: -1,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;count&quot;: 1,
&quot;nodeIds&quot;: [
&quot;127.0.0.1:1234&quot;
]
},
{
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]&quot;,
&quot;count&quot;: 3,
&quot;nodeIds&quot;: [
&quot;127.0.0.2:1234&quot;,
&quot;127.0.0.3:1234&quot;,
&quot;127.0.0.4:1234&quot;
]
}
]
}
]
}
]
}
]
}
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
GET http://rm-http-address:port/ws/v1/cluster/scheduler/activities
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;activities&gt;
&lt;timestamp&gt;1562296830912&lt;/timestamp&gt;
&lt;dateTime&gt;Fri Jul 05 11:20:30 CST 2019&lt;/dateTime&gt;
&lt;allocations&gt;
&lt;partition&gt;&lt;/partition&gt;
&lt;finalAllocationState&gt;ALLOCATED&lt;/finalAllocationState&gt;
&lt;root&gt;
&lt;name&gt;root&lt;/name&gt;
&lt;allocationState&gt;ACCEPTED&lt;/allocationState&gt;
&lt;children&gt;
&lt;name&gt;a&lt;/name&gt;
&lt;allocationState&gt;SKIPPED&lt;/allocationState&gt;
&lt;diagnostic&gt;Queue does not need more resource&lt;/diagnostic&gt;
&lt;/children&gt;
&lt;children&gt;
&lt;name&gt;b&lt;/name&gt;
&lt;allocationState&gt;ACCEPTED&lt;/allocationState&gt;
&lt;children&gt;
&lt;name&gt;application_1562296828063_0001&lt;/name&gt;
&lt;appPriority&gt;0&lt;/appPriority&gt;
&lt;allocationState&gt;ACCEPTED&lt;/allocationState&gt;
&lt;children&gt;
&lt;name&gt;request_1_-1&lt;/name&gt;
&lt;requestPriority&gt;1&lt;/requestPriority&gt;
&lt;allocationRequestId&gt;-1&lt;/allocationRequestId&gt;
&lt;allocationState&gt;ALLOCATED&lt;/allocationState&gt;
&lt;children&gt;
&lt;allocationState&gt;SKIPPED&lt;/allocationState&gt;
&lt;diagnostic&gt;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&amp;lt;memory:3072, vCores:1&amp;gt;, available=&amp;lt;memory:2048, vCores:2&amp;gt;&lt;/diagnostic&gt;
&lt;nodeId&gt;127.0.0.2:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;children&gt;
&lt;allocationState&gt;SKIPPED&lt;/allocationState&gt;
&lt;diagnostic&gt;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&amp;lt;memory:3072, vCores:1&amp;gt;, available=&amp;lt;memory:2048, vCores:2&amp;gt;&lt;/diagnostic&gt;
&lt;nodeId&gt;127.0.0.3:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;children&gt;
&lt;allocationState&gt;SKIPPED&lt;/allocationState&gt;
&lt;diagnostic&gt;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&amp;lt;memory:3072, vCores:1&amp;gt;, available=&amp;lt;memory:2048, vCores:2&amp;gt;&lt;/diagnostic&gt;
&lt;nodeId&gt;127.0.0.4:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;children&gt;
&lt;name&gt;Container: [ContainerId: null, AllocationRequestId: -1, Version: 0, NodeId: 127.0.0.1:1234, NodeHttpAddress: 127.0.0.1:2, Resource: &amp;lt;memory:3072, vCores:1&amp;gt;, Priority: 1, Token: null, ExecutionType: GUARANTEED, ]&lt;/name&gt;
&lt;allocationState&gt;ALLOCATED&lt;/allocationState&gt;
&lt;nodeId&gt;127.0.0.1:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;/children&gt;
&lt;/children&gt;
&lt;/children&gt;
&lt;/root&gt;
&lt;/allocations&gt;
&lt;/activities&gt;
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Application_Activities_API"></a>Application Activities API</h2>
<p>Application activities RESTful API is available if you are using capacity scheduler and can fetch useful scheduling info for a specified application, the response has a hierarchical layout with following fields:</p>
<ul>
<li><b>AppActivities</b> - AppActivities are root element of application activities within basic information.</li>
<li><b>Allocations</b> - Allocations are allocation attempts at app level queried from the cache.</li>
<li><b>Requests</b> - Requests are shown as children of allocation, each of them contains request name, request priority, allocation request id, allocation state and optional children.</li>
<li><b>Nodes</b> - Nodes are shown as children of request, each of them contains node id, allocation state, optional name which should appear after allocating or reserving a container on the node, and optional diagnostic which should appear if failed to allocate or reserve a container on the node. For aggregated nodes grouped by allocation state and diagnostic, each of them contains allocation state, aggregated node IDs and optional diagnostic.</li>
</ul>
<div class="section">
<h3><a name="URI"></a>URI</h3>
<ul>
<li><a class="externalLink" href="http://rm-http-address:port/ws/v1/cluster/scheduler/app-activities/{appid}">http://rm-http-address:port/ws/v1/cluster/scheduler/app-activities/{appid}</a></li>
</ul></div>
<div class="section">
<h3><a name="HTTP_Operations_Supported"></a>HTTP Operations Supported</h3>
<ul>
<li>GET</li>
</ul></div>
<div class="section">
<h3><a name="Query_Parameters_Supported"></a>Query Parameters Supported</h3>
<p>Multiple parameters can be specified for GET operations.</p>
<ul>
<li>maxTime - the max duration in seconds from now on for recording application activities. If not specified, this will default to 3 (seconds).
<ul>
<li>requestPriorities - the priorities of request, used to filter application activities, specified as a comma-separated list.</li>
<li>allocationRequestIds - the allocation request IDs of request, used to filter application activities, specified as a comma-separated list.</li>
<li>groupBy - the aggregation type of application activities, currently only support &#x201c;diagnostic&#x201d; with which user can query aggregated activities grouped by allocation state and diagnostic.</li>
<li>limit - the limit of application activities which can reduce the cost for both server and client side.</li>
<li>actions - the required actions of app activities including &#x201c;refresh&#x201d; and &#x201c;get&#x201d;, specified as a comma-separated list.</li>
<li>summarize - whether app activities in multiple scheduling processes need to be summarized, specified as boolean, it&#x2019;s useful when multi-node placement disabled, because only one node can be considered in a single scheduling process, enabling this can give us a summary with diagnostics on all nodes.</li>
</ul>
</li>
</ul></div>
<div class="section">
<h3><a name="Elements_of_the_AppActivities_object"></a>Elements of the <i>AppActivities</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> applicationId </td>
<td align="left"> string </td>
<td align="left"> The specified application id. </td></tr>
<tr class="a">
<td align="left"> allocations </td>
<td align="left"> array of allocations </td>
<td align="left"> A collection of allocation objects in descending order by time. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Allocation_object"></a>Elements of the <i>Allocation</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> ID of the node. </td></tr>
<tr class="a">
<td align="left"> timestamp </td>
<td align="left"> long </td>
<td align="left"> Timestamp of the allocation. </td></tr>
<tr class="b">
<td align="left"> dateTime </td>
<td align="left"> string </td>
<td align="left"> Date time of the allocation. </td></tr>
<tr class="a">
<td align="left"> queueName </td>
<td align="left"> string </td>
<td align="left"> Queue name of the application. </td></tr>
<tr class="b">
<td align="left"> appPriority </td>
<td align="left"> int </td>
<td align="left"> Priority of the application </td></tr>
<tr class="a">
<td align="left"> allocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the application, including ALLOCATED, RESERVED, RE_RESERVED, and SKIPPED. </td></tr>
<tr class="b">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Diagnostic of the application. </td></tr>
<tr class="a">
<td align="left"> children </td>
<td align="left"> array of requests </td>
<td align="left"> A collection of request objects </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Request_object"></a>Elements of the <i>Request</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> requestPriority </td>
<td align="left"> string </td>
<td align="left"> Priority of the request. </td></tr>
<tr class="a">
<td align="left"> allocationRequestId </td>
<td align="left"> string </td>
<td align="left"> Allocation request id of the request. </td></tr>
<tr class="b">
<td align="left"> allocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the application, including ALLOCATED, RESERVED, RE_RESERVED, and SKIPPED. </td></tr>
<tr class="a">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Diagnostic of the request. </td></tr>
<tr class="b">
<td align="left"> children </td>
<td align="left"> array of nodes </td>
<td align="left"> A collection of node objects. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Elements_of_the_Node_object"></a>Elements of the <i>Node</i> object</h3>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Item </th>
<th align="left"> Data Type </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> name </td>
<td align="left"> string </td>
<td align="left"> ID of the updated container, will show &#x201c;Container-Id-Not-Assigned&#x201d; if not assigned. </td></tr>
<tr class="a">
<td align="left"> allocationState </td>
<td align="left"> string </td>
<td align="left"> Final allocation state of the application, including ALLOCATED, RESERVED, RE_RESERVED, and SKIPPED. </td></tr>
<tr class="b">
<td align="left"> diagnostic </td>
<td align="left"> string </td>
<td align="left"> Diagnostic about node in normal mode or nodes in aggregation mode </td></tr>
<tr class="a">
<td align="left"> nodeId </td>
<td align="left"> string </td>
<td align="left"> The node id on which the scheduling process is based, won&#x2019;t show for aggregation query with groupBy parameter. </td></tr>
<tr class="b">
<td align="left"> nodeIds </td>
<td align="left"> array of strings </td>
<td align="left"> A collection of node IDs for aggregated app activities, only show for aggregation query with groupBy parameter. </td></tr>
<tr class="a">
<td align="left"> count </td>
<td align="left"> int </td>
<td align="left"> The number of node IDs, only show for aggregation query with groupBy parameter. </td></tr>
</tbody>
</table></div>
<div class="section">
<h3><a name="Response_Examples"></a>Response Examples</h3>
<p><b>JSON response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/json
GET http://rm-http-address:port/ws/v1/cluster/scheduler/app-activities/{appid}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.26)
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">{
&quot;appActivities&quot;: {
&quot;applicationId&quot;: &quot;application_1562312049195_0001&quot;,
&quot;allocations&quot;: [
{
&quot;timestamp&quot;: 1562312052039,
&quot;dateTime&quot;: &quot;Fri Jul 05 15:34:12 CST 2019&quot;,
&quot;queueName&quot;: &quot;b&quot;,
&quot;appPriority&quot;: 0,
&quot;allocationState&quot;: &quot;RESERVED&quot;,
&quot;children&quot;: [
{
&quot;requestPriority&quot;: 1,
&quot;allocationRequestId&quot;: -1,
&quot;allocationState&quot;: &quot;RESERVED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;Container-Id-Not-Assigned&quot;,
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&lt;memory:4096, vCores:1&gt;, available=&lt;memory:2048, vCores:2&gt;&quot;,
&quot;nodeId&quot;: &quot;127.0.0.3:1234&quot;
},
{
&quot;name&quot;: &quot;Container-Id-Not-Assigned&quot;,
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&lt;memory:4096, vCores:1&gt;, available=&lt;memory:2048, vCores:2&gt;&quot;,
&quot;nodeId&quot;: &quot;127.0.0.4:1234&quot;
},
{
&quot;name&quot;: &quot;Container-Id-Not-Assigned&quot;,
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&lt;memory:4096, vCores:1&gt;, available=&lt;memory:2048, vCores:2&gt;&quot;,
&quot;nodeId&quot;: &quot;127.0.0.2:1234&quot;
},
{
&quot;name&quot;: &quot;Container-Id-Not-Assigned&quot;,
&quot;allocationState&quot;: &quot;RESERVED&quot;,
&quot;diagnostic&quot;: &quot;Node does not have sufficient resource for request, insufficient resources=[memory-mb]\nrequired=&lt;memory:4096, vCores:1&gt;, available=&lt;memory:1024, vCores:3&gt;&quot;,
&quot;nodeId&quot;: &quot;127.0.0.1:1234&quot;
}
]
}
]
},
{
&quot;timestamp&quot;: 1562312052031,
&quot;dateTime&quot;: &quot;Fri Jul 05 15:34:12 CST 2019&quot;,
&quot;queueName&quot;: &quot;b&quot;,
&quot;appPriority&quot;: 0,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;requestPriority&quot;: 0,
&quot;allocationRequestId&quot;: -1,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;name&quot;: &quot;Container-Id-Not-Assigned&quot;,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;nodeId&quot;: &quot;127.0.0.2:1234&quot;
}
]
}
]
}
]
}
}
</pre></div></div>
<p>When we query scheduler activities REST API with a query parameter (&#x201c;groupBy=diagnostic&#x201d;), 4 node activities will be separated into two groups: SKIPPED group with the same diagnostic &#x201c;Node&#x2019;s total resource is insufficient for request, insufficient resources=[memory-mb]&#x201d; and ALLOCATED group, the output should be as follows:</p>
<div>
<div>
<pre class="source">{
&quot;appActivities&quot;: {
&quot;applicationId&quot;: &quot;application_1562312658870_0001&quot;,
&quot;allocations&quot;: [
{
&quot;timestamp&quot;: 1562312661536,
&quot;dateTime&quot;: &quot;Fri Jul 05 15:44:21 CST 2019&quot;,
&quot;queueName&quot;: &quot;b&quot;,
&quot;appPriority&quot;: 0,
&quot;allocationState&quot;: &quot;RESERVED&quot;,
&quot;children&quot;: [
{
&quot;requestPriority&quot;: 1,
&quot;allocationRequestId&quot;: -1,
&quot;allocationState&quot;: &quot;RESERVED&quot;,
&quot;children&quot;: [
{
&quot;allocationState&quot;: &quot;SKIPPED&quot;,
&quot;diagnostic&quot;: &quot;Node's total resource is insufficient for request, insufficient resources=[memory-mb]&quot;,
&quot;count&quot;: 3,
&quot;nodeIds&quot;: [
&quot;127.0.0.3:1234&quot;,
&quot;127.0.0.4:1234&quot;,
&quot;127.0.0.2:1234&quot;
]
},
{
&quot;allocationState&quot;: &quot;RESERVED&quot;,
&quot;diagnostic&quot;: &quot;Node does not have sufficient resource for request, insufficient resources=[memory-mb]&quot;,
&quot;count&quot;: 1,
&quot;nodeIds&quot;: [
&quot;127.0.0.1:1234&quot;
]
}
]
}
]
},
{
&quot;timestamp&quot;: 1562312661522,
&quot;dateTime&quot;: &quot;Fri Jul 05 15:44:21 CST 2019&quot;,
&quot;queueName&quot;: &quot;b&quot;,
&quot;appPriority&quot;: 0,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;requestPriority&quot;: 0,
&quot;allocationRequestId&quot;: -1,
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;children&quot;: [
{
&quot;allocationState&quot;: &quot;ALLOCATED&quot;,
&quot;count&quot;: 1,
&quot;nodeIds&quot;: [
&quot;127.0.0.2:1234&quot;
]
}
]
}
]
}
]
}
}
</pre></div></div>
<p><b>XML response</b></p>
<p>HTTP Request:</p>
<div>
<div>
<pre class="source"> Accept: application/xml
GET http://rm-http-address:port/ws/v1/cluster/scheduler/app-activities/{appid}
</pre></div></div>
<p>Response Header:</p>
<div>
<div>
<pre class="source"> HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Transfer-Encoding: chunked
</pre></div></div>
<p>Response Body:</p>
<div>
<div>
<pre class="source">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;appActivities&gt;
&lt;applicationId&gt;application_1562312049195_0001&lt;/applicationId&gt;
&lt;allocations&gt;
&lt;timestamp&gt;1562312052039&lt;/timestamp&gt;
&lt;dateTime&gt;Fri Jul 05 15:34:12 CST 2019&lt;/dateTime&gt;
&lt;queueName&gt;b&lt;/queueName&gt;
&lt;appPriority&gt;0&lt;/appPriority&gt;
&lt;allocationState&gt;RESERVED&lt;/allocationState&gt;
&lt;children&gt;
&lt;requestPriority&gt;1&lt;/requestPriority&gt;
&lt;allocationRequestId&gt;-1&lt;/allocationRequestId&gt;
&lt;allocationState&gt;RESERVED&lt;/allocationState&gt;
&lt;children&gt;
&lt;name&gt;Container-Id-Not-Assigned&lt;/name&gt;
&lt;allocationState&gt;SKIPPED&lt;/allocationState&gt;
&lt;diagnostic&gt;Node's total resource is insufficient for request, insufficient resources=[memory-mb]\nrequired=&amp;lt;memory:4096, vCores:1&amp;gt;, available=&amp;lt;memory:2048, vCores:2&amp;gt;&lt;/diagnostic&gt;
&lt;nodeId&gt;127.0.0.3:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;children&gt;
&lt;name&gt;Container-Id-Not-Assigned&lt;/name&gt;
&lt;allocationState&gt;SKIPPED&lt;/allocationState&gt;
&lt;diagnostic&gt;Node does not have sufficient resource for request, insufficient resources=[memory-mb]\nrequired=&amp;lt;memory:4096, vCores:1&amp;gt;, available=&amp;lt;memory:2048, vCores:2&amp;gt;&lt;/diagnostic&gt;
&lt;nodeId&gt;127.0.0.4:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;children&gt;
&lt;name&gt;Container-Id-Not-Assigned&lt;/name&gt;
&lt;allocationState&gt;SKIPPED&lt;/allocationState&gt;
&lt;diagnostic&gt;Node does not have sufficient resource for request, insufficient resources=[memory-mb]\nrequired=&amp;lt;memory:4096, vCores:1&amp;gt;, available=&amp;lt;memory:2048, vCores:2&amp;gt;&lt;/diagnostic&gt;
&lt;nodeId&gt;127.0.0.2:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;children&gt;
&lt;name&gt;Container-Id-Not-Assigned&lt;/name&gt;
&lt;allocationState&gt;RESERVED&lt;/allocationState&gt;
&lt;diagnostic&gt;Node does not have sufficient resource for request, insufficient resources=[memory-mb]\nrequired=&amp;lt;memory:4096, vCores:1&amp;gt;, available=&amp;lt;memory:1024, vCores:3&amp;gt;&lt;/diagnostic&gt;
&lt;nodeId&gt;127.0.0.1:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;/children&gt;
&lt;/allocations&gt;
&lt;allocations&gt;
&lt;timestamp&gt;1562312052031&lt;/timestamp&gt;
&lt;dateTime&gt;Fri Jul 05 15:34:12 CST 2019&lt;/dateTime&gt;
&lt;queueName&gt;b&lt;/queueName&gt;
&lt;appPriority&gt;0&lt;/appPriority&gt;
&lt;allocationState&gt;ALLOCATED&lt;/allocationState&gt;
&lt;children&gt;
&lt;requestPriority&gt;0&lt;/requestPriority&gt;
&lt;allocationRequestId&gt;-1&lt;/allocationRequestId&gt;
&lt;allocationState&gt;ALLOCATED&lt;/allocationState&gt;
&lt;children&gt;
&lt;name&gt;Container-Id-Not-Assigned&lt;/name&gt;
&lt;allocationState&gt;ALLOCATED&lt;/allocationState&gt;
&lt;nodeId&gt;127.0.0.2:1234&lt;/nodeId&gt;
&lt;/children&gt;
&lt;/children&gt;
&lt;/allocations&gt;
&lt;/appActivitiesInfo&gt;
</pre></div></div></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
&#169; 2008-2021
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>