From 6b25440d84c0d4fc512fdb95b3a47ae315858367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Hud=C3=A1ky?= Date: Mon, 20 Jul 2020 15:53:09 +0200 Subject: [PATCH] YARN-9136.002 --- .../src/site/markdown/NodeManagerRest.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManagerRest.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManagerRest.md index 88e6f7fc69f..8b586994436 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManagerRest.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/NodeManagerRest.md @@ -681,3 +681,89 @@ Response Body: ``` + +Resources API +------------- + +With Resources API, you can list the GPU and FPGA resources present on this NodeManager. + +### URI + +Use the following URI to obtain resources on the NodeManager + + * http://nm-http-address:port/ws/v1/node/resources/{resourcename} + +### HTTP Operations Supported + + * GET + +### Query Parameters Supported + + None + +### Elements of the *NMDeviceResourceInfo* object + +The response to this request if there are FPGA device(s) present + +| Properties | Data Type | Description | +|:---- |:---- |:---- | +| totalDevices | List of Device objects | Contains the representations of any devices | +| assignedDevices | List of AssignedDevice objects | In addition to Device, AssignedDevice include container ID | + +### Elements of the *NMGpuResourceInfo* object + +The response to this request if there are only GPU devices present. + +| Properties | Data Type | Description | +|:---- |:---- |:---- | +| gpuDeviceInformation | GpuDeviceInformation | Contains all GPU Device Information in the system, fetched from nvidia-smi. | +| totalGpuDevices | List of GpuDevice objects | Contains the representations of GPU devices | +| assignedGpuDevices | List of AssignedGpuDevice objects | In addition to GpuDevice, AssignedGpuDevice include container ID | + +### GET Response Examples + +**JSON response** + +HTTP Request: + + GET http://nm-http-address:port/ws/v1/node/resources/yarn.io%2Fgpu + +Response Header: + + Cache-Control: no-cache + Pragma: no-cache + X-Content-Type-Options: nosniff + X-XSS-Protection: 1; mode=block + X-Frame-Options: SAMEORIGIN + Content-Type: application/json;charset=utf-8 + Vary: Accept-Encoding + Content-Encoding: gzip + Transfer-Encoding: chunked + +Response Body: + +```json +{ + "gpuDeviceInformation": null, + "totalGpuDevices": [ + { + "index": 0, + "minorNumber": 0 + }, + { + "index": 1, + "minorNumber": 1 + }, + { + "index": 2, + "minorNumber": 2 + }, + { + "index": 3, + "minorNumber": 4 + } + ], + "assignedGpuDevices": [] +} +``` + -- 2.24.1 (Apple Git-126)