diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md index f478403..7db094f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md @@ -2092,6 +2092,155 @@ Response Body: ``` +Cluster Application Attempt Containers API +-------------------------------- + +With this endpoint, you can obtain all the containers belonging to an application attempt. + +### URI + + * http://rm-http-address:port/ws/v1/cluster/apps/{appid}/appattempts/{appattemptid}/containers + +### HTTP Operations Supported + + * GET + +### Query Parameters Supported + + None + +### Elements of the *containers* object + +When you make a request for the list of app attempt containers, the information will be returned as an array of container objects. + +containers: + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| container | array of container objects (JSON) / zero or more container objects (XML) | The collection of container objects | + +### Elements of the *container* object + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| containerId | string | The container ID | +| allocatedMB | long | The allocated memory of the container (in MB) | +| allocatedVCores | long | The number of allocated virtual CPU cores of the container | +| allocatedResources | map | Map of the resources of the container (also including memory and CPU) | +| assignedNodeId | string | The node ID of the node the container was allocated on | +| nodeId | string | The node ID of the node the container ran on | +| nodeHttpAddress | string | The node http address of the node the container ran on | +| priority | int | The allocated priority of the container | +| logUrl | string | The http link to the container logs | +| startedTime | long | The creation time of the container (in ms since epoch) | +| finishedTime | long | The finish time of the container (in ms since epoch) | +| elapsedTime | long | The elapsed time between the start and the finish time of the container (in ms) | +| diagnosticsInfo | string | The diagnostics info of the container | +| containerExitStatus | int | The final exit status of the container | +| containerState | string of ContainerState | The final ContainerState of the container | + +### Response Examples + +**JSON response** + +HTTP Request: + + GET http://rm-http-address:port/ws/v1/cluster/apps/application_1511522535584_0005/appattempts/appattempt_1511522535584_0005_000001/containers + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) + +Response Body: + +```json +{ + "containers" : { + "container" : [ + { + "containerId": "container_e134_application_1511522535584_0005_01_000001", + "allocatedMB": "4096", + "allocatedVCores": "1", + "assignedNodeId": "host.domain.com:8041", + "priority": "0", + "startedTime": "1511524230309", + "finishedTime": "0", + "elapsedTime": "545129", + "logUrl": "http://host.domain.com:8042/node/containerlogs/container_e134_application_1511522535584_0005_01_000001/root", + "containerExitStatus": "0", + "containerState": "RUNNING", + "nodeHttpAddress": "host.domain.com:8042", + "nodeId": "host.domain.com:8041", + "logsLink" : "http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001/user1", + "containerId" : "container_1326821518301_0005_01_000001", + "allocatedResources": { + "entry": [ + { + "key": "memory-mb", + "value": "4096" + }, + { + "key": "vcores", + "value": "1" + } + ] + } + } + ] + } +} +``` + +**XML response** + +HTTP Request: + + GET http://rm-http-address:port/ws/v1/cluster/apps/application_1511522535584_0005/appattempts/appattempt_1511522535584_0005_000001/containers + Accept: application/xml + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 550 + Server: Jetty(6.1.26) + +Response Body: + +```xml + + + + container_e134_application_1511522535584_0005_01_000001 + 4096 + 1 + host.domain.com:8041 + 0 + 1511524230309 + 0 + 545129 + http://host.domain.com:8042/node/containerlogs/container_e134_application_1511522535584_0005_01_000001/root + 0 + RUNNING + http://host.domain.com:8042 + host.domain.com:8041 + + + memory-mb + 4096 + + + vcores + 1 + + + + +``` + Cluster Nodes API -----------------