123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635 |
- ~~ 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.
- ---
- NodeManager REST API's.
- ---
- ---
- ${maven.build.timestamp}
- NodeManager REST API's.
- \[ {{{./index.html}Go Back}} \]
- %{toc|section=1|fromDepth=0|toDepth=2}
- * Overview
- The NodeManager REST API's allow the user to get status on the node and information about applications and containers running on that node.
-
- * NodeManager Information API
- The node information resource provides overall information about that particular node.
- ** URI
- Both of the following URI's give you the cluster information.
- ------
- * http://<nm http address:port>/ws/v1/node
- * http://<nm http address:port>/ws/v1/node/info
- ------
- ** HTTP Operations Supported
- ------
- * GET
- ------
- ** Query Parameters Supported
- ------
- None
- ------
- ** Elements of the <nodeInfo> object
- *---------------+--------------+-------------------------------+
- || Item || Data Type || Description |
- *---------------+--------------+-------------------------------+
- | id | long | The NodeManager id |
- *---------------+--------------+-------------------------------+
- | nodeHostName | string | The host name of the NodeManager |
- *---------------+--------------+-------------------------------+
- | totalPmemAllocatedContainersMB | long | The amount of physical memory allocated for use by containers in MB |
- *---------------+--------------+-------------------------------+
- | totalVmemAllocatedContainersMB | long | The amount of virtual memory allocated for use by containers in MB |
- *---------------+--------------+-------------------------------+
- | lastNodeUpdateTime | long | The last timestamp at which the health report was received (in ms since epoch)|
- *---------------+--------------+-------------------------------+
- | healthReport | string | The diagnostic health report of the node |
- *---------------+--------------+-------------------------------+
- | nodeHealthy | boolean | true/false indicator of if the node is healthy|
- *---------------+--------------+-------------------------------+
- | nodeManagerVersion | string | Version of the NodeManager |
- *---------------+--------------+-------------------------------+
- | nodeManagerBuildVersion | string | NodeManager build string with build version, user, and checksum |
- *---------------+--------------+-------------------------------+
- | nodeManagerVersionBuiltOn | string | Timestamp when NodeManager was built(in ms since epoch) |
- *---------------+--------------+-------------------------------+
- | hadoopVersion | string | Version of hadoop common |
- *---------------+--------------+-------------------------------+
- | hadoopBuildVersion | string | Hadoop common build string with build version, user, and checksum |
- *---------------+--------------+-------------------------------+
- | hadoopVersionBuiltOn | string | Timestamp when hadoop common was built(in ms since epoch) |
- *---------------+--------------+-------------------------------+
- ** Response Examples
- <<JSON response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/info
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/json
- Transfer-Encoding: chunked
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- {
- "nodeInfo" : {
- "hadoopVersionBuiltOn" : "Mon Jan 9 14:58:42 UTC 2012",
- "nodeManagerBuildVersion" : "0.23.1-SNAPSHOT from 1228355 by user1 source checksum 20647f76c36430e888cc7204826a445c",
- "lastNodeUpdateTime" : 1326222266126,
- "totalVmemAllocatedContainersMB" : 17203,
- "nodeHealthy" : true,
- "healthReport" : "",
- "totalPmemAllocatedContainersMB" : 8192,
- "nodeManagerVersionBuiltOn" : "Mon Jan 9 15:01:59 UTC 2012",
- "nodeManagerVersion" : "0.23.1-SNAPSHOT",
- "id" : "host.domain.com:8041",
- "hadoopBuildVersion" : "0.23.1-SNAPSHOT from 1228292 by user1 source checksum 3eba233f2248a089e9b28841a784dd00",
- "nodeHostName" : "host.domain.com",
- "hadoopVersion" : "0.23.1-SNAPSHOT"
- }
- }
- +---+
- <<XML response>>
- HTTP Request:
- -----
- Accept: application/xml
- GET http://<nm http address:port>/ws/v1/node/info
- -----
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/xml
- Content-Length: 983
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <nodeInfo>
- <healthReport/>
- <totalVmemAllocatedContainersMB>17203</totalVmemAllocatedContainersMB>
- <totalPmemAllocatedContainersMB>8192</totalPmemAllocatedContainersMB>
- <lastNodeUpdateTime>1326222386134</lastNodeUpdateTime>
- <nodeHealthy>true</nodeHealthy>
- <nodeManagerVersion>0.23.1-SNAPSHOT</nodeManagerVersion>
- <nodeManagerBuildVersion>0.23.1-SNAPSHOT from 1228355 by user1 source checksum 20647f76c36430e888cc7204826a445c</nodeManagerBuildVersion>
- <nodeManagerVersionBuiltOn>Mon Jan 9 15:01:59 UTC 2012</nodeManagerVersionBuiltOn>
- <hadoopVersion>0.23.1-SNAPSHOT</hadoopVersion>
- <hadoopBuildVersion>0.23.1-SNAPSHOT from 1228292 by user1 source checksum 3eba233f2248a089e9b28841a784dd00</hadoopBuildVersion>
- <hadoopVersionBuiltOn>Mon Jan 9 14:58:42 UTC 2012</hadoopVersionBuiltOn>
- <id>host.domain.com:8041</id>
- <nodeHostName>host.domain.com</nodeHostName>
- </nodeInfo>
- +---+
- * Applications API
- 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. See also {{Application API}} for syntax of the application object.
- ** URI
- ------
- * http://<nm http address:port>/ws/v1/node/apps
- ------
- ** HTTP Operations Supported
- ------
- * GET
- ------
- ** Query Parameters Supported
- Multiple paramters can be specified.
- ------
- * state - application state
- * user - user name
- ------
- ** Elements of the <apps> (Applications) object
- When you make a request for the list of applications, the information will be returned as a collection of app objects.
- See also {{Application API}} for syntax of the app object.
- *---------------+--------------+-------------------------------+
- || Item || Data Type || Description |
- *---------------+--------------+-------------------------------+
- | app | array of app objects(JSON)/zero or more app objects(XML) | A collection of application objects |
- *---------------+--------------+--------------------------------+
- ** Response Examples
- <<JSON response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/apps
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/json
- Transfer-Encoding: chunked
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- {
- "apps" : {
- "app" : [
- {
- "containerids" : [
- "container_1326121700862_0003_01_000001",
- "container_1326121700862_0003_01_000002"
- ],
- "user" : "user1",
- "id" : "application_1326121700862_0003",
- "state" : "RUNNING"
- },
- {
- "user" : "user1",
- "id" : "application_1326121700862_0002",
- "state" : "FINISHED"
- }
- ]
- }
- }
- +---+
- <<XML response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/apps
- Accept: application/xml
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/xml
- Content-Length: 400
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <apps>
- <app>
- <id>application_1326121700862_0002</id>
- <state>FINISHED</state>
- <user>user1</user>
- </app>
- <app>
- <id>application_1326121700862_0003</id>
- <state>RUNNING</state>
- <user>user1</user>
- <containerids>container_1326121700862_0003_01_000002</containerids>
- <containerids>container_1326121700862_0003_01_000001</containerids>
- </app>
- </apps>
- +---+
- * {Application API}
- An application resource contains information about a particular application that was run or is running on this NodeManager.
- ** URI
- Use the following URI to obtain an app Object, for a application identified by the {appid} value.
- ------
- * http://<nm http address:port>/ws/v1/node/apps/{appid}
- ------
- ** HTTP Operations Supported
- ------
- * GET
- ------
- ** Query Parameters Supported
- ------
- None
- ------
- ** Elements of the <app> (Application) object
- *---------------+--------------+-------------------------------+
- || Item || Data Type || Description |
- *---------------+--------------+-------------------------------+
- | id | string | The application id |
- *---------------+--------------+--------------------------------+
- | user | string | The user who started the application |
- *---------------+--------------+--------------------------------+
- | state | string | The state of the application - valid states are: NEW, INITING, RUNNING, FINISHING_CONTAINERS_WAIT, APPLICATION_RESOURCES_CLEANINGUP, FINISHED |
- *---------------+--------------+--------------------------------+
- | containerids | array of containerids(JSON)/zero or more containerids(XML) | The list of containerids currently being used by the application on this node. If not present then no containers are currently running for this application.|
- *---------------+--------------+--------------------------------+
- ** Response Examples
- <<JSON response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/apps/application_1326121700862_0005
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/json
- Transfer-Encoding: chunked
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- {
- "app" : {
- "containerids" : [
- "container_1326121700862_0005_01_000003",
- "container_1326121700862_0005_01_000001"
- ],
- "user" : "user1",
- "id" : "application_1326121700862_0005",
- "state" : "RUNNING"
- }
- }
- +---+
- <<XML response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/apps/application_1326121700862_0005
- Accept: application/xml
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/xml
- Content-Length: 281
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <app>
- <id>application_1326121700862_0005</id>
- <state>RUNNING</state>
- <user>user1</user>
- <containerids>container_1326121700862_0005_01_000003</containerids>
- <containerids>container_1326121700862_0005_01_000001</containerids>
- </app>
- +---+
- * Containers API
- With the containers API, you can obtain a collection of resources, each of which represents a container. When you run a GET operation on this resource, you obtain a collection of Container Objects. See also {{Container API}} for syntax of the container object.
- ** URI
- ------
- * http://<nm http address:port>/ws/v1/node/containers
- ------
- ** HTTP Operations Supported
- ------
- * GET
- ------
- ** Query Parameters Supported
- ------
- None
- ------
- ** Elements of the <containers> object
- When you make a request for the list of containers, the information will be returned as collection of container objects.
- See also {{Container API}} for syntax of the container object.
- *---------------+--------------+-------------------------------+
- || Item || Data Type || Description |
- *---------------+--------------+-------------------------------+
- | containers | array of container objects(JSON)/zero or more container objects(XML) | A collection of container objects |
- *---------------+--------------+-------------------------------+
- ** Response Examples
- <<JSON response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/containers
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/json
- Transfer-Encoding: chunked
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- {
- "containers" : {
- "container" : [
- {
- "nodeId" : "host.domain.com:8041",
- "totalMemoryNeededMB" : 2048,
- "state" : "RUNNING",
- "diagnostics" : "",
- "containerLogsLink" : "http://host.domain.com:8042/node/containerlogs/container_1326121700862_0006_01_000001/user1",
- "user" : "user1",
- "id" : "container_1326121700862_0006_01_000001",
- "exitCode" : -1000
- },
- {
- "nodeId" : "host.domain.com:8041",
- "totalMemoryNeededMB" : 2048,
- "state" : "RUNNING",
- "diagnostics" : "",
- "containerLogsLink" : "http://host.domain.com:8042/node/containerlogs/container_1326121700862_0006_01_000003/user1",
- "user" : "user1",
- "id" : "container_1326121700862_0006_01_000003",
- "exitCode" : -1000
- }
- ]
- }
- }
- +---+
- <<XML response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/containers
- Accept: application/xml
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/xml
- Content-Length: 988
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <containers>
- <container>
- <id>container_1326121700862_0006_01_000001</id>
- <state>RUNNING</state>
- <exitCode>-1000</exitCode>
- <diagnostics/>
- <user>user1</user>
- <totalMemoryNeededMB>2048</totalMemoryNeededMB>
- <containerLogsLink>http://host.domain.com:8042/node/containerlogs/container_1326121700862_0006_01_000001/user1</containerLogsLink>
- <nodeId>host.domain.com:8041</nodeId>
- </container>
- <container>
- <id>container_1326121700862_0006_01_000003</id>
- <state>DONE</state>
- <exitCode>0</exitCode>
- <diagnostics>Container killed by the ApplicationMaster.</diagnostics>
- <user>user1</user>
- <totalMemoryNeededMB>2048</totalMemoryNeededMB>
- <containerLogsLink>http://host.domain.com:8042/node/containerlogs/container_1326121700862_0006_01_000003/user1</containerLogsLink>
- <nodeId>host.domain.com:8041</nodeId>
- </container>
- </containers>
- +---+
- * {Container API}
- A container resource contains information about a particular container that is running on this NodeManager.
- ** URI
- Use the following URI to obtain a Container Object, from a container identified by the {containerid} value.
- ------
- * http://<nm http address:port>/ws/v1/node/containers/{containerid}
- ------
- ** HTTP Operations Supported
- ------
- * GET
- ------
- ** Query Parameters Supported
- ------
- None
- ------
- ** Elements of the <container> object
- *---------------+--------------+-------------------------------+
- || Item || Data Type || Description |
- *---------------+--------------+-------------------------------+
- | id | string | The container id |
- *---------------+--------------+-------------------------------+
- | state | string | State of the container - valid states are: NEW, LOCALIZING, LOCALIZATION_FAILED, LOCALIZED, RUNNING, EXITED_WITH_SUCCESS, EXITED_WITH_FAILURE, KILLING, CONTAINER_CLEANEDUP_AFTER_KILL, CONTAINER_RESOURCES_CLEANINGUP, DONE|
- *---------------+--------------+-------------------------------+
- | nodeId | string | The id of the node the container is on|
- *---------------+--------------+-------------------------------+
- | containerLogsLink | string | The http link to the container logs |
- *---------------+--------------+-------------------------------+
- | user | string | The user name of the user which started the container|
- *---------------+--------------+-------------------------------+
- | exitCode | int | Exit code of the container |
- *---------------+--------------+-------------------------------+
- | diagnostics | string | A diagnostic message for failed containers |
- *---------------+--------------+-------------------------------+
- | totalMemoryNeededMB | long | Total amout of memory needed by the container (in MB) |
- *---------------+--------------+-------------------------------+
- ** Response Examples
- <<JSON response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/nodes/containers/container_1326121700862_0007_01_000001
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/json
- Transfer-Encoding: chunked
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- {
- "container" : {
- "nodeId" : "host.domain.com:8041",
- "totalMemoryNeededMB" : 2048,
- "state" : "RUNNING",
- "diagnostics" : "",
- "containerLogsLink" : "http://host.domain.com:8042/node/containerlogs/container_1326121700862_0007_01_000001/user1",
- "user" : "user1",
- "id" : "container_1326121700862_0007_01_000001",
- "exitCode" : -1000
- }
- }
- +---+
- <<XML response>>
- HTTP Request:
- ------
- GET http://<nm http address:port>/ws/v1/node/containers/container_1326121700862_0007_01_000001
- Accept: application/xml
- ------
- Response Header:
- +---+
- HTTP/1.1 200 OK
- Content-Type: application/xml
- Content-Length: 491
- Server: Jetty(6.1.26)
- +---+
- Response Body:
- +---+
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <container>
- <id>container_1326121700862_0007_01_000001</id>
- <state>RUNNING</state>
- <exitCode>-1000</exitCode>
- <diagnostics/>
- <user>user1</user>
- <totalMemoryNeededMB>2048</totalMemoryNeededMB>
- <containerLogsLink>http://host.domain.com:8042/node/containerlogs/container_1326121700862_0007_01_000001/user1</containerLogsLink>
- <nodeId>host.domain.com:8041</nodeId>
- </container>
- +---+
|