YARN-9136. getNMResourceInfo NodeManager REST API method is not documented

This commit is contained in:
Adam Antal 2020-09-07 10:29:20 +02:00
parent 1841a5bb03
commit dd6c66556e

View File

@ -681,3 +681,109 @@ Response Body:
</service> </service>
</services> </services>
``` ```
Resources API
-------------
With Resources API, you can list the GPU resources present on the 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 *NMGpuResourceInfo* object
The response to this request if any GPU device is present on the NodeManager.
| Properties | Data Type | Description |
|:---- |:---- |:---- |
| gpuDeviceInformation | GpuDeviceInformation | Contains all GPU Device Information in the system |
| totalGpuDevices | List of GpuDevice objects | Contains the representations of GPU devices |
| assignedGpuDevices | List of AssignedGpuDevice objects | In addition to GpuDevice, AssignedGpuDevice includes container ID |
### Elements of the *GpuDeviceInformation* object
| Properties | Data Type | Description |
|:---- |:---- |:---- |
| gpus | List of PerGpuDeviceInformation objects | Information objects about specific GPU devices |
| driverVersion | String | ... |
### Elements of the *PerGpuDeviceInformation* object
| Properties | Data Type | Description |
|:---- |:---- |:---- |
| productName | String | Name of the GPU device |
| uuid | String | Universally unique identifier of the GPU device |
| minorNumber | int | Secondary identifier of the GPU device |
### Elements of the *GpuDevice* object
| Properties | Data Type | Description |
|:---- |:---- |:---- |
| index | int | Main identifier of the GPU device |
| minorNumber | int | Secondary identifier of the GPU device |
### Elements of the *AssignedGpuDevice* object
| Properties | Data Type | Description |
|:---- |:---- |:---- |
| index | int | Main identifier of the GPU device |
| minorNumber | int | Secondary identifier of the GPU device |
| containerId | String | Identifier of the container |
### 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": []
}
```