ResourceManagerRest.apt.vm 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469
  1. ~~ Licensed under the Apache License, Version 2.0 (the "License");
  2. ~~ you may not use this file except in compliance with the License.
  3. ~~ You may obtain a copy of the License at
  4. ~~
  5. ~~ http://www.apache.org/licenses/LICENSE-2.0
  6. ~~
  7. ~~ Unless required by applicable law or agreed to in writing, software
  8. ~~ distributed under the License is distributed on an "AS IS" BASIS,
  9. ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. ~~ See the License for the specific language governing permissions and
  11. ~~ limitations under the License. See accompanying LICENSE file.
  12. ---
  13. ResourceManager REST API's.
  14. ---
  15. ---
  16. ${maven.build.timestamp}
  17. ResourceManager REST API's.
  18. \[ {{{./index.html}Go Back}} \]
  19. %{toc|section=1|fromDepth=0|toDepth=2}
  20. * Overview
  21. The ResourceManager REST API'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.
  22. * Cluster Information API
  23. The cluster information resource provides overall information about the cluster.
  24. ** URI
  25. Both of the following URI's give you the cluster information.
  26. ------
  27. * http://<rm http address:port>/ws/v1/cluster
  28. * http://<rm http address:port>/ws/v1/cluster/info
  29. ------
  30. ** HTTP Operations Supported
  31. ------
  32. * GET
  33. ------
  34. ** Query Parameters Supported
  35. ------
  36. None
  37. ------
  38. ** Elements of the <clusterInfo> object
  39. *---------------+--------------+-------------------------------+
  40. || Item || Data Type || Description |
  41. *---------------+--------------+-------------------------------+
  42. | id | long | The cluster id |
  43. *---------------+--------------+-------------------------------+
  44. | startedOn | long | The time the cluster started (in ms since epoch)|
  45. *---------------+--------------+-------------------------------+
  46. | state | string | The ResourceManager state - valid values are: NOTINITED, INITED, STARTED, STOPPED|
  47. *---------------+--------------+-------------------------------+
  48. | resourceManagerVersion | string | Version of the ResourceManager |
  49. *---------------+--------------+-------------------------------+
  50. | resourceManagerBuildVersion | string | ResourceManager build string with build version, user, and checksum |
  51. *---------------+--------------+-------------------------------+
  52. | resourceManagerVersionBuiltOn | string | Timestamp when ResourceManager was built (in ms since epoch)|
  53. *---------------+--------------+-------------------------------+
  54. | hadoopVersion | string | Version of hadoop common |
  55. *---------------+--------------+-------------------------------+
  56. | hadoopBuildVersion | string | Hadoop common build string with build version, user, and checksum |
  57. *---------------+--------------+-------------------------------+
  58. | hadoopVersionBuiltOn | string | Timestamp when hadoop common was built(in ms since epoch)|
  59. *---------------+--------------+-------------------------------+
  60. ** Response Examples
  61. <<JSON response>>
  62. HTTP Request:
  63. ------
  64. GET http://<rm http address:port>/ws/v1/cluster/info
  65. ------
  66. Response Header:
  67. +---+
  68. HTTP/1.1 200 OK
  69. Content-Type: application/json
  70. Transfer-Encoding: chunked
  71. Server: Jetty(6.1.26)
  72. +---+
  73. Response Body:
  74. +---+
  75. {
  76. "clusterInfo":
  77. {
  78. "id":1324053971963,
  79. "startedOn":1324053971963,
  80. "state":"STARTED",
  81. "resourceManagerVersion":"0.23.1-SNAPSHOT",
  82. "resourceManagerBuildVersion":"0.23.1-SNAPSHOT from 1214049 by user1 source checksum 050cd664439d931c8743a6428fd6a693",
  83. "resourceManagerVersionBuiltOn":"Tue Dec 13 22:12:48 CST 2011",
  84. "hadoopVersion":"0.23.1-SNAPSHOT",
  85. "hadoopBuildVersion":"0.23.1-SNAPSHOT from 1214049 by user1 source checksum 11458df3bb77342dca5f917198fad328",
  86. "hadoopVersionBuiltOn":"Tue Dec 13 22:12:26 CST 2011"
  87. }
  88. }
  89. +---+
  90. <<XML response>>
  91. HTTP Request:
  92. -----
  93. Accept: application/xml
  94. GET http://<rm http address:port>/ws/v1/cluster/info
  95. -----
  96. Response Header:
  97. +---+
  98. HTTP/1.1 200 OK
  99. Content-Type: application/xml
  100. Content-Length: 712
  101. Server: Jetty(6.1.26)
  102. +---+
  103. Response Body:
  104. +---+
  105. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  106. <clusterInfo>
  107. <id>1324053971963</id>
  108. <startedOn>1324053971963</startedOn>
  109. <state>STARTED</state>
  110. <resourceManagerVersion>0.23.1-SNAPSHOT</resourceManagerVersion>
  111. <resourceManagerBuildVersion>0.23.1-SNAPSHOT from 1214049 by user1 source checksum 050cd664439d931c8743a6428fd6a693</resourceManagerBuildVersion>
  112. <resourceManagerVersionBuiltOn>Tue Dec 13 22:12:48 CST 2011</resourceManagerVersionBuiltOn>
  113. <hadoopVersion>0.23.1-SNAPSHOT</hadoopVersion>
  114. <hadoopBuildVersion>0.23.1-SNAPSHOT from 1214049 by user1 source checksum 11458df3bb77342dca5f917198fad328</hadoopBuildVersion>
  115. <hadoopVersionBuiltOn>Tue Dec 13 22:12:48 CST 2011</hadoopVersionBuiltOn>
  116. </clusterInfo>
  117. +---+
  118. * Cluster Metrics API
  119. The cluster metrics resource provides some overall metrics about the cluster. More detailed metrics should be retrieved from the jmx interface.
  120. ** URI
  121. ------
  122. * http://<rm http address:port>/ws/v1/cluster/metrics
  123. ------
  124. ** HTTP Operations Supported
  125. ------
  126. * GET
  127. ------
  128. ** Query Parameters Supported
  129. ------
  130. None
  131. ------
  132. ** Elements of the <clusterMetrics> object
  133. *---------------+--------------+-------------------------------+
  134. || Item || Data Type || Description |
  135. *---------------+--------------+-------------------------------+
  136. | appsSubmitted | int | The number of applications submitted |
  137. *---------------+--------------+-------------------------------+
  138. | reservedMB | long | The amount of memory reserved in MB |
  139. *---------------+--------------+-------------------------------+
  140. | availableMB | long | The amount of memory available in MB |
  141. *---------------+--------------+-------------------------------+
  142. | allocatedMB | long | The amount of memory allocated in MB |
  143. *---------------+--------------+-------------------------------+
  144. | totalMB | long | The amount of total memory in MB |
  145. *---------------+--------------+-------------------------------+
  146. | containersAllocated | int | The number of containers allocated |
  147. *---------------+--------------+-------------------------------+
  148. | totalNodes | int | The total number of nodes |
  149. *---------------+--------------+-------------------------------+
  150. | activeNodes | int | The number of active nodes |
  151. *---------------+--------------+-------------------------------+
  152. | lostNodes | int | The number of lost nodes |
  153. *---------------+--------------+-------------------------------+
  154. | unhealthyNodes | int | The number of unhealthy nodes |
  155. *---------------+--------------+-------------------------------+
  156. | decommissionedNodes | int | The number of nodes decommissioned |
  157. *---------------+--------------+-------------------------------+
  158. | rebootedNodes | int | The number of nodes rebooted |
  159. *---------------+--------------+-------------------------------+
  160. ** Response Examples
  161. <<JSON response>>
  162. HTTP Request:
  163. ------
  164. GET http://<rm http address:port>/ws/v1/cluster/metrics
  165. ------
  166. Response Header:
  167. +---+
  168. HTTP/1.1 200 OK
  169. Content-Type: application/json
  170. Transfer-Encoding: chunked
  171. Server: Jetty(6.1.26)
  172. +---+
  173. Response Body:
  174. +---+
  175. {
  176. "clusterMetrics":
  177. {
  178. "appsSubmitted":4,
  179. "reservedMB":0,
  180. "availableMB":8192,
  181. "allocatedMB":0,
  182. "totalMB":8192,
  183. "containersAllocated":0,
  184. "totalNodes":1,
  185. "activeNodes":1,
  186. "lostNodes":0,
  187. "unhealthyNodes":0,
  188. "decommissionedNodes":0,
  189. "rebootedNodes":0
  190. }
  191. }
  192. +---+
  193. <<XML response>>
  194. HTTP Request:
  195. ------
  196. GET http://<rm http address:port>/ws/v1/cluster/metrics
  197. Accept: application/xml
  198. ------
  199. Response Header:
  200. +---+
  201. HTTP/1.1 200 OK
  202. Content-Type: application/xml
  203. Content-Length: 432
  204. Server: Jetty(6.1.26)
  205. +---+
  206. Response Body:
  207. +---+
  208. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  209. <clusterMetrics>
  210. <appsSubmitted>4</appsSubmitted>
  211. <reservedMB>0</reservedMB>
  212. <availableMB>8192</availableMB>
  213. <allocatedMB>0</allocatedMB>
  214. <containersAllocated>0</containersAllocated>
  215. <totalMB>8192</totalMB>
  216. <totalNodes>1</totalNodes>
  217. <activeNodes>1</activeNodes>
  218. <lostNodes>0</lostNodes>
  219. <unhealthyNodes>0</unhealthyNodes>
  220. <decommissionedNodes>0</decommissionedNodes>
  221. <rebootedNodes>0</rebootedNodes>
  222. </clusterMetrics>
  223. +---+
  224. * Cluster Scheduler API
  225. A scheduler resource contains information about the current scheduler configured in a cluster. It currently supports both the Fifo and Capacity Scheduler. You will get different information depending on which scheduler is configured so be sure to look at the type information.
  226. ** URI
  227. ------
  228. * http://<rm http address:port>/ws/v1/cluster/scheduler
  229. ------
  230. ** HTTP Operations Supported
  231. ------
  232. * GET
  233. ------
  234. ** Query Parameters Supported
  235. ------
  236. None
  237. ------
  238. ** Capacity Scheduler API
  239. The capacity scheduler supports hierarchical queues. This one request will print information about all the queues and any subqueues they have.
  240. Queues that can actually have jobs submitted to them are referred to as leaf queues. These queues have additional data associated with them.
  241. ** Elements of the <schedulerInfo> object
  242. *---------------+--------------+-------------------------------+
  243. || Item || Data Type || Description |
  244. *---------------+--------------+-------------------------------+
  245. | type | string | Scheduler type - capacityScheduler|
  246. *---------------+--------------+-------------------------------+
  247. | capacity | float | Queue capacity in percentage relative to its parent queue |
  248. *---------------+--------------+-------------------------------+
  249. | usedCapacity | float | Used queue capacity in percentage relative its to parent queue |
  250. *---------------+--------------+-------------------------------+
  251. | maxCapacity | float | Maximum queue capacity in percentage relative to its parent queue |
  252. *---------------+--------------+-------------------------------+
  253. | queueName | string | Name of the queue |
  254. *---------------+--------------+-------------------------------+
  255. | queues | array of queues(JSON)/zero or more queue objects(XML) | A collection of queue resources|
  256. *---------------+--------------+-------------------------------+
  257. ** Elements of the queues/subQueues object for a Parent queue
  258. *---------------+--------------+-------------------------------+
  259. || Item || Data Type || Description |
  260. *---------------+--------------+-------------------------------+
  261. | capacity | float | Queue capacity in percentage relative to its parent queue |
  262. *---------------+--------------+-------------------------------+
  263. | usedCapacity | float | Used queue capacity in percentage relative its to parent queue |
  264. *---------------+--------------+-------------------------------+
  265. | maxCapacity | float | Maximum queue capacity in percentage relative to its parent queue |
  266. *---------------+--------------+-------------------------------+
  267. | absoluteCapacity | float | Absolute capacity percentage this queue can use of entire cluster |
  268. *---------------+--------------+-------------------------------+
  269. | absoluteMaxCapacity | float | Absolute maximum capacity percentage this queue can use of the entire cluster |
  270. *---------------+--------------+-------------------------------+
  271. | utilization | float | Queue utilization percentage relative to the entire cluster |
  272. *---------------+--------------+-------------------------------+
  273. | numApplications | int | The number of applications currently in the queue |
  274. *---------------+--------------+-------------------------------+
  275. | usedResources | string | A string describing the current resources used by the queue |
  276. *---------------+--------------+-------------------------------+
  277. | queueName | string | The name of the queue |
  278. *---------------+--------------+-------------------------------+
  279. | state | string of QueueState | The state of the queue |
  280. *---------------+--------------+-------------------------------+
  281. | subQueues | array of queues(JSON)/zero or more queue objects(XML) | A collection of sub-queue information|
  282. *---------------+--------------+-------------------------------+
  283. ** Elements of the queues/subQueues object for a Leaf queue - contains all elements in parent plus the following:
  284. *---------------+--------------+-------------------------------+
  285. || Item || Data Type || Description |
  286. *---------------+--------------+-------------------------------+
  287. | type | String | type of the queue - capacitySchedulerLeafQueueInfo |
  288. *---------------+--------------+-------------------------------+
  289. | numActiveApplications | int | The number of active applications in this queue |
  290. *---------------+--------------+-------------------------------+
  291. | numPendingApplications | int | The number of pending applications in this queue |
  292. *---------------+--------------+-------------------------------+
  293. | numContainers | int | The number of containers being used |
  294. *---------------+--------------+-------------------------------+
  295. | maxApplications | int | The maximum number of applications this queue can have |
  296. *---------------+--------------+-------------------------------+
  297. | maxApplicationsPerUser | int | The maximum number of applications per user this queue can have |
  298. *---------------+--------------+-------------------------------+
  299. | maxActiveApplications | int | The maximum number of active applications this queue can have |
  300. *---------------+--------------+-------------------------------+
  301. | maxActiveApplicationsPerUser | int | The maximum number of active applications per user this queue can have|
  302. *---------------+--------------+-------------------------------+
  303. | userLimit | int | The minimum user limit percent set in the configuration |
  304. *---------------+--------------+-------------------------------+
  305. | userLimitFactor | float | The user limit factor set in the configuration |
  306. *---------------+--------------+-------------------------------+
  307. *** Response Examples
  308. <<JSON response>>
  309. HTTP Request:
  310. ------
  311. GET http://<rm http address:port>/ws/v1/cluster/scheduler
  312. ------
  313. Response Header:
  314. +---+
  315. HTTP/1.1 200 OK
  316. Content-Type: application/json
  317. Transfer-Encoding: chunked
  318. Server: Jetty(6.1.26)
  319. +---+
  320. Response Body:
  321. +---+
  322. {
  323. "scheduler" : {
  324. "schedulerInfo" : {
  325. "queueName" : "root",
  326. "maxCapacity" : 100,
  327. "type" : "capacityScheduler",
  328. "queues" : [
  329. {
  330. "numPendingApplications" : 0,
  331. "queueName" : "default",
  332. "userLimitFactor" : 1,
  333. "maxApplications" : 7000,
  334. "usedCapacity" : 0,
  335. "numContainers" : 0,
  336. "state" : "RUNNING",
  337. "maxCapacity" : 90,
  338. "numApplications" : 0,
  339. "usedResources" : "memory: 0",
  340. "absoluteMaxCapacity" : 90,
  341. "maxActiveApplications" : 1,
  342. "numActiveApplications" : 0,
  343. "utilization" : 0,
  344. "userLimit" : 100,
  345. "absoluteCapacity" : 70,
  346. "maxActiveApplicationsPerUser" : 1,
  347. "capacity" : 70,
  348. "type" : "capacitySchedulerLeafQueueInfo",
  349. "maxApplicationsPerUser" : 7000
  350. },
  351. {
  352. "queueName" : "test",
  353. "utilization" : 0,
  354. "absoluteCapacity" : 20,
  355. "usedCapacity" : 0,
  356. "capacity" : 20,
  357. "subQueues" : [
  358. {
  359. "numPendingApplications" : 0,
  360. "queueName" : "a1",
  361. "userLimitFactor" : 1,
  362. "maxApplications" : 1200,
  363. "usedCapacity" : 0,
  364. "numContainers" : 0,
  365. "state" : "RUNNING",
  366. "maxCapacity" : 80,
  367. "numApplications" : 0,
  368. "usedResources" : "memory: 0",
  369. "absoluteMaxCapacity" : 16.000002,
  370. "maxActiveApplications" : 1,
  371. "numActiveApplications" : 0,
  372. "utilization" : 0,
  373. "userLimit" : 100,
  374. "absoluteCapacity" : 12,
  375. "maxActiveApplicationsPerUser" : 1,
  376. "capacity" : 60.000004,
  377. "type" : "capacitySchedulerLeafQueueInfo",
  378. "maxApplicationsPerUser" : 1200
  379. },
  380. {
  381. "numPendingApplications" : 0,
  382. "queueName" : "a2",
  383. "userLimitFactor" : 1,
  384. "maxApplications" : 800,
  385. "usedCapacity" : 0,
  386. "numContainers" : 0,
  387. "state" : "RUNNING",
  388. "maxCapacity" : 100,
  389. "numApplications" : 0,
  390. "usedResources" : "memory: 0",
  391. "absoluteMaxCapacity" : 100,
  392. "maxActiveApplications" : 1,
  393. "numActiveApplications" : 0,
  394. "utilization" : 0,
  395. "userLimit" : 100,
  396. "absoluteCapacity" : 8.000001,
  397. "maxActiveApplicationsPerUser" : 1,
  398. "capacity" : 40,
  399. "type" : "capacitySchedulerLeafQueueInfo",
  400. "maxApplicationsPerUser" : 800
  401. }
  402. ],
  403. "state" : "RUNNING",
  404. "maxCapacity" : 80,
  405. "numApplications" : 0,
  406. "usedResources" : "memory: 0",
  407. "absoluteMaxCapacity" : 80
  408. },
  409. {
  410. "queueName" : "test2",
  411. "utilization" : 0,
  412. "absoluteCapacity" : 10,
  413. "usedCapacity" : 0,
  414. "capacity" : 10,
  415. "subQueues" : [
  416. {
  417. "numPendingApplications" : 0,
  418. "queueName" : "a5",
  419. "userLimitFactor" : 1,
  420. "maxApplications" : 500,
  421. "usedCapacity" : 0,
  422. "numContainers" : 0,
  423. "state" : "RUNNING",
  424. "maxCapacity" : 100,
  425. "numApplications" : 0,
  426. "usedResources" : "memory: 0",
  427. "absoluteMaxCapacity" : 100,
  428. "maxActiveApplications" : 1,
  429. "numActiveApplications" : 0,
  430. "utilization" : 0,
  431. "userLimit" : 100,
  432. "absoluteCapacity" : 5,
  433. "maxActiveApplicationsPerUser" : 1,
  434. "capacity" : 50,
  435. "type" : "capacitySchedulerLeafQueueInfo",
  436. "maxApplicationsPerUser" : 500
  437. },
  438. {
  439. "numPendingApplications" : 0,
  440. "queueName" : "a3",
  441. "userLimitFactor" : 1,
  442. "maxApplications" : 400,
  443. "usedCapacity" : 0,
  444. "numContainers" : 0,
  445. "state" : "RUNNING",
  446. "maxCapacity" : 100,
  447. "numApplications" : 0,
  448. "usedResources" : "memory: 0",
  449. "absoluteMaxCapacity" : 100,
  450. "maxActiveApplications" : 1,
  451. "numActiveApplications" : 0,
  452. "utilization" : 0,
  453. "userLimit" : 100,
  454. "absoluteCapacity" : 4.0000005,
  455. "maxActiveApplicationsPerUser" : 1,
  456. "capacity" : 40,
  457. "type" : "capacitySchedulerLeafQueueInfo",
  458. "maxApplicationsPerUser" : 400
  459. },
  460. {
  461. "numPendingApplications" : 0,
  462. "queueName" : "a4",
  463. "userLimitFactor" : 1,
  464. "maxApplications" : 100,
  465. "usedCapacity" : 0,
  466. "numContainers" : 0,
  467. "state" : "RUNNING",
  468. "maxCapacity" : 100,
  469. "numApplications" : 0,
  470. "usedResources" : "memory: 0",
  471. "absoluteMaxCapacity" : 100,
  472. "maxActiveApplications" : 1,
  473. "numActiveApplications" : 0,
  474. "utilization" : 0,
  475. "userLimit" : 100,
  476. "absoluteCapacity" : 1.0000001,
  477. "maxActiveApplicationsPerUser" : 1,
  478. "capacity" : 10,
  479. "type" : "capacitySchedulerLeafQueueInfo",
  480. "maxApplicationsPerUser" : 100
  481. }
  482. ],
  483. "state" : "RUNNING",
  484. "maxCapacity" : 15.000001,
  485. "numApplications" : 0,
  486. "usedResources" : "memory: 0",
  487. "absoluteMaxCapacity" : 15.000001
  488. }
  489. ],
  490. "usedCapacity" : 0,
  491. "capacity" : 100
  492. }
  493. }
  494. }
  495. +---+
  496. <<JSON response>>
  497. HTTP Request:
  498. -----
  499. Accept: application/xml
  500. GET http://<rm http address:port>/ws/v1/cluster/scheduler
  501. -----
  502. Response Header:
  503. +---+
  504. HTTP/1.1 200 OK
  505. Content-Type: application/xml
  506. Content-Length: 5778
  507. Server: Jetty(6.1.26)
  508. +---+
  509. Response Body:
  510. +---+
  511. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  512. <scheduler>
  513. <schedulerInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="capacityScheduler">
  514. <capacity>100.0</capacity>
  515. <usedCapacity>0.0</usedCapacity>
  516. <maxCapacity>100.0</maxCapacity>
  517. <queueName>root</queueName>
  518. <queues xsi:type="capacitySchedulerLeafQueueInfo">
  519. <capacity>70.0</capacity>
  520. <usedCapacity>0.0</usedCapacity>
  521. <maxCapacity>90.0</maxCapacity>
  522. <absoluteCapacity>70.0</absoluteCapacity>
  523. <absoluteMaxCapacity>90.0</absoluteMaxCapacity>
  524. <utilization>0.0</utilization>
  525. <numApplications>0</numApplications>
  526. <usedResources>memory: 0</usedResources>
  527. <queueName>default</queueName>
  528. <state>RUNNING</state>
  529. <numActiveApplications>0</numActiveApplications>
  530. <numPendingApplications>0</numPendingApplications>
  531. <numContainers>0</numContainers>
  532. <maxApplications>7000</maxApplications>
  533. <maxApplicationsPerUser>7000</maxApplicationsPerUser>
  534. <maxActiveApplications>1</maxActiveApplications>
  535. <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser>
  536. <userLimit>100</userLimit>
  537. <userLimitFactor>1.0</userLimitFactor>
  538. </queues>
  539. <queues>
  540. <capacity>20.0</capacity>
  541. <usedCapacity>0.0</usedCapacity>
  542. <maxCapacity>80.0</maxCapacity>
  543. <absoluteCapacity>20.0</absoluteCapacity>
  544. <absoluteMaxCapacity>80.0</absoluteMaxCapacity>
  545. <utilization>0.0</utilization>
  546. <numApplications>0</numApplications>
  547. <usedResources>memory: 0</usedResources>
  548. <queueName>test</queueName>
  549. <state>RUNNING</state>
  550. <subQueues xsi:type="capacitySchedulerLeafQueueInfo">
  551. <capacity>60.000004</capacity>
  552. <usedCapacity>0.0</usedCapacity>
  553. <maxCapacity>80.0</maxCapacity>
  554. <absoluteCapacity>12.0</absoluteCapacity>
  555. <absoluteMaxCapacity>16.000002</absoluteMaxCapacity>
  556. <utilization>0.0</utilization>
  557. <numApplications>0</numApplications>
  558. <usedResources>memory: 0</usedResources>
  559. <queueName>a1</queueName>
  560. <state>RUNNING</state>
  561. <numActiveApplications>0</numActiveApplications>
  562. <numPendingApplications>0</numPendingApplications>
  563. <numContainers>0</numContainers>
  564. <maxApplications>1200</maxApplications>
  565. <maxApplicationsPerUser>1200</maxApplicationsPerUser>
  566. <maxActiveApplications>1</maxActiveApplications>
  567. <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser>
  568. <userLimit>100</userLimit>
  569. <userLimitFactor>1.0</userLimitFactor>
  570. </subQueues>
  571. <subQueues xsi:type="capacitySchedulerLeafQueueInfo">
  572. <capacity>40.0</capacity>
  573. <usedCapacity>0.0</usedCapacity>
  574. <maxCapacity>100.0</maxCapacity>
  575. <absoluteCapacity>8.000001</absoluteCapacity>
  576. <absoluteMaxCapacity>100.0</absoluteMaxCapacity>
  577. <utilization>0.0</utilization>
  578. <numApplications>0</numApplications>
  579. <usedResources>memory: 0</usedResources>
  580. <queueName>a2</queueName>
  581. <state>RUNNING</state>
  582. <numActiveApplications>0</numActiveApplications>
  583. <numPendingApplications>0</numPendingApplications>
  584. <numContainers>0</numContainers>
  585. <maxApplications>800</maxApplications>
  586. <maxApplicationsPerUser>800</maxApplicationsPerUser>
  587. <maxActiveApplications>1</maxActiveApplications>
  588. <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser>
  589. <userLimit>100</userLimit>
  590. <userLimitFactor>1.0</userLimitFactor>
  591. </subQueues>
  592. </queues>
  593. <queues>
  594. <capacity>10.0</capacity>
  595. <usedCapacity>0.0</usedCapacity>
  596. <maxCapacity>15.000001</maxCapacity>
  597. <absoluteCapacity>10.0</absoluteCapacity>
  598. <absoluteMaxCapacity>15.000001</absoluteMaxCapacity>
  599. <utilization>0.0</utilization>
  600. <numApplications>0</numApplications>
  601. <usedResources>memory: 0</usedResources>
  602. <queueName>test2</queueName>
  603. <state>RUNNING</state>
  604. <subQueues xsi:type="capacitySchedulerLeafQueueInfo">
  605. <capacity>50.0</capacity>
  606. <usedCapacity>0.0</usedCapacity>
  607. <maxCapacity>100.0</maxCapacity>
  608. <absoluteCapacity>5.0</absoluteCapacity>
  609. <absoluteMaxCapacity>100.0</absoluteMaxCapacity>
  610. <utilization>0.0</utilization>
  611. <numApplications>0</numApplications>
  612. <usedResources>memory: 0</usedResources>
  613. <queueName>A4</queueName>
  614. <state>RUNNING</state>
  615. <numActiveApplications>0</numActiveApplications>
  616. <numPendingApplications>0</numPendingApplications>
  617. <numContainers>0</numContainers>
  618. <maxApplications>500</maxApplications>
  619. <maxApplicationsPerUser>500</maxApplicationsPerUser>
  620. <maxActiveApplications>1</maxActiveApplications>
  621. <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser>
  622. <userLimit>100</userLimit>
  623. <userLimitFactor>1.0</userLimitFactor>
  624. </subQueues>
  625. <subQueues xsi:type="capacitySchedulerLeafQueueInfo">
  626. <capacity>40.0</capacity>
  627. <usedCapacity>0.0</usedCapacity>
  628. <maxCapacity>100.0</maxCapacity>
  629. <absoluteCapacity>4.0000005</absoluteCapacity>
  630. <absoluteMaxCapacity>100.0</absoluteMaxCapacity>
  631. <utilization>0.0</utilization>
  632. <numApplications>0</numApplications>
  633. <usedResources>memory: 0</usedResources>
  634. <queueName>a3</queueName>
  635. <state>RUNNING</state>
  636. <numActiveApplications>0</numActiveApplications>
  637. <numPendingApplications>0</numPendingApplications>
  638. <numContainers>0</numContainers>
  639. <maxApplications>400</maxApplications>
  640. <maxApplicationsPerUser>400</maxApplicationsPerUser>
  641. <maxActiveApplications>1</maxActiveApplications>
  642. <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser>
  643. <userLimit>100</userLimit>
  644. <userLimitFactor>1.0</userLimitFactor>
  645. </subQueues>
  646. <subQueues xsi:type="capacitySchedulerLeafQueueInfo">
  647. <capacity>10.0</capacity>
  648. <usedCapacity>0.0</usedCapacity>
  649. <maxCapacity>100.0</maxCapacity>
  650. <absoluteCapacity>1.0000001</absoluteCapacity>
  651. <absoluteMaxCapacity>100.0</absoluteMaxCapacity>
  652. <utilization>0.0</utilization>
  653. <numApplications>0</numApplications>
  654. <usedResources>memory: 0</usedResources>
  655. <queueName>a4</queueName>
  656. <state>RUNNING</state>
  657. <numActiveApplications>0</numActiveApplications>
  658. <numPendingApplications>0</numPendingApplications>
  659. <numContainers>0</numContainers>
  660. <maxApplications>100</maxApplications>
  661. <maxApplicationsPerUser>100</maxApplicationsPerUser>
  662. <maxActiveApplications>1</maxActiveApplications>
  663. <maxActiveApplicationsPerUser>1</maxActiveApplicationsPerUser>
  664. <userLimit>100</userLimit>
  665. <userLimitFactor>1.0</userLimitFactor>
  666. </subQueues>
  667. </queues>
  668. </schedulerInfo>
  669. </scheduler>
  670. +---+
  671. ** Fifo Scheduler API
  672. ** Elements of the <schedulerInfo> object
  673. *---------------+--------------+-------------------------------+
  674. || Item || Data Type || Description |
  675. *---------------+--------------+-------------------------------+
  676. | type | string | Scheduler type - fifoScheduler |
  677. *---------------+--------------+-------------------------------+
  678. | capacity | float | Queue capacity in percentage |
  679. *---------------+--------------+-------------------------------+
  680. | usedCapacity | float | Used queue capacity in percentage |
  681. *---------------+--------------+-------------------------------+
  682. | qstate | string | State of the queue - valid values are: STOPPED, RUNNING|
  683. *---------------+--------------+-------------------------------+
  684. | minQueueMemoryCapacity | int | Minimum queue memory capacity |
  685. *---------------+--------------+-------------------------------+
  686. | maxQueueMemoryCapacity | int | Maximum queue memory capacity |
  687. *---------------+--------------+-------------------------------+
  688. | numNodes | int | The total number of nodes |
  689. *---------------+--------------+-------------------------------+
  690. | usedNodeCapacity | int | The used node capacity |
  691. *---------------+--------------+-------------------------------+
  692. | availNodeCapacity | int | The available node capacity |
  693. *---------------+--------------+-------------------------------+
  694. | totalNodeCapacity | int | The total node capacity |
  695. *---------------+--------------+-------------------------------+
  696. | numContainers | int | The number of containers |
  697. *---------------+--------------+-------------------------------+
  698. *** Response Examples
  699. <<JSON response>>
  700. HTTP Request:
  701. ------
  702. GET http://<rm http address:port>/ws/v1/cluster/scheduler
  703. ------
  704. Response Header:
  705. +---+
  706. HTTP/1.1 200 OK
  707. Content-Type: application/json
  708. Transfer-Encoding: chunked
  709. Server: Jetty(6.1.26)
  710. +---+
  711. Response Body:
  712. +---+
  713. {
  714. "scheduler":
  715. {
  716. "schedulerInfo":
  717. {
  718. "type":"fifoScheduler",
  719. "capacity":1,
  720. "usedCapacity":"NaN",
  721. "qstate":"RUNNING",
  722. "minQueueMemoryCapacity":1024,
  723. "maxQueueMemoryCapacity":10240,
  724. "numNodes":0,
  725. "usedNodeCapacity":0,
  726. "availNodeCapacity":0,
  727. "totalNodeCapacity":0,
  728. "numContainers":0
  729. }
  730. }
  731. }
  732. +---+
  733. <<JSON response>>
  734. HTTP Request:
  735. ------
  736. GET http://<rm http address:port>/ws/v1/cluster/scheduler
  737. Accept: application/xml
  738. ------
  739. Response Header:
  740. +---+
  741. HTTP/1.1 200 OK
  742. Content-Type: application/xml
  743. Content-Length: 432
  744. Server: Jetty(6.1.26)
  745. +---+
  746. Response Body:
  747. +---+
  748. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  749. <scheduler>
  750. <schedulerInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="fifoScheduler">
  751. <capacity>1.0</capacity>
  752. <usedCapacity>NaN</usedCapacity>
  753. <qstate>RUNNING</qstate>
  754. <minQueueMemoryCapacity>1024</minQueueMemoryCapacity>
  755. <maxQueueMemoryCapacity>10240</maxQueueMemoryCapacity>
  756. <numNodes>0</numNodes>
  757. <usedNodeCapacity>0</usedNodeCapacity>
  758. <availNodeCapacity>0</availNodeCapacity>
  759. <totalNodeCapacity>0</totalNodeCapacity>
  760. <numContainers>0</numContainers>
  761. </schedulerInfo>
  762. </scheduler>
  763. +---+
  764. * Cluster Applications API
  765. 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.
  766. ** URI
  767. ------
  768. * http://<rm http address:port>/ws/v1/cluster/apps
  769. ------
  770. ** HTTP Operations Supported
  771. ------
  772. * GET
  773. ------
  774. ** Query Parameters Supported
  775. Multiple paramters can be specified. 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&startedTimeEnd=1324303200. If the Begin parameter is not specfied, it defaults to 0, and if the End parameter is not specified, it defaults to infinity.
  776. ------
  777. * state - state of the application
  778. * user - user name
  779. * queue - queue name
  780. * limit - total number of app objects to be returned
  781. * startedTimeBegin - applications with start time beginning with this time, specified in ms since epoch
  782. * startedTimeEnd - applications with start time ending with this time, specified in ms since epoch
  783. * finishedTimeBegin - applications with finish time beginning with this time, specified in ms since epoch
  784. * finishedTimeEnd - applications with finish time ending with this time, specified in ms since epoch
  785. ------
  786. ** Elements of the <apps> (Applications) object
  787. When you make a request for the list of applications, the information will be returned as a collection of app objects.
  788. See also {{Application API}} for syntax of the app object.
  789. *---------------+--------------+-------------------------------+
  790. || Item || Data Type || Description |
  791. *---------------+--------------+-------------------------------+
  792. | app | array of app objects(JSON)/zero or more application objects(XML) | The collection of application objects |
  793. *---------------+--------------+--------------------------------+
  794. ** Response Examples
  795. <<JSON response>>
  796. HTTP Request:
  797. ------
  798. GET http://<rm http address:port>/ws/v1/cluster/apps
  799. ------
  800. Response Header:
  801. +---+
  802. HTTP/1.1 200 OK
  803. Content-Type: application/json
  804. Transfer-Encoding: chunked
  805. Server: Jetty(6.1.26)
  806. +---+
  807. Response Body:
  808. +---+
  809. {
  810. "apps":
  811. {
  812. "app":
  813. [
  814. {
  815. "finishedTime" : 1326815598530,
  816. "amContainerLogs" : "http://host.domain.com:9999/node/containerlogs/container_1326815542473_0001_01_000001",
  817. "trackingUI" : "History",
  818. "state" : "FINISHED",
  819. "user" : "user1",
  820. "id" : "application_1326815542473_0001",
  821. "clusterId" : 1326815542473,
  822. "finalStatus" : "SUCCEEDED",
  823. "amHostHttpAddress" : "host.domain.com:9999",
  824. "progress" : 100,
  825. "name" : "word count",
  826. "startedTime" : 1326815573334,
  827. "elapsedTime" : 25196,
  828. "diagnostics" : "",
  829. "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326815542473_0001/jobhistory/job/job_1326815542473_1_1",
  830. "queue" : "default"
  831. },
  832. {
  833. "finishedTime" : 1326815789546,
  834. "amContainerLogs" : "http://host.domain.com:9999/node/containerlogs/container_1326815542473_0002_01_000001",
  835. "trackingUI" : "History",
  836. "state" : "FINISHED",
  837. "user" : "user1",
  838. "id" : "application_1326815542473_0002",
  839. "clusterId" : 1326815542473,
  840. "finalStatus" : "SUCCEEDED",
  841. "amHostHttpAddress" : "host.domain.com:9999",
  842. "progress" : 100,
  843. "name" : "Sleep job",
  844. "startedTime" : 1326815641380,
  845. "elapsedTime" : 148166,
  846. "diagnostics" : "",
  847. "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326815542473_0002/jobhistory/job/job_1326815542473_2_2",
  848. "queue" : "default"
  849. }
  850. ]
  851. }
  852. }
  853. +---+
  854. <<JSON response>>
  855. HTTP Request:
  856. ------
  857. GET http://<rm http address:port>/ws/v1/cluster/apps
  858. Accept: application/xml
  859. ------
  860. Response Header:
  861. +---+
  862. HTTP/1.1 200 OK
  863. Content-Type: application/xml
  864. Content-Length: 2459
  865. Server: Jetty(6.1.26)
  866. +---+
  867. Response Body:
  868. +---+
  869. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  870. <apps>
  871. <app>
  872. <id>application_1326815542473_0001</id>
  873. <user>user1</user>
  874. <name>word count</name>
  875. <queue>default</queue>
  876. <state>FINISHED</state>
  877. <finalStatus>SUCCEEDED</finalStatus>
  878. <progress>100.0</progress>
  879. <trackingUI>History</trackingUI>
  880. <trackingUrl>http://host.domain.com:8088/proxy/application_1326815542473_0001/jobhistory/job
  881. /job_1326815542473_1_1</trackingUrl>
  882. <diagnostics/>
  883. <clusterId>1326815542473</clusterId>
  884. <startedTime>1326815573334</startedTime>
  885. <finishedTime>1326815598530</finishedTime>
  886. <elapsedTime>25196</elapsedTime>
  887. <amContainerLogs>http://host.domain.com:9999/node/containerlogs/container_1326815542473_0001
  888. _01_000001</amContainerLogs>
  889. <amHostHttpAddress>host.domain.com:9999</amHostHttpAddress>
  890. </app>
  891. <app>
  892. <id>application_1326815542473_0002</id>
  893. <user>user1</user>
  894. <name>Sleep job</name>
  895. <queue>default</queue>
  896. <state>FINISHED</state>
  897. <finalStatus>SUCCEEDED</finalStatus>
  898. <progress>100.0</progress>
  899. <trackingUI>History</trackingUI>
  900. <trackingUrl>http://host.domain.com:8088/proxy/application_1326815542473_0002/jobhistory/job/job_1326815542473_2_2</trackingUrl>
  901. <diagnostics/>
  902. <clusterId>1326815542473</clusterId>
  903. <startedTime>1326815641380</startedTime>
  904. <finishedTime>1326815789546</finishedTime>
  905. <elapsedTime>148166</elapsedTime>
  906. <amContainerLogs>http://host.domain.com:9999/node/containerlogs/container_1326815542473_0002_01_000001</amContainerLogs>
  907. <amHostHttpAddress>host.domain.com:9999</amHostHttpAddress>
  908. </app>
  909. </apps>
  910. +---+
  911. * Cluster {Application API}
  912. An application resource contains information about a particular application that was submitted to a cluster.
  913. ** URI
  914. Use the following URI to obtain an app object, from a application identified by the {appid} value.
  915. ------
  916. * http://<rm http address:port>/ws/v1/cluster/apps/{appid}
  917. ------
  918. ** HTTP Operations Supported
  919. ------
  920. * GET
  921. ------
  922. ** Query Parameters Supported
  923. ------
  924. None
  925. ------
  926. ** Elements of the <app> (Application) object
  927. Note that depending on security settings a user might not be able to see all the fields.
  928. *---------------+--------------+-------------------------------+
  929. || Item || Data Type || Description |
  930. *---------------+--------------+-------------------------------+
  931. | id | string | The application id |
  932. *---------------+--------------+--------------------------------+
  933. | user | string | The user who started the application |
  934. *---------------+--------------+--------------------------------+
  935. | name | string | The application name |
  936. *---------------+--------------+--------------------------------+
  937. | queue | string | The queue the application was submitted to|
  938. *---------------+--------------+--------------------------------+
  939. | state | string | The application state according to the ResourceManager - valid values are: NEW, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED|
  940. *---------------+--------------+--------------------------------+
  941. | finalStatus | string | The final status of the application if finished - reported by the application itself - valid values are: UNDEFINED, SUCCEEDED, FAILED, KILLED|
  942. *---------------+--------------+--------------------------------+
  943. | progress | float | The progress of the application as a percent |
  944. *---------------+--------------+--------------------------------+
  945. | trackingUI | string | Where the tracking url is currently pointing - History (for history server) or ApplicationMaster |
  946. *---------------+--------------+--------------------------------+
  947. | trackingUrl | string | The web URL that can be used to track the application |
  948. *---------------+--------------+--------------------------------+
  949. | diagnostics | string | Detailed diagnostics information |
  950. *---------------+--------------+--------------------------------+
  951. | clusterId | long | The cluster id |
  952. *---------------+--------------+--------------------------------+
  953. | startedTime | long | The time in which application started (in ms since epoch)|
  954. *---------------+--------------+--------------------------------+
  955. | finishedTime | long | The time in which the application finished (in ms since epoch) |
  956. *---------------+--------------+--------------------------------+
  957. | elapsedTime | long | The elapsed time since the application started (in ms)|
  958. *---------------+--------------+--------------------------------+
  959. | amContainerLogs | string | The URL of the application master container logs|
  960. *---------------+--------------+--------------------------------+
  961. | amHostHttpAddress | string | The nodes http address of the application master |
  962. *---------------+--------------+--------------------------------+
  963. ** Response Examples
  964. <<JSON response>>
  965. HTTP Request:
  966. ------
  967. GET http://<rm http address:port>/ws/v1/cluster/apps/application_1326821518301_0005
  968. ------
  969. Response Header:
  970. +---+
  971. HTTP/1.1 200 OK
  972. Content-Type: application/json
  973. Transfer-Encoding: chunked
  974. Server: Jetty(6.1.26)
  975. +---+
  976. Response Body:
  977. +---+
  978. {
  979. "app" : {
  980. "finishedTime" : 1326824991300,
  981. "amContainerLogs" : "http://host.domain.com:9999/node/containerlogs/container_1326821518301_0005_01_000001",
  982. "trackingUI" : "History",
  983. "state" : "FINISHED",
  984. "user" : "user1",
  985. "id" : "application_1326821518301_0005",
  986. "clusterId" : 1326821518301,
  987. "finalStatus" : "SUCCEEDED",
  988. "amHostHttpAddress" : "host.domain.com:9999",
  989. "progress" : 100,
  990. "name" : "Sleep job",
  991. "startedTime" : 1326824544552,
  992. "elapsedTime" : 446748,
  993. "diagnostics" : "",
  994. "trackingUrl" : "http://host.domain.com:8088/proxy/application_1326821518301_0005/jobhistory/job/job_1326821518301_5_5",
  995. "queue" : "a1"
  996. }
  997. }
  998. +---+
  999. <<JSON response>>
  1000. HTTP Request:
  1001. ------
  1002. GET http://<rm http address:port>/ws/v1/cluster/apps/application_1326821518301_0005
  1003. Accept: application/xml
  1004. ------
  1005. Response Header:
  1006. +---+
  1007. HTTP/1.1 200 OK
  1008. Content-Type: application/xml
  1009. Content-Length: 847
  1010. Server: Jetty(6.1.26)
  1011. +---+
  1012. Response Body:
  1013. +---+
  1014. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  1015. <app>
  1016. <id>application_1326821518301_0005</id>
  1017. <user>user1</user>
  1018. <name>Sleep job</name>
  1019. <queue>a1</queue>
  1020. <state>FINISHED</state>
  1021. <finalStatus>SUCCEEDED</finalStatus>
  1022. <progress>100.0</progress>
  1023. <trackingUI>History</trackingUI>
  1024. <trackingUrl>http://host.domain.com:8088/proxy/application_1326821518301_0005/jobhistory/job/job_1326821518301_5_5</trackingUrl>
  1025. <diagnostics/>
  1026. <clusterId>1326821518301</clusterId>
  1027. <startedTime>1326824544552</startedTime>
  1028. <finishedTime>1326824991300</finishedTime>
  1029. <elapsedTime>446748</elapsedTime>
  1030. <amContainerLogs>http://host.domain.com:9999/node/containerlogs/container_1326821518301_0005_01_000001</amContainerLogs>
  1031. <amHostHttpAddress>host.domain.com:9999</amHostHttpAddress>
  1032. </app>
  1033. +---+
  1034. * Cluster Nodes API
  1035. 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.
  1036. ** URI
  1037. ------
  1038. * http://<rm http address:port>/ws/v1/cluster/nodes
  1039. ------
  1040. ** HTTP Operations Supported
  1041. ------
  1042. * GET
  1043. ------
  1044. ** Query Parameters Supported
  1045. ------
  1046. * state - the state of the node
  1047. * healthy - true or false
  1048. ------
  1049. ** Elements of the <nodes> object
  1050. When you make a request for the list of nodes, the information will be returned as a collection of node objects.
  1051. See also {{Node API}} for syntax of the node object.
  1052. *---------------+--------------+-------------------------------+
  1053. || Item || Data Type || Description |
  1054. *---------------+--------------+-------------------------------+
  1055. | node | array of node objects(JSON)/zero or more node objects(XML) | A collection of node objects |
  1056. *---------------+--------------+-------------------------------+
  1057. ** Response Examples
  1058. <<JSON response>>
  1059. HTTP Request:
  1060. ------
  1061. GET http://<rm http address:port>/ws/v1/cluster/nodes
  1062. ------
  1063. Response Header:
  1064. +---+
  1065. HTTP/1.1 200 OK
  1066. Content-Type: application/json
  1067. Transfer-Encoding: chunked
  1068. Server: Jetty(6.1.26)
  1069. +---+
  1070. Response Body:
  1071. +---+
  1072. {
  1073. "nodes":
  1074. {
  1075. "node":
  1076. [
  1077. {
  1078. "rack":"\/default-rack",
  1079. "state":"NEW",
  1080. "id":"h2:1235",
  1081. "nodeHostName":"h2",
  1082. "nodeHTTPAddress":"h2:2",
  1083. "healthStatus":"Healthy",
  1084. "lastHealthUpdate":1324056895432,
  1085. "healthReport":"Healthy",
  1086. "numContainers":0,
  1087. "usedMemoryMB":0
  1088. "availMemoryMB":8192
  1089. },
  1090. {
  1091. "rack":"\/default-rack",
  1092. "state":"NEW",
  1093. "id":"h1:1234",
  1094. "nodeHostName":"h1",
  1095. "nodeHTTPAddress":"h1:2",
  1096. "healthStatus":"Healthy",
  1097. "lastHealthUpdate":1324056895092,
  1098. "healthReport":"Healthy",
  1099. "numContainers":0,
  1100. "usedMemoryMB":0,
  1101. "availMemoryMB":8192
  1102. }
  1103. ]
  1104. }
  1105. }
  1106. +---+
  1107. <<JSON response>>
  1108. HTTP Request:
  1109. ------
  1110. GET http://<rm http address:port>/ws/v1/cluster/nodes
  1111. Accept: application/xml
  1112. ------
  1113. Response Header:
  1114. +---+
  1115. HTTP/1.1 200 OK
  1116. Content-Type: application/xml
  1117. Content-Length: 1104
  1118. Server: Jetty(6.1.26)
  1119. +---+
  1120. Response Body:
  1121. +---+
  1122. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  1123. <nodes>
  1124. <node>
  1125. <rack>/default-rack</rack>
  1126. <state>RUNNING</state>
  1127. <id>h2:1234</id>
  1128. <nodeHostName>h2</nodeHostName>
  1129. <nodeHTTPAddress>h2:2</nodeHTTPAddress>
  1130. <healthStatus>Healthy</healthStatus>
  1131. <lastHealthUpdate>1324333268447</lastHealthUpdate>
  1132. <healthReport>Healthy</healthReport>
  1133. <numContainers>0</numContainers>
  1134. <usedMemoryMB>0</usedMemoryMB>
  1135. <availMemoryMB>5120</availMemoryMB>
  1136. </node>
  1137. <node>
  1138. <rack>/default-rack</rack>
  1139. <state>RUNNING</state>
  1140. <id>h1:1234</id>
  1141. <nodeHostName>h1</nodeHostName>
  1142. <nodeHTTPAddress>h1:2</nodeHTTPAddress>
  1143. <healthStatus>Healthy</healthStatus>
  1144. <lastHealthUpdate>1324333268447</lastHealthUpdate>
  1145. <healthReport>Healthy</healthReport>
  1146. <numContainers>0</numContainers>
  1147. <usedMemoryMB>0</usedMemoryMB>
  1148. <availMemoryMB>5120</availMemoryMB>
  1149. </node>
  1150. </nodes>
  1151. +---+
  1152. * Cluster {Node API}
  1153. A node resource contains information about a node in the cluster.
  1154. ** URI
  1155. Use the following URI to obtain a Node Object, from a node identified by the {nodeid} value.
  1156. ------
  1157. * http://<rm http address:port>/ws/v1/cluster/nodes/{nodeid}
  1158. ------
  1159. ** HTTP Operations Supported
  1160. ------
  1161. * GET
  1162. ------
  1163. ** Query Parameters Supported
  1164. ------
  1165. None
  1166. ------
  1167. ** Elements of the <node> object
  1168. *---------------+--------------+-------------------------------+
  1169. || Item || Data Type || Description |
  1170. *---------------+--------------+-------------------------------+
  1171. | rack | string | The rack location of this node |
  1172. *---------------+--------------+-------------------------------+
  1173. | state | string | State of the node - valid values are: NEW, RUNNING, UNHEALTHY, DECOMMISSIONED, LOST, REBOOTED |
  1174. *---------------+--------------+-------------------------------+
  1175. | id | string | The node id |
  1176. *---------------+--------------+-------------------------------+
  1177. | nodeHostName | string | The host name of the node|
  1178. *---------------+--------------+-------------------------------+
  1179. | nodeHTTPAddress | string | The nodes HTTP address|
  1180. *---------------+--------------+-------------------------------+
  1181. | healthStatus | string | The health status of the node - Healthy or Unhealthy |
  1182. *---------------+--------------+-------------------------------+
  1183. | healthReport | string | A detailed health report |
  1184. *---------------+--------------+-------------------------------+
  1185. | lastHealthUpdate | long | The last time the node reported its health (in ms since epoch)|
  1186. *---------------+--------------+-------------------------------+
  1187. | usedMemoryMB | long | The total about of memory currently used on the node (in MB)|
  1188. *---------------+--------------+-------------------------------+
  1189. | availMemoryMB | long | The total amount of memory currently available on the node (in MB)|
  1190. *---------------+--------------+-------------------------------+
  1191. | numContainers | int | The total number of containers currently running on the node|
  1192. *---------------+--------------+-------------------------------+
  1193. ** Response Examples
  1194. <<JSON response>>
  1195. HTTP Request:
  1196. ------
  1197. GET http://<rm http address:port>/ws/v1/cluster/nodes/h2:1235
  1198. ------
  1199. Response Header:
  1200. +---+
  1201. HTTP/1.1 200 OK
  1202. Content-Type: application/json
  1203. Transfer-Encoding: chunked
  1204. Server: Jetty(6.1.26)
  1205. +---+
  1206. Response Body:
  1207. +---+
  1208. {
  1209. "node":
  1210. {
  1211. "rack":"\/default-rack",
  1212. "state":"NEW",
  1213. "id":"h2:1235",
  1214. "nodeHostName":"h2",
  1215. "nodeHTTPAddress":"h2:2",
  1216. "healthStatus":"Healthy",
  1217. "lastHealthUpdate":1324056895432,
  1218. "healthReport":"Healthy",
  1219. "numContainers":0,
  1220. "usedMemoryMB":0,
  1221. "availMemoryMB":5120
  1222. }
  1223. }
  1224. +---+
  1225. <<JSON response>>
  1226. HTTP Request:
  1227. ------
  1228. GET http://<rm http address:port>/ws/v1/cluster/node/h2:1235
  1229. Accept: application/xml
  1230. ------
  1231. Response Header:
  1232. +---+
  1233. HTTP/1.1 200 OK
  1234. Content-Type: application/xml
  1235. Content-Length: 552
  1236. Server: Jetty(6.1.26)
  1237. +---+
  1238. Response Body:
  1239. +---+
  1240. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  1241. <node>
  1242. <rack>/default-rack</rack>
  1243. <state>NEW</state>
  1244. <id>h2:1235</id>
  1245. <nodeHostName>h2</nodeHostName>
  1246. <nodeHTTPAddress>h2:2</nodeHTTPAddress>
  1247. <healthStatus>Healthy</healthStatus>
  1248. <lastHealthUpdate>1324333268447</lastHealthUpdate>
  1249. <healthReport>Healthy</healthReport>
  1250. <numContainers>0</numContainers>
  1251. <usedMemoryMB>0</usedMemoryMB>
  1252. <availMemoryMB>5120</availMemoryMB>
  1253. </node>
  1254. +---+